You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3395 lines
1.5 MiB
3395 lines
1.5 MiB
var Si=(w,r,o)=>new Promise((a,v)=>{var h=U=>{try{D(o.next(U))}catch(V){v(V)}},b=U=>{try{D(o.throw(U))}catch(V){v(V)}},D=U=>U.done?a(U.value):Promise.resolve(U.value).then(h,b);D((o=o.apply(w,r)).next())});class PubSub{constructor(){this.events={}}on(r,o){let a=this;a.events||(a.events={}),a.events.hasOwnProperty(r)||(a.events[r]=[]),a.events[r].push(o)}emit(r,...o){let a=this;a.events||(a.events={}),a.events.hasOwnProperty(r)&&a.events[r].map(v=>v(...o))}off(r,o){if(this.events[r])if(o===void 0)this.events[r]=[];else{const a=this.events[r].indexOf(o);this.events[r].splice(a,1)}}}class Store{constructor(r){let o=this;o.actions={},o.mutations={},o.state=r.state,o.status="resting",o.events=new PubSub,r.hasOwnProperty("actions")&&(o.actions=r.actions),r.hasOwnProperty("mutations")&&(o.mutations=r.mutations)}dispatch(r,o){let a=this;return typeof a.actions[r]=="function"&&(console.groupCollapsed(`ACTION: ${r}`),a.status="action",a.actions[r](a,o),console.groupEnd(),!0)}commit(r,o){let a=this;if(typeof a.mutations[r]!="function")return console.log(`Mutation "${r}" doesn't exist`),!1;a.status="mutation";let v=a.mutations[r](a.state,o);return a.state=Object.assign(a.state,v),!0}}const options={state:{MxFun:null,Mxassembly:null,isCreateDrawObj:!1},actions:{},mutations:{}};for(let w in options.state){const r=w.charAt(0).toUpperCase()+w.slice(1);options.mutations["set"+r]=(o,a)=>{o[w]=a}}const store=new Store(options);function mxfun(){(function w(r,o,a){function v(D,U){if(!o[D]){if(!r[D]){var V=typeof require=="function"&&require;if(!U&&V)return V(D,!0);if(h)return h(D,!0);var I=new Error("Cannot find module '"+D+"'");throw I.code="MODULE_NOT_FOUND",I}var g=o[D]={exports:{}};r[D][0].call(g.exports,function(A){return v(r[D][1][A]||A)},g,g.exports,w,r,o,a)}return o[D].exports}for(var h=typeof require=="function"&&require,b=0;b<a.length;b++)v(a[b]);return v})({1:[function(w,r,o){var a={};(0,w("./lib/utils/common").assign)(a,w("./lib/deflate"),w("./lib/inflate"),w("./lib/zlib/constants")),r.exports=a},{"./lib/deflate":2,"./lib/inflate":3,"./lib/utils/common":4,"./lib/zlib/constants":7}],2:[function(w,r,o){var a=w("./zlib/deflate"),v=w("./utils/common"),h=w("./utils/strings"),b=w("./zlib/messages"),D=w("./zlib/zstream"),U=Object.prototype.toString,V=0,I=-1,g=0,A=8;function M(F){if(!(this instanceof M))return new M(F);this.options=v.assign({level:I,method:A,chunkSize:16384,windowBits:15,memLevel:8,strategy:g,to:""},F||{});var T=this.options;T.raw&&0<T.windowBits?T.windowBits=-T.windowBits:T.gzip&&0<T.windowBits&&T.windowBits<16&&(T.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new D,this.strm.avail_out=0;var _=a.deflateInit2(this.strm,T.level,T.method,T.windowBits,T.memLevel,T.strategy);if(_!==V)throw new Error(b[_]);if(T.header&&a.deflateSetHeader(this.strm,T.header),T.dictionary){var Y;if(Y=typeof T.dictionary=="string"?h.string2buf(T.dictionary):U.call(T.dictionary)==="[object ArrayBuffer]"?new Uint8Array(T.dictionary):T.dictionary,(_=a.deflateSetDictionary(this.strm,Y))!==V)throw new Error(b[_]);this._dict_set=!0}}function N(F,T){var _=new M(T);if(_.push(F,!0),_.err)throw _.msg||b[_.err];return _.result}M.prototype.push=function(F,T){var _,Y,k=this.strm,S=this.options.chunkSize;if(this.ended)return!1;Y=T===~~T?T:T===!0?4:0,typeof F=="string"?k.input=h.string2buf(F):U.call(F)==="[object ArrayBuffer]"?k.input=new Uint8Array(F):k.input=F,k.next_in=0,k.avail_in=k.input.length;do{if(k.avail_out===0&&(k.output=new v.Buf8(S),k.next_out=0,k.avail_out=S),(_=a.deflate(k,Y))!==1&&_!==V)return this.onEnd(_),!(this.ended=!0);k.avail_out!==0&&(k.avail_in!==0||Y!==4&&Y!==2)||(this.options.to==="string"?this.onData(h.buf2binstring(v.shrinkBuf(k.output,k.next_out))):this.onData(v.shrinkBuf(k.output,k.next_out)))}while((0<k.avail_in||k.avail_out===0)&&_!==1);return Y===4?(_=a.deflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===V):Y!==2||(this.onEnd(V),!(k.avail_out=0))},M.prototype.onData=function(F){this.chunks.push(F)},M.prototype.onEnd=function(F){F===V&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=v.flattenChunks(this.chunks)),this.chunks=[],this.err=F,this.msg=this.strm.msg},o.Deflate=M,o.deflate=N,o.deflateRaw=function(F,T){return(T=T||{}).raw=!0,N(F,T)},o.gzip=function(F,T){return(T=T||{}).gzip=!0,N(F,T)}},{"./utils/common":4,"./utils/strings":5,"./zlib/deflate":9,"./zlib/messages":14,"./zlib/zstream":16}],3:[function(w,r,o){var a=w("./zlib/inflate"),v=w("./utils/common"),h=w("./utils/strings"),b=w("./zlib/constants"),D=w("./zlib/messages"),U=w("./zlib/zstream"),V=w("./zlib/gzheader"),I=Object.prototype.toString;function g(M){if(!(this instanceof g))return new g(M);this.options=v.assign({chunkSize:16384,windowBits:0,to:""},M||{});var N=this.options;N.raw&&0<=N.windowBits&&N.windowBits<16&&(N.windowBits=-N.windowBits,N.windowBits===0&&(N.windowBits=-15)),!(0<=N.windowBits&&N.windowBits<16)||M&&M.windowBits||(N.windowBits+=32),15<N.windowBits&&N.windowBits<48&&!(15&N.windowBits)&&(N.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new U,this.strm.avail_out=0;var F=a.inflateInit2(this.strm,N.windowBits);if(F!==b.Z_OK)throw new Error(D[F]);if(this.header=new V,a.inflateGetHeader(this.strm,this.header),N.dictionary&&(typeof N.dictionary=="string"?N.dictionary=h.string2buf(N.dictionary):I.call(N.dictionary)==="[object ArrayBuffer]"&&(N.dictionary=new Uint8Array(N.dictionary)),N.raw&&(F=a.inflateSetDictionary(this.strm,N.dictionary))!==b.Z_OK))throw new Error(D[F])}function A(M,N){var F=new g(N);if(F.push(M,!0),F.err)throw F.msg||D[F.err];return F.result}g.prototype.push=function(M,N){var F,T,_,Y,k,S=this.strm,G=this.options.chunkSize,C=this.options.dictionary,B=!1;if(this.ended)return!1;T=N===~~N?N:N===!0?b.Z_FINISH:b.Z_NO_FLUSH,typeof M=="string"?S.input=h.binstring2buf(M):I.call(M)==="[object ArrayBuffer]"?S.input=new Uint8Array(M):S.input=M,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new v.Buf8(G),S.next_out=0,S.avail_out=G),(F=a.inflate(S,b.Z_NO_FLUSH))===b.Z_NEED_DICT&&C&&(F=a.inflateSetDictionary(this.strm,C)),F===b.Z_BUF_ERROR&&B===!0&&(F=b.Z_OK,B=!1),F!==b.Z_STREAM_END&&F!==b.Z_OK)return this.onEnd(F),!(this.ended=!0);S.next_out&&(S.avail_out!==0&&F!==b.Z_STREAM_END&&(S.avail_in!==0||T!==b.Z_FINISH&&T!==b.Z_SYNC_FLUSH)||(this.options.to==="string"?(_=h.utf8border(S.output,S.next_out),Y=S.next_out-_,k=h.buf2string(S.output,_),S.next_out=Y,S.avail_out=G-Y,Y&&v.arraySet(S.output,S.output,_,Y,0),this.onData(k)):this.onData(v.shrinkBuf(S.output,S.next_out)))),S.avail_in===0&&S.avail_out===0&&(B=!0)}while((0<S.avail_in||S.avail_out===0)&&F!==b.Z_STREAM_END);return F===b.Z_STREAM_END&&(T=b.Z_FINISH),T===b.Z_FINISH?(F=a.inflateEnd(this.strm),this.onEnd(F),this.ended=!0,F===b.Z_OK):T!==b.Z_SYNC_FLUSH||(this.onEnd(b.Z_OK),!(S.avail_out=0))},g.prototype.onData=function(M){this.chunks.push(M)},g.prototype.onEnd=function(M){M===b.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=v.flattenChunks(this.chunks)),this.chunks=[],this.err=M,this.msg=this.strm.msg},o.Inflate=g,o.inflate=A,o.inflateRaw=function(M,N){return(N=N||{}).raw=!0,A(M,N)},o.ungzip=A},{"./utils/common":4,"./utils/strings":5,"./zlib/constants":7,"./zlib/gzheader":10,"./zlib/inflate":12,"./zlib/messages":14,"./zlib/zstream":16}],4:[function(w,r,o){var a=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";o.assign=function(b){for(var D,U,V=Array.prototype.slice.call(arguments,1);V.length;){var I=V.shift();if(I){if(typeof I!="object")throw new TypeError(I+"must be non-object");for(var g in I)D=I,U=g,Object.prototype.hasOwnProperty.call(D,U)&&(b[g]=I[g])}}return b},o.shrinkBuf=function(b,D){return b.length===D?b:b.subarray?b.subarray(0,D):(b.length=D,b)};var v={arraySet:function(b,D,U,V,I){if(D.subarray&&b.subarray)b.set(D.subarray(U,U+V),I);else for(var g=0;g<V;g++)b[I+g]=D[U+g]},flattenChunks:function(b){var D,U,V,I,g,A;for(D=V=0,U=b.length;D<U;D++)V+=b[D].length;for(A=new Uint8Array(V),D=I=0,U=b.length;D<U;D++)g=b[D],A.set(g,I),I+=g.length;return A}},h={arraySet:function(b,D,U,V,I){for(var g=0;g<V;g++)b[I+g]=D[U+g]},flattenChunks:function(b){return[].concat.apply([],b)}};o.setTyped=function(b){b?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,v)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,h))},o.setTyped(a)},{}],5:[function(w,r,o){var a=w("./common"),v=!0,h=!0;try{String.fromCharCode.apply(null,[0])}catch(V){v=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(V){h=!1}for(var b=new a.Buf8(256),D=0;D<256;D++)b[D]=252<=D?6:248<=D?5:240<=D?4:224<=D?3:192<=D?2:1;function U(V,I){if(I<65534&&(V.subarray&&h||!V.subarray&&v))return String.fromCharCode.apply(null,a.shrinkBuf(V,I));for(var g="",A=0;A<I;A++)g+=String.fromCharCode(V[A]);return g}b[254]=b[254]=1,o.string2buf=function(V){var I,g,A,M,N,F=V.length,T=0;for(M=0;M<F;M++)(64512&(g=V.charCodeAt(M)))==55296&&M+1<F&&(64512&(A=V.charCodeAt(M+1)))==56320&&(g=65536+(g-55296<<10)+(A-56320),M++),T+=g<128?1:g<2048?2:g<65536?3:4;for(I=new a.Buf8(T),M=N=0;N<T;M++)(64512&(g=V.charCodeAt(M)))==55296&&M+1<F&&(64512&(A=V.charCodeAt(M+1)))==56320&&(g=65536+(g-55296<<10)+(A-56320),M++),g<128?I[N++]=g:(g<2048?I[N++]=192|g>>>6:(g<65536?I[N++]=224|g>>>12:(I[N++]=240|g>>>18,I[N++]=128|g>>>12&63),I[N++]=128|g>>>6&63),I[N++]=128|63&g);return I},o.buf2binstring=function(V){return U(V,V.length)},o.binstring2buf=function(V){for(var I=new a.Buf8(V.length),g=0,A=I.length;g<A;g++)I[g]=V.charCodeAt(g);return I},o.buf2string=function(V,I){var g,A,M,N,F=I||V.length,T=new Array(2*F);for(g=A=0;g<F;)if((M=V[g++])<128)T[A++]=M;else if(4<(N=b[M]))T[A++]=65533,g+=N-1;else{for(M&=N===2?31:N===3?15:7;1<N&&g<F;)M=M<<6|63&V[g++],N--;1<N?T[A++]=65533:M<65536?T[A++]=M:(M-=65536,T[A++]=55296|M>>10&1023,T[A++]=56320|1023&M)}return U(T,A)},o.utf8border=function(V,I){var g;for((I=I||V.length)>V.length&&(I=V.length),g=I-1;0<=g&&(192&V[g])==128;)g--;return!(g<0)&&g!==0&&g+b[V[g]]>I?g:I}},{"./common":4}],6:[function(w,r,o){r.exports=function(a,v,h,b){for(var D=65535&a|0,U=a>>>16&65535|0,V=0;h!==0;){for(h-=V=2e3<h?2e3:h;U=U+(D=D+v[b++]|0)|0,--V;);D%=65521,U%=65521}return D|U<<16|0}},{}],7:[function(w,r,o){r.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(w,r,o){var a=function(){for(var v,h=[],b=0;b<256;b++){v=b;for(var D=0;D<8;D++)v=1&v?3988292384^v>>>1:v>>>1;h[b]=v}return h}();r.exports=function(v,h,b,D){var U=a,V=D+b;v^=-1;for(var I=D;I<V;I++)v=v>>>8^U[255&(v^h[I])];return-1^v}},{}],9:[function(w,r,o){var a,v=w("../utils/common"),h=w("./trees"),b=w("./adler32"),D=w("./crc32"),U=w("./messages"),V=0,I=0,g=-2,A=2,M=8,N=286,F=30,T=19,_=2*N+1,Y=15,k=3,S=258,G=S+k+1,C=42,B=113;function R(q,ge){return q.msg=U[ge],ge}function u(q){return(q<<1)-(4<q?9:0)}function c(q){for(var ge=q.length;0<=--ge;)q[ge]=0}function f(q){var ge=q.state,oe=ge.pending;oe>q.avail_out&&(oe=q.avail_out),oe!==0&&(v.arraySet(q.output,ge.pending_buf,ge.pending_out,oe,q.next_out),q.next_out+=oe,ge.pending_out+=oe,q.total_out+=oe,q.avail_out-=oe,ge.pending-=oe,ge.pending===0&&(ge.pending_out=0))}function O(q,ge){h._tr_flush_block(q,0<=q.block_start?q.block_start:-1,q.strstart-q.block_start,ge),q.block_start=q.strstart,f(q.strm)}function W(q,ge){q.pending_buf[q.pending++]=ge}function X(q,ge){q.pending_buf[q.pending++]=ge>>>8&255,q.pending_buf[q.pending++]=255&ge}function J(q,ge){var oe,le,Pe=q.max_chain_length,Ye=q.strstart,ze=q.prev_length,se=q.nice_match,xe=q.strstart>q.w_size-G?q.strstart-(q.w_size-G):0,De=q.window,tt=q.w_mask,st=q.prev,mt=q.strstart+S,Rt=De[Ye+ze-1],Ot=De[Ye+ze];q.prev_length>=q.good_match&&(Pe>>=2),se>q.lookahead&&(se=q.lookahead);do if(De[(oe=ge)+ze]===Ot&&De[oe+ze-1]===Rt&&De[oe]===De[Ye]&&De[++oe]===De[Ye+1]){Ye+=2,oe++;do;while(De[++Ye]===De[++oe]&&De[++Ye]===De[++oe]&&De[++Ye]===De[++oe]&&De[++Ye]===De[++oe]&&De[++Ye]===De[++oe]&&De[++Ye]===De[++oe]&&De[++Ye]===De[++oe]&&De[++Ye]===De[++oe]&&Ye<mt);if(le=S-(mt-Ye),Ye=mt-S,ze<le){if(q.match_start=ge,se<=(ze=le))break;Rt=De[Ye+ze-1],Ot=De[Ye+ze]}}while((ge=st[ge&tt])>xe&&--Pe!=0);return ze<=q.lookahead?ze:q.lookahead}function te(q){var ge,oe,le,Pe,Ye,ze,se,xe,De,tt,st=q.w_size;do{if(Pe=q.window_size-q.lookahead-q.strstart,q.strstart>=st+(st-G)){for(v.arraySet(q.window,q.window,st,st,0),q.match_start-=st,q.strstart-=st,q.block_start-=st,ge=oe=q.hash_size;le=q.head[--ge],q.head[ge]=st<=le?le-st:0,--oe;);for(ge=oe=st;le=q.prev[--ge],q.prev[ge]=st<=le?le-st:0,--oe;);Pe+=st}if(q.strm.avail_in===0)break;if(ze=q.strm,se=q.window,xe=q.strstart+q.lookahead,tt=void 0,(De=Pe)<(tt=ze.avail_in)&&(tt=De),oe=tt===0?0:(ze.avail_in-=tt,v.arraySet(se,ze.input,ze.next_in,tt,xe),ze.state.wrap===1?ze.adler=b(ze.adler,se,tt,xe):ze.state.wrap===2&&(ze.adler=D(ze.adler,se,tt,xe)),ze.next_in+=tt,ze.total_in+=tt,tt),q.lookahead+=oe,q.lookahead+q.insert>=k)for(Ye=q.strstart-q.insert,q.ins_h=q.window[Ye],q.ins_h=(q.ins_h<<q.hash_shift^q.window[Ye+1])&q.hash_mask;q.insert&&(q.ins_h=(q.ins_h<<q.hash_shift^q.window[Ye+k-1])&q.hash_mask,q.prev[Ye&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=Ye,Ye++,q.insert--,!(q.lookahead+q.insert<k)););}while(q.lookahead<G&&q.strm.avail_in!==0)}function ne(q,ge){for(var oe,le;;){if(q.lookahead<G){if(te(q),q.lookahead<G&&ge===V)return 1;if(q.lookahead===0)break}if(oe=0,q.lookahead>=k&&(q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+k-1])&q.hash_mask,oe=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart),oe!==0&&q.strstart-oe<=q.w_size-G&&(q.match_length=J(q,oe)),q.match_length>=k)if(le=h._tr_tally(q,q.strstart-q.match_start,q.match_length-k),q.lookahead-=q.match_length,q.match_length<=q.max_lazy_match&&q.lookahead>=k){for(q.match_length--;q.strstart++,q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+k-1])&q.hash_mask,oe=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart,--q.match_length!=0;);q.strstart++}else q.strstart+=q.match_length,q.match_length=0,q.ins_h=q.window[q.strstart],q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+1])&q.hash_mask;else le=h._tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++;if(le&&(O(q,!1),q.strm.avail_out===0))return 1}return q.insert=q.strstart<k-1?q.strstart:k-1,ge===4?(O(q,!0),q.strm.avail_out===0?3:4):q.last_lit&&(O(q,!1),q.strm.avail_out===0)?1:2}function ue(q,ge){for(var oe,le,Pe;;){if(q.lookahead<G){if(te(q),q.lookahead<G&&ge===V)return 1;if(q.lookahead===0)break}if(oe=0,q.lookahead>=k&&(q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+k-1])&q.hash_mask,oe=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart),q.prev_length=q.match_length,q.prev_match=q.match_start,q.match_length=k-1,oe!==0&&q.prev_length<q.max_lazy_match&&q.strstart-oe<=q.w_size-G&&(q.match_length=J(q,oe),q.match_length<=5&&(q.strategy===1||q.match_length===k&&4096<q.strstart-q.match_start)&&(q.match_length=k-1)),q.prev_length>=k&&q.match_length<=q.prev_length){for(Pe=q.strstart+q.lookahead-k,le=h._tr_tally(q,q.strstart-1-q.prev_match,q.prev_length-k),q.lookahead-=q.prev_length-1,q.prev_length-=2;++q.strstart<=Pe&&(q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+k-1])&q.hash_mask,oe=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart),--q.prev_length!=0;);if(q.match_available=0,q.match_length=k-1,q.strstart++,le&&(O(q,!1),q.strm.avail_out===0))return 1}else if(q.match_available){if((le=h._tr_tally(q,0,q.window[q.strstart-1]))&&O(q,!1),q.strstart++,q.lookahead--,q.strm.avail_out===0)return 1}else q.match_available=1,q.strstart++,q.lookahead--}return q.match_available&&(le=h._tr_tally(q,0,q.window[q.strstart-1]),q.match_available=0),q.insert=q.strstart<k-1?q.strstart:k-1,ge===4?(O(q,!0),q.strm.avail_out===0?3:4):q.last_lit&&(O(q,!1),q.strm.avail_out===0)?1:2}function be(q,ge,oe,le,Pe){this.good_length=q,this.max_lazy=ge,this.nice_length=oe,this.max_chain=le,this.func=Pe}function je(q){var ge;return q&&q.state?(q.total_in=q.total_out=0,q.data_type=A,(ge=q.state).pending=0,ge.pending_out=0,ge.wrap<0&&(ge.wrap=-ge.wrap),ge.status=ge.wrap?C:B,q.adler=ge.wrap===2?0:1,ge.last_flush=V,h._tr_init(ge),I):R(q,g)}function ve(q){var ge,oe=je(q);return oe===I&&((ge=q.state).window_size=2*ge.w_size,c(ge.head),ge.max_lazy_match=a[ge.level].max_lazy,ge.good_match=a[ge.level].good_length,ge.nice_match=a[ge.level].nice_length,ge.max_chain_length=a[ge.level].max_chain,ge.strstart=0,ge.block_start=0,ge.lookahead=0,ge.insert=0,ge.match_length=ge.prev_length=k-1,ge.match_available=0,ge.ins_h=0),oe}function Be(q,ge,oe,le,Pe,Ye){if(!q)return g;var ze=1;if(ge===-1&&(ge=6),le<0?(ze=0,le=-le):15<le&&(ze=2,le-=16),Pe<1||9<Pe||oe!==M||le<8||15<le||ge<0||9<ge||Ye<0||4<Ye)return R(q,g);le===8&&(le=9);var se=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=M,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 v.Buf16(2*_),this.dyn_dtree=new v.Buf16(2*(2*F+1)),this.bl_tree=new v.Buf16(2*(2*T+1)),c(this.dyn_ltree),c(this.dyn_dtree),c(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new v.Buf16(Y+1),this.heap=new v.Buf16(2*N+1),c(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new v.Buf16(2*N+1),c(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(q.state=se).strm=q,se.wrap=ze,se.gzhead=null,se.w_bits=le,se.w_size=1<<se.w_bits,se.w_mask=se.w_size-1,se.hash_bits=Pe+7,se.hash_size=1<<se.hash_bits,se.hash_mask=se.hash_size-1,se.hash_shift=~~((se.hash_bits+k-1)/k),se.window=new v.Buf8(2*se.w_size),se.head=new v.Buf16(se.hash_size),se.prev=new v.Buf16(se.w_size),se.lit_bufsize=1<<Pe+6,se.pending_buf_size=4*se.lit_bufsize,se.pending_buf=new v.Buf8(se.pending_buf_size),se.d_buf=+se.lit_bufsize,se.l_buf=3*se.lit_bufsize,se.level=ge,se.strategy=Ye,se.method=oe,ve(q)}a=[new be(0,0,0,0,function(q,ge){var oe=65535;for(oe>q.pending_buf_size-5&&(oe=q.pending_buf_size-5);;){if(q.lookahead<=1){if(te(q),q.lookahead===0&&ge===V)return 1;if(q.lookahead===0)break}q.strstart+=q.lookahead,q.lookahead=0;var le=q.block_start+oe;if((q.strstart===0||q.strstart>=le)&&(q.lookahead=q.strstart-le,q.strstart=le,O(q,!1),q.strm.avail_out===0)||q.strstart-q.block_start>=q.w_size-G&&(O(q,!1),q.strm.avail_out===0))return 1}return q.insert=0,ge===4?(O(q,!0),q.strm.avail_out===0?3:4):(q.strstart>q.block_start&&(O(q,!1),q.strm.avail_out),1)}),new be(4,4,8,4,ne),new be(4,5,16,8,ne),new be(4,6,32,32,ne),new be(4,4,16,16,ue),new be(8,16,32,32,ue),new be(8,16,128,128,ue),new be(8,32,128,256,ue),new be(32,128,258,1024,ue),new be(32,258,258,4096,ue)],o.deflateInit=function(q,ge){return Be(q,ge,M,15,8,0)},o.deflateInit2=Be,o.deflateReset=ve,o.deflateResetKeep=je,o.deflateSetHeader=function(q,ge){return q&&q.state&&q.state.wrap===2?(q.state.gzhead=ge,I):g},o.deflate=function(q,ge){var oe,le,Pe,Ye;if(!q||!q.state||5<ge||ge<0)return q?R(q,g):g;if(le=q.state,!q.output||!q.input&&q.avail_in!==0||le.status===666&&ge!==4)return R(q,q.avail_out===0?-5:g);if(le.strm=q,oe=le.last_flush,le.last_flush=ge,le.status===C)if(le.wrap===2)q.adler=0,W(le,31),W(le,139),W(le,8),le.gzhead?(W(le,(le.gzhead.text?1:0)+(le.gzhead.hcrc?2:0)+(le.gzhead.extra?4:0)+(le.gzhead.name?8:0)+(le.gzhead.comment?16:0)),W(le,255&le.gzhead.time),W(le,le.gzhead.time>>8&255),W(le,le.gzhead.time>>16&255),W(le,le.gzhead.time>>24&255),W(le,le.level===9?2:2<=le.strategy||le.level<2?4:0),W(le,255&le.gzhead.os),le.gzhead.extra&&le.gzhead.extra.length&&(W(le,255&le.gzhead.extra.length),W(le,le.gzhead.extra.length>>8&255)),le.gzhead.hcrc&&(q.adler=D(q.adler,le.pending_buf,le.pending,0)),le.gzindex=0,le.status=69):(W(le,0),W(le,0),W(le,0),W(le,0),W(le,0),W(le,le.level===9?2:2<=le.strategy||le.level<2?4:0),W(le,3),le.status=B);else{var ze=M+(le.w_bits-8<<4)<<8;ze|=(2<=le.strategy||le.level<2?0:le.level<6?1:le.level===6?2:3)<<6,le.strstart!==0&&(ze|=32),ze+=31-ze%31,le.status=B,X(le,ze),le.strstart!==0&&(X(le,q.adler>>>16),X(le,65535&q.adler)),q.adler=1}if(le.status===69)if(le.gzhead.extra){for(Pe=le.pending;le.gzindex<(65535&le.gzhead.extra.length)&&(le.pending!==le.pending_buf_size||(le.gzhead.hcrc&&le.pending>Pe&&(q.adler=D(q.adler,le.pending_buf,le.pending-Pe,Pe)),f(q),Pe=le.pending,le.pending!==le.pending_buf_size));)W(le,255&le.gzhead.extra[le.gzindex]),le.gzindex++;le.gzhead.hcrc&&le.pending>Pe&&(q.adler=D(q.adler,le.pending_buf,le.pending-Pe,Pe)),le.gzindex===le.gzhead.extra.length&&(le.gzindex=0,le.status=73)}else le.status=73;if(le.status===73)if(le.gzhead.name){Pe=le.pending;do{if(le.pending===le.pending_buf_size&&(le.gzhead.hcrc&&le.pending>Pe&&(q.adler=D(q.adler,le.pending_buf,le.pending-Pe,Pe)),f(q),Pe=le.pending,le.pending===le.pending_buf_size)){Ye=1;break}Ye=le.gzindex<le.gzhead.name.length?255&le.gzhead.name.charCodeAt(le.gzindex++):0,W(le,Ye)}while(Ye!==0);le.gzhead.hcrc&&le.pending>Pe&&(q.adler=D(q.adler,le.pending_buf,le.pending-Pe,Pe)),Ye===0&&(le.gzindex=0,le.status=91)}else le.status=91;if(le.status===91)if(le.gzhead.comment){Pe=le.pending;do{if(le.pending===le.pending_buf_size&&(le.gzhead.hcrc&&le.pending>Pe&&(q.adler=D(q.adler,le.pending_buf,le.pending-Pe,Pe)),f(q),Pe=le.pending,le.pending===le.pending_buf_size)){Ye=1;break}Ye=le.gzindex<le.gzhead.comment.length?255&le.gzhead.comment.charCodeAt(le.gzindex++):0,W(le,Ye)}while(Ye!==0);le.gzhead.hcrc&&le.pending>Pe&&(q.adler=D(q.adler,le.pending_buf,le.pending-Pe,Pe)),Ye===0&&(le.status=103)}else le.status=103;if(le.status===103&&(le.gzhead.hcrc?(le.pending+2>le.pending_buf_size&&f(q),le.pending+2<=le.pending_buf_size&&(W(le,255&q.adler),W(le,q.adler>>8&255),q.adler=0,le.status=B)):le.status=B),le.pending!==0){if(f(q),q.avail_out===0)return le.last_flush=-1,I}else if(q.avail_in===0&&u(ge)<=u(oe)&&ge!==4)return R(q,-5);if(le.status===666&&q.avail_in!==0)return R(q,-5);if(q.avail_in!==0||le.lookahead!==0||ge!==V&&le.status!==666){var se=le.strategy===2?function(xe,De){for(var tt;;){if(xe.lookahead===0&&(te(xe),xe.lookahead===0)){if(De===V)return 1;break}if(xe.match_length=0,tt=h._tr_tally(xe,0,xe.window[xe.strstart]),xe.lookahead--,xe.strstart++,tt&&(O(xe,!1),xe.strm.avail_out===0))return 1}return xe.insert=0,De===4?(O(xe,!0),xe.strm.avail_out===0?3:4):xe.last_lit&&(O(xe,!1),xe.strm.avail_out===0)?1:2}(le,ge):le.strategy===3?function(xe,De){for(var tt,st,mt,Rt,Ot=xe.window;;){if(xe.lookahead<=S){if(te(xe),xe.lookahead<=S&&De===V)return 1;if(xe.lookahead===0)break}if(xe.match_length=0,xe.lookahead>=k&&0<xe.strstart&&(st=Ot[mt=xe.strstart-1])===Ot[++mt]&&st===Ot[++mt]&&st===Ot[++mt]){Rt=xe.strstart+S;do;while(st===Ot[++mt]&&st===Ot[++mt]&&st===Ot[++mt]&&st===Ot[++mt]&&st===Ot[++mt]&&st===Ot[++mt]&&st===Ot[++mt]&&st===Ot[++mt]&&mt<Rt);xe.match_length=S-(Rt-mt),xe.match_length>xe.lookahead&&(xe.match_length=xe.lookahead)}if(xe.match_length>=k?(tt=h._tr_tally(xe,1,xe.match_length-k),xe.lookahead-=xe.match_length,xe.strstart+=xe.match_length,xe.match_length=0):(tt=h._tr_tally(xe,0,xe.window[xe.strstart]),xe.lookahead--,xe.strstart++),tt&&(O(xe,!1),xe.strm.avail_out===0))return 1}return xe.insert=0,De===4?(O(xe,!0),xe.strm.avail_out===0?3:4):xe.last_lit&&(O(xe,!1),xe.strm.avail_out===0)?1:2}(le,ge):a[le.level].func(le,ge);if(se!==3&&se!==4||(le.status=666),se===1||se===3)return q.avail_out===0&&(le.last_flush=-1),I;if(se===2&&(ge===1?h._tr_align(le):ge!==5&&(h._tr_stored_block(le,0,0,!1),ge===3&&(c(le.head),le.lookahead===0&&(le.strstart=0,le.block_start=0,le.insert=0))),f(q),q.avail_out===0))return le.last_flush=-1,I}return ge!==4?I:le.wrap<=0?1:(le.wrap===2?(W(le,255&q.adler),W(le,q.adler>>8&255),W(le,q.adler>>16&255),W(le,q.adler>>24&255),W(le,255&q.total_in),W(le,q.total_in>>8&255),W(le,q.total_in>>16&255),W(le,q.total_in>>24&255)):(X(le,q.adler>>>16),X(le,65535&q.adler)),f(q),0<le.wrap&&(le.wrap=-le.wrap),le.pending!==0?I:1)},o.deflateEnd=function(q){var ge;return q&&q.state?(ge=q.state.status)!==C&&ge!==69&&ge!==73&&ge!==91&&ge!==103&&ge!==B&&ge!==666?R(q,g):(q.state=null,ge===B?R(q,-3):I):g},o.deflateSetDictionary=function(q,ge){var oe,le,Pe,Ye,ze,se,xe,De,tt=ge.length;if(!q||!q.state||(Ye=(oe=q.state).wrap)===2||Ye===1&&oe.status!==C||oe.lookahead)return g;for(Ye===1&&(q.adler=b(q.adler,ge,tt,0)),oe.wrap=0,tt>=oe.w_size&&(Ye===0&&(c(oe.head),oe.strstart=0,oe.block_start=0,oe.insert=0),De=new v.Buf8(oe.w_size),v.arraySet(De,ge,tt-oe.w_size,oe.w_size,0),ge=De,tt=oe.w_size),ze=q.avail_in,se=q.next_in,xe=q.input,q.avail_in=tt,q.next_in=0,q.input=ge,te(oe);oe.lookahead>=k;){for(le=oe.strstart,Pe=oe.lookahead-(k-1);oe.ins_h=(oe.ins_h<<oe.hash_shift^oe.window[le+k-1])&oe.hash_mask,oe.prev[le&oe.w_mask]=oe.head[oe.ins_h],oe.head[oe.ins_h]=le,le++,--Pe;);oe.strstart=le,oe.lookahead=k-1,te(oe)}return oe.strstart+=oe.lookahead,oe.block_start=oe.strstart,oe.insert=oe.lookahead,oe.lookahead=0,oe.match_length=oe.prev_length=k-1,oe.match_available=0,q.next_in=se,q.input=xe,q.avail_in=ze,oe.wrap=Ye,I},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./messages":14,"./trees":15}],10:[function(w,r,o){r.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(w,r,o){r.exports=function(a,v){var h,b,D,U,V,I,g,A,M,N,F,T,_,Y,k,S,G,C,B,R,u,c,f,O,W;h=a.state,b=a.next_in,O=a.input,D=b+(a.avail_in-5),U=a.next_out,W=a.output,V=U-(v-a.avail_out),I=U+(a.avail_out-257),g=h.dmax,A=h.wsize,M=h.whave,N=h.wnext,F=h.window,T=h.hold,_=h.bits,Y=h.lencode,k=h.distcode,S=(1<<h.lenbits)-1,G=(1<<h.distbits)-1;e:do{_<15&&(T+=O[b++]<<_,_+=8,T+=O[b++]<<_,_+=8),C=Y[T&S];t:for(;;){if(T>>>=B=C>>>24,_-=B,(B=C>>>16&255)==0)W[U++]=65535&C;else{if(!(16&B)){if(!(64&B)){C=Y[(65535&C)+(T&(1<<B)-1)];continue t}if(32&B){h.mode=12;break e}a.msg="invalid literal/length code",h.mode=30;break e}R=65535&C,(B&=15)&&(_<B&&(T+=O[b++]<<_,_+=8),R+=T&(1<<B)-1,T>>>=B,_-=B),_<15&&(T+=O[b++]<<_,_+=8,T+=O[b++]<<_,_+=8),C=k[T&G];n:for(;;){if(T>>>=B=C>>>24,_-=B,!(16&(B=C>>>16&255))){if(!(64&B)){C=k[(65535&C)+(T&(1<<B)-1)];continue n}a.msg="invalid distance code",h.mode=30;break e}if(u=65535&C,_<(B&=15)&&(T+=O[b++]<<_,(_+=8)<B&&(T+=O[b++]<<_,_+=8)),g<(u+=T&(1<<B)-1)){a.msg="invalid distance too far back",h.mode=30;break e}if(T>>>=B,_-=B,(B=U-V)<u){if(M<(B=u-B)&&h.sane){a.msg="invalid distance too far back",h.mode=30;break e}if(f=F,(c=0)===N){if(c+=A-B,B<R){for(R-=B;W[U++]=F[c++],--B;);c=U-u,f=W}}else if(N<B){if(c+=A+N-B,(B-=N)<R){for(R-=B;W[U++]=F[c++],--B;);if(c=0,N<R){for(R-=B=N;W[U++]=F[c++],--B;);c=U-u,f=W}}}else if(c+=N-B,B<R){for(R-=B;W[U++]=F[c++],--B;);c=U-u,f=W}for(;2<R;)W[U++]=f[c++],W[U++]=f[c++],W[U++]=f[c++],R-=3;R&&(W[U++]=f[c++],1<R&&(W[U++]=f[c++]))}else{for(c=U-u;W[U++]=W[c++],W[U++]=W[c++],W[U++]=W[c++],2<(R-=3););R&&(W[U++]=W[c++],1<R&&(W[U++]=W[c++]))}break}}break}}while(b<D&&U<I);b-=R=_>>3,T&=(1<<(_-=R<<3))-1,a.next_in=b,a.next_out=U,a.avail_in=b<D?D-b+5:5-(b-D),a.avail_out=U<I?I-U+257:257-(U-I),h.hold=T,h.bits=_}},{}],12:[function(w,r,o){var a=w("../utils/common"),v=w("./adler32"),h=w("./crc32"),b=w("./inffast"),D=w("./inftrees"),U=0,V=-2,I=1,g=852,A=592;function M(R){return(R>>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function N(){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 a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function F(R){var u;return R&&R.state?(u=R.state,R.total_in=R.total_out=u.total=0,R.msg="",u.wrap&&(R.adler=1&u.wrap),u.mode=I,u.last=0,u.havedict=0,u.dmax=32768,u.head=null,u.hold=0,u.bits=0,u.lencode=u.lendyn=new a.Buf32(g),u.distcode=u.distdyn=new a.Buf32(A),u.sane=1,u.back=-1,U):V}function T(R){var u;return R&&R.state?((u=R.state).wsize=0,u.whave=0,u.wnext=0,F(R)):V}function _(R,u){var c,f;return R&&R.state?(f=R.state,u<0?(c=0,u=-u):(c=1+(u>>4),u<48&&(u&=15)),u&&(u<8||15<u)?V:(f.window!==null&&f.wbits!==u&&(f.window=null),f.wrap=c,f.wbits=u,T(R))):V}function Y(R,u){var c,f;return R?(f=new N,(R.state=f).window=null,(c=_(R,u))!==U&&(R.state=null),c):V}var k,S,G=!0;function C(R){if(G){var u;for(k=new a.Buf32(512),S=new a.Buf32(32),u=0;u<144;)R.lens[u++]=8;for(;u<256;)R.lens[u++]=9;for(;u<280;)R.lens[u++]=7;for(;u<288;)R.lens[u++]=8;for(D(1,R.lens,0,288,k,0,R.work,{bits:9}),u=0;u<32;)R.lens[u++]=5;D(2,R.lens,0,32,S,0,R.work,{bits:5}),G=!1}R.lencode=k,R.lenbits=9,R.distcode=S,R.distbits=5}function B(R,u,c,f){var O,W=R.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new a.Buf8(W.wsize)),f>=W.wsize?(a.arraySet(W.window,u,c-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(f<(O=W.wsize-W.wnext)&&(O=f),a.arraySet(W.window,u,c-f,O,W.wnext),(f-=O)?(a.arraySet(W.window,u,c-f,f,0),W.wnext=f,W.whave=W.wsize):(W.wnext+=O,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=O))),0}o.inflateReset=T,o.inflateReset2=_,o.inflateResetKeep=F,o.inflateInit=function(R){return Y(R,15)},o.inflateInit2=Y,o.inflate=function(R,u){var c,f,O,W,X,J,te,ne,ue,be,je,ve,Be,q,ge,oe,le,Pe,Ye,ze,se,xe,De,tt,st=0,mt=new a.Buf8(4),Rt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!R||!R.state||!R.output||!R.input&&R.avail_in!==0)return V;(c=R.state).mode===12&&(c.mode=13),X=R.next_out,O=R.output,te=R.avail_out,W=R.next_in,f=R.input,J=R.avail_in,ne=c.hold,ue=c.bits,be=J,je=te,xe=U;e:for(;;)switch(c.mode){case I:if(c.wrap===0){c.mode=13;break}for(;ue<16;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}if(2&c.wrap&&ne===35615){mt[c.check=0]=255&ne,mt[1]=ne>>>8&255,c.check=h(c.check,mt,2,0),ue=ne=0,c.mode=2;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&ne)<<8)+(ne>>8))%31){R.msg="incorrect header check",c.mode=30;break}if((15&ne)!=8){R.msg="unknown compression method",c.mode=30;break}if(ue-=4,se=8+(15&(ne>>>=4)),c.wbits===0)c.wbits=se;else if(se>c.wbits){R.msg="invalid window size",c.mode=30;break}c.dmax=1<<se,R.adler=c.check=1,c.mode=512&ne?10:12,ue=ne=0;break;case 2:for(;ue<16;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}if(c.flags=ne,(255&c.flags)!=8){R.msg="unknown compression method",c.mode=30;break}if(57344&c.flags){R.msg="unknown header flags set",c.mode=30;break}c.head&&(c.head.text=ne>>8&1),512&c.flags&&(mt[0]=255&ne,mt[1]=ne>>>8&255,c.check=h(c.check,mt,2,0)),ue=ne=0,c.mode=3;case 3:for(;ue<32;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}c.head&&(c.head.time=ne),512&c.flags&&(mt[0]=255&ne,mt[1]=ne>>>8&255,mt[2]=ne>>>16&255,mt[3]=ne>>>24&255,c.check=h(c.check,mt,4,0)),ue=ne=0,c.mode=4;case 4:for(;ue<16;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}c.head&&(c.head.xflags=255&ne,c.head.os=ne>>8),512&c.flags&&(mt[0]=255&ne,mt[1]=ne>>>8&255,c.check=h(c.check,mt,2,0)),ue=ne=0,c.mode=5;case 5:if(1024&c.flags){for(;ue<16;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}c.length=ne,c.head&&(c.head.extra_len=ne),512&c.flags&&(mt[0]=255&ne,mt[1]=ne>>>8&255,c.check=h(c.check,mt,2,0)),ue=ne=0}else c.head&&(c.head.extra=null);c.mode=6;case 6:if(1024&c.flags&&(J<(ve=c.length)&&(ve=J),ve&&(c.head&&(se=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),a.arraySet(c.head.extra,f,W,ve,se)),512&c.flags&&(c.check=h(c.check,f,ve,W)),J-=ve,W+=ve,c.length-=ve),c.length))break e;c.length=0,c.mode=7;case 7:if(2048&c.flags){if(J===0)break e;for(ve=0;se=f[W+ve++],c.head&&se&&c.length<65536&&(c.head.name+=String.fromCharCode(se)),se&&ve<J;);if(512&c.flags&&(c.check=h(c.check,f,ve,W)),J-=ve,W+=ve,se)break e}else c.head&&(c.head.name=null);c.length=0,c.mode=8;case 8:if(4096&c.flags){if(J===0)break e;for(ve=0;se=f[W+ve++],c.head&&se&&c.length<65536&&(c.head.comment+=String.fromCharCode(se)),se&&ve<J;);if(512&c.flags&&(c.check=h(c.check,f,ve,W)),J-=ve,W+=ve,se)break e}else c.head&&(c.head.comment=null);c.mode=9;case 9:if(512&c.flags){for(;ue<16;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}if(ne!==(65535&c.check)){R.msg="header crc mismatch",c.mode=30;break}ue=ne=0}c.head&&(c.head.hcrc=c.flags>>9&1,c.head.done=!0),R.adler=c.check=0,c.mode=12;break;case 10:for(;ue<32;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}R.adler=c.check=M(ne),ue=ne=0,c.mode=11;case 11:if(c.havedict===0)return R.next_out=X,R.avail_out=te,R.next_in=W,R.avail_in=J,c.hold=ne,c.bits=ue,2;R.adler=c.check=1,c.mode=12;case 12:if(u===5||u===6)break e;case 13:if(c.last){ne>>>=7&ue,ue-=7&ue,c.mode=27;break}for(;ue<3;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}switch(c.last=1&ne,--ue,3&(ne>>>=1)){case 0:c.mode=14;break;case 1:if(C(c),c.mode=20,u!==6)break;ne>>>=2,ue-=2;break e;case 2:c.mode=17;break;case 3:R.msg="invalid block type",c.mode=30}ne>>>=2,ue-=2;break;case 14:for(ne>>>=7&ue,ue-=7&ue;ue<32;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}if((65535&ne)!=(ne>>>16^65535)){R.msg="invalid stored block lengths",c.mode=30;break}if(c.length=65535&ne,ue=ne=0,c.mode=15,u===6)break e;case 15:c.mode=16;case 16:if(ve=c.length){if(J<ve&&(ve=J),te<ve&&(ve=te),ve===0)break e;a.arraySet(O,f,W,ve,X),J-=ve,W+=ve,te-=ve,X+=ve,c.length-=ve;break}c.mode=12;break;case 17:for(;ue<14;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}if(c.nlen=257+(31&ne),ne>>>=5,ue-=5,c.ndist=1+(31&ne),ne>>>=5,ue-=5,c.ncode=4+(15&ne),ne>>>=4,ue-=4,286<c.nlen||30<c.ndist){R.msg="too many length or distance symbols",c.mode=30;break}c.have=0,c.mode=18;case 18:for(;c.have<c.ncode;){for(;ue<3;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}c.lens[Rt[c.have++]]=7&ne,ne>>>=3,ue-=3}for(;c.have<19;)c.lens[Rt[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,De={bits:c.lenbits},xe=D(0,c.lens,0,19,c.lencode,0,c.work,De),c.lenbits=De.bits,xe){R.msg="invalid code lengths set",c.mode=30;break}c.have=0,c.mode=19;case 19:for(;c.have<c.nlen+c.ndist;){for(;oe=(st=c.lencode[ne&(1<<c.lenbits)-1])>>>16&255,le=65535&st,!((ge=st>>>24)<=ue);){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}if(le<16)ne>>>=ge,ue-=ge,c.lens[c.have++]=le;else{if(le===16){for(tt=ge+2;ue<tt;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}if(ne>>>=ge,ue-=ge,c.have===0){R.msg="invalid bit length repeat",c.mode=30;break}se=c.lens[c.have-1],ve=3+(3&ne),ne>>>=2,ue-=2}else if(le===17){for(tt=ge+3;ue<tt;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}ue-=ge,se=0,ve=3+(7&(ne>>>=ge)),ne>>>=3,ue-=3}else{for(tt=ge+7;ue<tt;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}ue-=ge,se=0,ve=11+(127&(ne>>>=ge)),ne>>>=7,ue-=7}if(c.have+ve>c.nlen+c.ndist){R.msg="invalid bit length repeat",c.mode=30;break}for(;ve--;)c.lens[c.have++]=se}}if(c.mode===30)break;if(c.lens[256]===0){R.msg="invalid code -- missing end-of-block",c.mode=30;break}if(c.lenbits=9,De={bits:c.lenbits},xe=D(1,c.lens,0,c.nlen,c.lencode,0,c.work,De),c.lenbits=De.bits,xe){R.msg="invalid literal/lengths set",c.mode=30;break}if(c.distbits=6,c.distcode=c.distdyn,De={bits:c.distbits},xe=D(2,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,De),c.distbits=De.bits,xe){R.msg="invalid distances set",c.mode=30;break}if(c.mode=20,u===6)break e;case 20:c.mode=21;case 21:if(6<=J&&258<=te){R.next_out=X,R.avail_out=te,R.next_in=W,R.avail_in=J,c.hold=ne,c.bits=ue,b(R,je),X=R.next_out,O=R.output,te=R.avail_out,W=R.next_in,f=R.input,J=R.avail_in,ne=c.hold,ue=c.bits,c.mode===12&&(c.back=-1);break}for(c.back=0;oe=(st=c.lencode[ne&(1<<c.lenbits)-1])>>>16&255,le=65535&st,!((ge=st>>>24)<=ue);){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}if(oe&&!(240&oe)){for(Pe=ge,Ye=oe,ze=le;oe=(st=c.lencode[ze+((ne&(1<<Pe+Ye)-1)>>Pe)])>>>16&255,le=65535&st,!(Pe+(ge=st>>>24)<=ue);){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}ne>>>=Pe,ue-=Pe,c.back+=Pe}if(ne>>>=ge,ue-=ge,c.back+=ge,c.length=le,oe===0){c.mode=26;break}if(32&oe){c.back=-1,c.mode=12;break}if(64&oe){R.msg="invalid literal/length code",c.mode=30;break}c.extra=15&oe,c.mode=22;case 22:if(c.extra){for(tt=c.extra;ue<tt;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}c.length+=ne&(1<<c.extra)-1,ne>>>=c.extra,ue-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=23;case 23:for(;oe=(st=c.distcode[ne&(1<<c.distbits)-1])>>>16&255,le=65535&st,!((ge=st>>>24)<=ue);){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}if(!(240&oe)){for(Pe=ge,Ye=oe,ze=le;oe=(st=c.distcode[ze+((ne&(1<<Pe+Ye)-1)>>Pe)])>>>16&255,le=65535&st,!(Pe+(ge=st>>>24)<=ue);){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}ne>>>=Pe,ue-=Pe,c.back+=Pe}if(ne>>>=ge,ue-=ge,c.back+=ge,64&oe){R.msg="invalid distance code",c.mode=30;break}c.offset=le,c.extra=15&oe,c.mode=24;case 24:if(c.extra){for(tt=c.extra;ue<tt;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}c.offset+=ne&(1<<c.extra)-1,ne>>>=c.extra,ue-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){R.msg="invalid distance too far back",c.mode=30;break}c.mode=25;case 25:if(te===0)break e;if(ve=je-te,c.offset>ve){if((ve=c.offset-ve)>c.whave&&c.sane){R.msg="invalid distance too far back",c.mode=30;break}Be=ve>c.wnext?(ve-=c.wnext,c.wsize-ve):c.wnext-ve,ve>c.length&&(ve=c.length),q=c.window}else q=O,Be=X-c.offset,ve=c.length;for(te<ve&&(ve=te),te-=ve,c.length-=ve;O[X++]=q[Be++],--ve;);c.length===0&&(c.mode=21);break;case 26:if(te===0)break e;O[X++]=c.length,te--,c.mode=21;break;case 27:if(c.wrap){for(;ue<32;){if(J===0)break e;J--,ne|=f[W++]<<ue,ue+=8}if(je-=te,R.total_out+=je,c.total+=je,je&&(R.adler=c.check=(c.flags?h:v)(c.check,O,je,X-je)),je=te,(c.flags?ne:M(ne))!==c.check){R.msg="incorrect data check",c.mode=30;break}ue=ne=0}c.mode=28;case 28:if(c.wrap&&c.flags){for(;ue<32;){if(J===0)break e;J--,ne+=f[W++]<<ue,ue+=8}if(ne!==(4294967295&c.total)){R.msg="incorrect length check",c.mode=30;break}ue=ne=0}c.mode=29;case 29:xe=1;break e;case 30:xe=-3;break e;case 31:return-4;default:return V}return R.next_out=X,R.avail_out=te,R.next_in=W,R.avail_in=J,c.hold=ne,c.bits=ue,(c.wsize||je!==R.avail_out&&c.mode<30&&(c.mode<27||u!==4))&&B(R,R.output,R.next_out,je-R.avail_out)?(c.mode=31,-4):(be-=R.avail_in,je-=R.avail_out,R.total_in+=be,R.total_out+=je,c.total+=je,c.wrap&&je&&(R.adler=c.check=(c.flags?h:v)(c.check,O,je,R.next_out-je)),R.data_type=c.bits+(c.last?64:0)+(c.mode===12?128:0)+(c.mode===20||c.mode===15?256:0),(be==0&&je===0||u===4)&&xe===U&&(xe=-5),xe)},o.inflateEnd=function(R){if(!R||!R.state)return V;var u=R.state;return u.window&&(u.window=null),R.state=null,U},o.inflateGetHeader=function(R,u){var c;return R&&R.state&&2&(c=R.state).wrap?((c.head=u).done=!1,U):V},o.inflateSetDictionary=function(R,u){var c,f=u.length;return!R||!R.state||(c=R.state).wrap!==0&&c.mode!==11?V:c.mode===11&&v(1,u,f,0)!==c.check?-3:B(R,u,f,f)?(c.mode=31,-4):(c.havedict=1,U)},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./inffast":11,"./inftrees":13}],13:[function(w,r,o){var a=w("../utils/common"),v=[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],h=[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],b=[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],D=[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];r.exports=function(U,V,I,g,A,M,N,F){var T,_,Y,k,S,G,C,B,R,u=F.bits,c=0,f=0,O=0,W=0,X=0,J=0,te=0,ne=0,ue=0,be=0,je=null,ve=0,Be=new a.Buf16(16),q=new a.Buf16(16),ge=null,oe=0;for(c=0;c<=15;c++)Be[c]=0;for(f=0;f<g;f++)Be[V[I+f]]++;for(X=u,W=15;1<=W&&Be[W]===0;W--);if(W<X&&(X=W),W===0)return A[M++]=20971520,A[M++]=20971520,F.bits=1,0;for(O=1;O<W&&Be[O]===0;O++);for(X<O&&(X=O),c=ne=1;c<=15;c++)if(ne<<=1,(ne-=Be[c])<0)return-1;if(0<ne&&(U===0||W!==1))return-1;for(q[1]=0,c=1;c<15;c++)q[c+1]=q[c]+Be[c];for(f=0;f<g;f++)V[I+f]!==0&&(N[q[V[I+f]]++]=f);if(G=U===0?(je=ge=N,19):U===1?(je=v,ve-=257,ge=h,oe-=257,256):(je=b,ge=D,-1),c=O,S=M,te=f=be=0,Y=-1,k=(ue=1<<(J=X))-1,U===1&&852<ue||U===2&&592<ue)return 1;for(;;){for(C=c-te,R=N[f]<G?(B=0,N[f]):N[f]>G?(B=ge[oe+N[f]],je[ve+N[f]]):(B=96,0),T=1<<c-te,O=_=1<<J;A[S+(be>>te)+(_-=T)]=C<<24|B<<16|R|0,_!==0;);for(T=1<<c-1;be&T;)T>>=1;if(T!==0?(be&=T-1,be+=T):be=0,f++,--Be[c]==0){if(c===W)break;c=V[I+N[f]]}if(X<c&&(be&k)!==Y){for(te===0&&(te=X),S+=O,ne=1<<(J=c-te);J+te<W&&!((ne-=Be[J+te])<=0);)J++,ne<<=1;if(ue+=1<<J,U===1&&852<ue||U===2&&592<ue)return 1;A[Y=be&k]=X<<24|J<<16|S-M|0}}return be!==0&&(A[S+be]=c-te<<24|64<<16|0),F.bits=X,0}},{"../utils/common":4}],14:[function(w,r,o){r.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(w,r,o){var a=w("../utils/common");function v(oe){for(var le=oe.length;0<=--le;)oe[le]=0}var h=256,b=286,D=30,U=15,V=16,I=[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],g=[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],A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],N=new Array(576);v(N);var F=new Array(60);v(F);var T=new Array(512);v(T);var _=new Array(256);v(_);var Y=new Array(29);v(Y);var k,S,G,C=new Array(D);function B(oe,le,Pe,Ye,ze){this.static_tree=oe,this.extra_bits=le,this.extra_base=Pe,this.elems=Ye,this.max_length=ze,this.has_stree=oe&&oe.length}function R(oe,le){this.dyn_tree=oe,this.max_code=0,this.stat_desc=le}function u(oe){return oe<256?T[oe]:T[256+(oe>>>7)]}function c(oe,le){oe.pending_buf[oe.pending++]=255&le,oe.pending_buf[oe.pending++]=le>>>8&255}function f(oe,le,Pe){oe.bi_valid>V-Pe?(oe.bi_buf|=le<<oe.bi_valid&65535,c(oe,oe.bi_buf),oe.bi_buf=le>>V-oe.bi_valid,oe.bi_valid+=Pe-V):(oe.bi_buf|=le<<oe.bi_valid&65535,oe.bi_valid+=Pe)}function O(oe,le,Pe){f(oe,Pe[2*le],Pe[2*le+1])}function W(oe,le){for(var Pe=0;Pe|=1&oe,oe>>>=1,Pe<<=1,0<--le;);return Pe>>>1}function X(oe,le,Pe){var Ye,ze,se=new Array(U+1),xe=0;for(Ye=1;Ye<=U;Ye++)se[Ye]=xe=xe+Pe[Ye-1]<<1;for(ze=0;ze<=le;ze++){var De=oe[2*ze+1];De!==0&&(oe[2*ze]=W(se[De]++,De))}}function J(oe){var le;for(le=0;le<b;le++)oe.dyn_ltree[2*le]=0;for(le=0;le<D;le++)oe.dyn_dtree[2*le]=0;for(le=0;le<19;le++)oe.bl_tree[2*le]=0;oe.dyn_ltree[512]=1,oe.opt_len=oe.static_len=0,oe.last_lit=oe.matches=0}function te(oe){8<oe.bi_valid?c(oe,oe.bi_buf):0<oe.bi_valid&&(oe.pending_buf[oe.pending++]=oe.bi_buf),oe.bi_buf=0,oe.bi_valid=0}function ne(oe,le,Pe,Ye){var ze=2*le,se=2*Pe;return oe[ze]<oe[se]||oe[ze]===oe[se]&&Ye[le]<=Ye[Pe]}function ue(oe,le,Pe){for(var Ye=oe.heap[Pe],ze=Pe<<1;ze<=oe.heap_len&&(ze<oe.heap_len&&ne(le,oe.heap[ze+1],oe.heap[ze],oe.depth)&&ze++,!ne(le,Ye,oe.heap[ze],oe.depth));)oe.heap[Pe]=oe.heap[ze],Pe=ze,ze<<=1;oe.heap[Pe]=Ye}function be(oe,le,Pe){var Ye,ze,se,xe,De=0;if(oe.last_lit!==0)for(;Ye=oe.pending_buf[oe.d_buf+2*De]<<8|oe.pending_buf[oe.d_buf+2*De+1],ze=oe.pending_buf[oe.l_buf+De],De++,Ye===0?O(oe,ze,le):(O(oe,(se=_[ze])+h+1,le),(xe=I[se])!==0&&f(oe,ze-=Y[se],xe),O(oe,se=u(--Ye),Pe),(xe=g[se])!==0&&f(oe,Ye-=C[se],xe)),De<oe.last_lit;);O(oe,256,le)}function je(oe,le){var Pe,Ye,ze,se=le.dyn_tree,xe=le.stat_desc.static_tree,De=le.stat_desc.has_stree,tt=le.stat_desc.elems,st=-1;for(oe.heap_len=0,oe.heap_max=573,Pe=0;Pe<tt;Pe++)se[2*Pe]!==0?(oe.heap[++oe.heap_len]=st=Pe,oe.depth[Pe]=0):se[2*Pe+1]=0;for(;oe.heap_len<2;)se[2*(ze=oe.heap[++oe.heap_len]=st<2?++st:0)]=1,oe.depth[ze]=0,oe.opt_len--,De&&(oe.static_len-=xe[2*ze+1]);for(le.max_code=st,Pe=oe.heap_len>>1;1<=Pe;Pe--)ue(oe,se,Pe);for(ze=tt;Pe=oe.heap[1],oe.heap[1]=oe.heap[oe.heap_len--],ue(oe,se,1),Ye=oe.heap[1],oe.heap[--oe.heap_max]=Pe,oe.heap[--oe.heap_max]=Ye,se[2*ze]=se[2*Pe]+se[2*Ye],oe.depth[ze]=(oe.depth[Pe]>=oe.depth[Ye]?oe.depth[Pe]:oe.depth[Ye])+1,se[2*Pe+1]=se[2*Ye+1]=ze,oe.heap[1]=ze++,ue(oe,se,1),2<=oe.heap_len;);oe.heap[--oe.heap_max]=oe.heap[1],function(mt,Rt){var Ot,He,Vt,jt,Ln,nn,er=Rt.dyn_tree,yt=Rt.max_code,Ue=Rt.stat_desc.static_tree,Zt=Rt.stat_desc.has_stree,On=Rt.stat_desc.extra_bits,Xn=Rt.stat_desc.extra_base,dt=Rt.stat_desc.max_length,lt=0;for(jt=0;jt<=U;jt++)mt.bl_count[jt]=0;for(er[2*mt.heap[mt.heap_max]+1]=0,Ot=mt.heap_max+1;Ot<573;Ot++)dt<(jt=er[2*er[2*(He=mt.heap[Ot])+1]+1]+1)&&(jt=dt,lt++),er[2*He+1]=jt,yt<He||(mt.bl_count[jt]++,Ln=0,Xn<=He&&(Ln=On[He-Xn]),nn=er[2*He],mt.opt_len+=nn*(jt+Ln),Zt&&(mt.static_len+=nn*(Ue[2*He+1]+Ln)));if(lt!==0){do{for(jt=dt-1;mt.bl_count[jt]===0;)jt--;mt.bl_count[jt]--,mt.bl_count[jt+1]+=2,mt.bl_count[dt]--,lt-=2}while(0<lt);for(jt=dt;jt!==0;jt--)for(He=mt.bl_count[jt];He!==0;)yt<(Vt=mt.heap[--Ot])||(er[2*Vt+1]!==jt&&(mt.opt_len+=(jt-er[2*Vt+1])*er[2*Vt],er[2*Vt+1]=jt),He--)}}(oe,le),X(se,st,oe.bl_count)}function ve(oe,le,Pe){var Ye,ze,se=-1,xe=le[1],De=0,tt=7,st=4;for(xe===0&&(tt=138,st=3),le[2*(Pe+1)+1]=65535,Ye=0;Ye<=Pe;Ye++)ze=xe,xe=le[2*(Ye+1)+1],++De<tt&&ze===xe||(De<st?oe.bl_tree[2*ze]+=De:ze!==0?(ze!==se&&oe.bl_tree[2*ze]++,oe.bl_tree[32]++):De<=10?oe.bl_tree[34]++:oe.bl_tree[36]++,se=ze,st=(De=0)===xe?(tt=138,3):ze===xe?(tt=6,3):(tt=7,4))}function Be(oe,le,Pe){var Ye,ze,se=-1,xe=le[1],De=0,tt=7,st=4;for(xe===0&&(tt=138,st=3),Ye=0;Ye<=Pe;Ye++)if(ze=xe,xe=le[2*(Ye+1)+1],!(++De<tt&&ze===xe)){if(De<st)for(;O(oe,ze,oe.bl_tree),--De!=0;);else ze!==0?(ze!==se&&(O(oe,ze,oe.bl_tree),De--),O(oe,16,oe.bl_tree),f(oe,De-3,2)):De<=10?(O(oe,17,oe.bl_tree),f(oe,De-3,3)):(O(oe,18,oe.bl_tree),f(oe,De-11,7));se=ze,st=(De=0)===xe?(tt=138,3):ze===xe?(tt=6,3):(tt=7,4)}}v(C);var q=!1;function ge(oe,le,Pe,Ye){var ze,se,xe;f(oe,0+(Ye?1:0),3),se=le,xe=Pe,te(ze=oe),c(ze,xe),c(ze,~xe),a.arraySet(ze.pending_buf,ze.window,se,xe,ze.pending),ze.pending+=xe}o._tr_init=function(oe){q||(function(){var le,Pe,Ye,ze,se,xe=new Array(U+1);for(ze=Ye=0;ze<28;ze++)for(Y[ze]=Ye,le=0;le<1<<I[ze];le++)_[Ye++]=ze;for(_[Ye-1]=ze,ze=se=0;ze<16;ze++)for(C[ze]=se,le=0;le<1<<g[ze];le++)T[se++]=ze;for(se>>=7;ze<D;ze++)for(C[ze]=se<<7,le=0;le<1<<g[ze]-7;le++)T[256+se++]=ze;for(Pe=0;Pe<=U;Pe++)xe[Pe]=0;for(le=0;le<=143;)N[2*le+1]=8,le++,xe[8]++;for(;le<=255;)N[2*le+1]=9,le++,xe[9]++;for(;le<=279;)N[2*le+1]=7,le++,xe[7]++;for(;le<=287;)N[2*le+1]=8,le++,xe[8]++;for(X(N,287,xe),le=0;le<D;le++)F[2*le+1]=5,F[2*le]=W(le,5);k=new B(N,I,257,b,U),S=new B(F,g,0,D,U),G=new B(new Array(0),A,0,19,7)}(),q=!0),oe.l_desc=new R(oe.dyn_ltree,k),oe.d_desc=new R(oe.dyn_dtree,S),oe.bl_desc=new R(oe.bl_tree,G),oe.bi_buf=0,oe.bi_valid=0,J(oe)},o._tr_stored_block=ge,o._tr_flush_block=function(oe,le,Pe,Ye){var ze,se,xe=0;0<oe.level?(oe.strm.data_type===2&&(oe.strm.data_type=function(De){var tt,st=4093624447;for(tt=0;tt<=31;tt++,st>>>=1)if(1&st&&De.dyn_ltree[2*tt]!==0)return 0;if(De.dyn_ltree[18]!==0||De.dyn_ltree[20]!==0||De.dyn_ltree[26]!==0)return 1;for(tt=32;tt<h;tt++)if(De.dyn_ltree[2*tt]!==0)return 1;return 0}(oe)),je(oe,oe.l_desc),je(oe,oe.d_desc),xe=function(De){var tt;for(ve(De,De.dyn_ltree,De.l_desc.max_code),ve(De,De.dyn_dtree,De.d_desc.max_code),je(De,De.bl_desc),tt=18;3<=tt&&De.bl_tree[2*M[tt]+1]===0;tt--);return De.opt_len+=3*(tt+1)+5+5+4,tt}(oe),ze=oe.opt_len+3+7>>>3,(se=oe.static_len+3+7>>>3)<=ze&&(ze=se)):ze=se=Pe+5,Pe+4<=ze&&le!==-1?ge(oe,le,Pe,Ye):oe.strategy===4||se===ze?(f(oe,2+(Ye?1:0),3),be(oe,N,F)):(f(oe,4+(Ye?1:0),3),function(De,tt,st,mt){var Rt;for(f(De,tt-257,5),f(De,st-1,5),f(De,mt-4,4),Rt=0;Rt<mt;Rt++)f(De,De.bl_tree[2*M[Rt]+1],3);Be(De,De.dyn_ltree,tt-1),Be(De,De.dyn_dtree,st-1)}(oe,oe.l_desc.max_code+1,oe.d_desc.max_code+1,xe+1),be(oe,oe.dyn_ltree,oe.dyn_dtree)),J(oe),Ye&&te(oe)},o._tr_tally=function(oe,le,Pe){return oe.pending_buf[oe.d_buf+2*oe.last_lit]=le>>>8&255,oe.pending_buf[oe.d_buf+2*oe.last_lit+1]=255&le,oe.pending_buf[oe.l_buf+oe.last_lit]=255&Pe,oe.last_lit++,le===0?oe.dyn_ltree[2*Pe]++:(oe.matches++,le--,oe.dyn_ltree[2*(_[Pe]+h+1)]++,oe.dyn_dtree[2*u(le)]++),oe.last_lit===oe.lit_bufsize-1},o._tr_align=function(oe){var le;f(oe,2,3),O(oe,256,N),(le=oe).bi_valid===16?(c(le,le.bi_buf),le.bi_buf=0,le.bi_valid=0):8<=le.bi_valid&&(le.pending_buf[le.pending++]=255&le.bi_buf,le.bi_buf>>=8,le.bi_valid-=8)}},{"../utils/common":4}],16:[function(w,r,o){r.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(w,r,o){var a=w("three");a.OrbitControls=function(v,h){var b,D,U,V,I;h===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),h===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=v,this.domElement=h,this.enabled=!0,this.target=new a.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:a.MOUSE.ROTATE,MIDDLE:a.MOUSE.DOLLY,RIGHT:a.MOUSE.PAN},this.touches={ONE:a.TOUCH.ROTATE,TWO:a.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return Y.phi},this.getAzimuthalAngle=function(){return Y.theta},this.saveState=function(){g.target0.copy(g.target),g.position0.copy(g.object.position),g.zoom0=g.object.zoom},this.resetStatusValue=function(){T=F.NONE},this.reset=function(){g.target.copy(g.target0),g.object.position.copy(g.position0),g.object.zoom=g.zoom0,g.object.updateProjectionMatrix(),g.dispatchEvent(A),g.update(),T=F.NONE},this.update=(b=new a.Vector3,D=new a.Quaternion().setFromUnitVectors(v.up,new a.Vector3(0,1,0)),U=D.clone().inverse(),V=new a.Vector3,I=new a.Quaternion,function(){var yt=g.object.position;return b.copy(yt).sub(g.target),b.applyQuaternion(D),Y.setFromVector3(b),g.autoRotate&&T===F.NONE&&ne(2*Math.PI/60/60*g.autoRotateSpeed),g.enableDamping?(Y.theta+=k.theta*g.dampingFactor,Y.phi+=k.phi*g.dampingFactor):(Y.theta+=k.theta,Y.phi+=k.phi),Y.theta=Math.max(g.minAzimuthAngle,Math.min(g.maxAzimuthAngle,Y.theta)),Y.phi=Math.max(g.minPolarAngle,Math.min(g.maxPolarAngle,Y.phi)),Y.makeSafe(),Y.radius*=S,Y.radius=Math.max(g.minDistance,Math.min(g.maxDistance,Y.radius)),g.enableDamping===!0?g.target.addScaledVector(G,g.dampingFactor):g.target.add(G),b.setFromSpherical(Y),b.applyQuaternion(U),yt.copy(g.target).add(b),g.object.lookAt(g.target),g.enableDamping===!0?(k.theta*=1-g.dampingFactor,k.phi*=1-g.dampingFactor,G.multiplyScalar(1-g.dampingFactor)):(k.set(0,0,0),G.set(0,0,0)),S=1,!(!(C||V.distanceToSquared(g.object.position)>_||8*(1-I.dot(g.object.quaternion))>_)||(g.dispatchEvent(A),V.copy(g.object.position),I.copy(g.object.quaternion),C=!1))}),this.dispose=function(){g.domElement.removeEventListener("contextmenu",er,!1),g.domElement.removeEventListener("mousedown",st,!1),g.domElement.removeEventListener("wheel",Ot,!1),g.domElement.removeEventListener("touchstart",jt,!1),g.domElement.removeEventListener("touchend",nn,!1),g.domElement.removeEventListener("touchmove",Ln,!1),document.removeEventListener("mousemove",mt,!1),document.removeEventListener("mouseup",Rt,!1),g.domElement.removeEventListener("keydown",He,!1)};var g=this,A={type:"change"},M={type:"start"},N={type:"end"},F={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},T=F.NONE,_=1e-6,Y=new a.Spherical,k=new a.Spherical,S=1,G=new a.Vector3,C=!1,B=new a.Vector2,R=new a.Vector2,u=new a.Vector2,c=new a.Vector2,f=new a.Vector2,O=new a.Vector2,W=new a.Vector2,X=new a.Vector2,J=new a.Vector2;function te(){return Math.pow(.95,g.zoomSpeed)}function ne(yt){k.theta-=yt}function ue(yt){k.phi-=yt}var be,je,ve,Be=(be=new a.Vector3,function(yt,Ue){be.setFromMatrixColumn(Ue,0),be.multiplyScalar(-yt),G.add(be)}),q=(je=new a.Vector3,function(yt,Ue){g.screenSpacePanning===!0?je.setFromMatrixColumn(Ue,1):(je.setFromMatrixColumn(Ue,0),je.crossVectors(g.object.up,je)),je.multiplyScalar(yt),G.add(je)}),ge=(ve=new a.Vector3,function(yt,Ue){var Zt=g.domElement;if(g.object.isPerspectiveCamera){var On=g.object.position;ve.copy(On).sub(g.target);var Xn=ve.length();Xn*=Math.tan(g.object.fov/2*Math.PI/180),Be(2*yt*Xn/Zt.clientHeight,g.object.matrix),q(2*Ue*Xn/Zt.clientHeight,g.object.matrix)}else g.object.isOrthographicCamera?(Be(yt*(g.object.right-g.object.left)/g.object.zoom/Zt.clientWidth,g.object.matrix),q(Ue*(g.object.top-g.object.bottom)/g.object.zoom/Zt.clientHeight,g.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),g.enablePan=!1)});function oe(yt){g.object.isPerspectiveCamera?S/=yt:g.object.isOrthographicCamera?(g.object.zoom=Math.max(g.minZoom,Math.min(g.maxZoom,g.object.zoom*yt)),g.object.updateProjectionMatrix(),C=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),g.enableZoom=!1)}function le(yt){B.set(yt.clientX,yt.clientY)}function Pe(yt){c.set(yt.clientX,yt.clientY)}function Ye(yt){if(yt.touches.length==1)B.set(yt.touches[0].pageX,yt.touches[0].pageY);else{var Ue=.5*(yt.touches[0].pageX+yt.touches[1].pageX),Zt=.5*(yt.touches[0].pageY+yt.touches[1].pageY);B.set(Ue,Zt)}}function ze(yt){if(yt.touches.length==1)c.set(yt.touches[0].pageX,yt.touches[0].pageY);else{var Ue=.5*(yt.touches[0].pageX+yt.touches[1].pageX),Zt=.5*(yt.touches[0].pageY+yt.touches[1].pageY);c.set(Ue,Zt)}}function se(yt){var Ue=yt.touches[0].pageX-yt.touches[1].pageX,Zt=yt.touches[0].pageY-yt.touches[1].pageY,On=Math.sqrt(Ue*Ue+Zt*Zt);W.set(0,On)}function xe(yt){if(yt.touches.length==1)R.set(yt.touches[0].pageX,yt.touches[0].pageY);else{var Ue=.5*(yt.touches[0].pageX+yt.touches[1].pageX),Zt=.5*(yt.touches[0].pageY+yt.touches[1].pageY);R.set(Ue,Zt)}u.subVectors(R,B).multiplyScalar(g.rotateSpeed);var On=g.domElement;ne(2*Math.PI*u.x/On.clientHeight),ue(2*Math.PI*u.y/On.clientHeight),B.copy(R)}function De(yt){if(yt.touches.length==1)f.set(yt.touches[0].pageX,yt.touches[0].pageY);else{var Ue=.5*(yt.touches[0].pageX+yt.touches[1].pageX),Zt=.5*(yt.touches[0].pageY+yt.touches[1].pageY);f.set(Ue,Zt)}O.subVectors(f,c).multiplyScalar(g.panSpeed),ge(O.x,O.y),c.copy(f)}function tt(yt){var Ue=yt.touches[0].pageX-yt.touches[1].pageX,Zt=yt.touches[0].pageY-yt.touches[1].pageY,On=Math.sqrt(Ue*Ue+Zt*Zt);X.set(0,On),J.set(0,Math.pow(X.y/W.y,g.zoomSpeed)),oe(J.y),W.copy(X)}function st(yt){if(g.enabled!==!1){switch(yt.preventDefault(),g.domElement.focus?g.domElement.focus():window.focus(),yt.button){case 0:switch(g.mouseButtons.LEFT){case a.MOUSE.ROTATE:if(yt.ctrlKey||yt.metaKey||yt.shiftKey){if(g.enablePan===!1)return;Pe(yt),T=F.PAN}else{if(g.enableRotate===!1)return;le(yt),T=F.ROTATE}break;case a.MOUSE.PAN:if(yt.ctrlKey||yt.metaKey||yt.shiftKey){if(g.enableRotate===!1)return;le(yt),T=F.ROTATE}else{if(g.enablePan===!1)return;Pe(yt),T=F.PAN}break;default:T=F.NONE}break;case 1:switch(g.mouseButtons.MIDDLE){case a.MOUSE.DOLLY:if(g.enableZoom===!1)return;Ue=yt,W.set(Ue.clientX,Ue.clientY),T=F.DOLLY;break;case a.MOUSE.PAN:if(g.enablePan===!1)return;Pe(yt),T=F.PAN;break;default:T=F.NONE}break;case 2:switch(g.mouseButtons.RIGHT){case a.MOUSE.ROTATE:if(g.enableRotate===!1)return;le(yt),T=F.ROTATE;break;case a.MOUSE.PAN:if(g.enablePan===!1)return;Pe(yt),T=F.PAN;break;default:T=F.NONE}}var Ue;T!==F.NONE&&(document.addEventListener("mousemove",mt,!1),document.addEventListener("mouseup",Rt,!1),g.dispatchEvent(M))}}function mt(yt){var Ue;if(g.enabled!==!1)switch(yt.preventDefault(),T){case F.ROTATE:if(g.enableRotate===!1)return;(function(Zt){R.set(Zt.clientX,Zt.clientY),u.subVectors(R,B).multiplyScalar(g.rotateSpeed);var On=g.domElement;ne(2*Math.PI*u.x/On.clientHeight),ue(2*Math.PI*u.y/On.clientHeight),B.copy(R),g.update()})(yt);break;case F.DOLLY:if(g.enableZoom===!1)return;(function(Zt){var On;X.set(Zt.clientX,Zt.clientY),J.subVectors(X,W),0<J.y?oe(te()):J.y<0&&(On=te(),g.object.isPerspectiveCamera?S*=On:g.object.isOrthographicCamera?(g.object.zoom=Math.max(g.minZoom,Math.min(g.maxZoom,g.object.zoom/On)),g.object.updateProjectionMatrix(),C=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),g.enableZoom=!1)),W.copy(X),g.update()})(yt);break;case F.PAN:if(g.enablePan===!1)return;Ue=yt,f.set(Ue.clientX,Ue.clientY),O.subVectors(f,c).multiplyScalar(g.panSpeed),ge(O.x,O.y),c.copy(f),g.update()}}function Rt(yt){g.enabled!==!1&&(document.removeEventListener("mousemove",mt,!1),document.removeEventListener("mouseup",Rt,!1),g.dispatchEvent(N),T=F.NONE)}function Ot(yt){g.enabled===!1||g.enableZoom===!1||T!==F.NONE&&T!==F.ROTATE||(yt.preventDefault(),yt.stopPropagation(),g.dispatchEvent(M),function(Ue){Ue.deltaY<0?function(Zt,On){if(g.object.isPerspectiveCamera)We*=Zt;else if(g.object.isOrthographicCamera){var Xn=g.domElement.clientWidth,dt=g.domElement.clientHeight,lt=(g.object.near+g.object.far)/(g.object.near-g.object.far),Xt=On.offsetX,xn=On.offsetY,$t=new a.Vector3(Xt/Xn*2-1,-xn/dt*2+1,lt);$t.applyMatrix4(g.object.projectionMatrixInverse);var Yn=new a.Vector3(-1,-1,lt),kr=new a.Vector3(1,1,lt);Yn.applyMatrix4(g.object.projectionMatrixInverse),kr.applyMatrix4(g.object.projectionMatrixInverse);var Br=Math.max(g.minZoom,Math.min(g.maxZoom,1/Zt)),$e=new a.Matrix4;$e.makeTranslation(-$t.x,-$t.y,0);var We=new a.Matrix4().scale(new a.Vector3(1/Br,1/Br,1/Br)),ut=new a.Matrix4;ut.makeTranslation($t.x,$t.y,0);var Ie=new a.Matrix4().multiply(ut).multiply(We).multiply($e);Yn.applyMatrix4(Ie),kr.applyMatrix4(Ie),g.object.left=Yn.x,g.object.right=kr.x,g.object.top=kr.y,g.object.bottom=Yn.y,g.object.zoom=1,g.object.updateProjectionMatrix(),C=!0}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),g.enableZoom=!1}(te(),Ue):0<Ue.deltaY&&function(Zt,On){if(g.object.isPerspectiveCamera)We/=Zt;else if(g.object.isOrthographicCamera){var Xn=g.domElement.clientWidth,dt=g.domElement.clientHeight,lt=(g.object.near+g.object.far)/(g.object.near-g.object.far),Xt=On.offsetX,xn=On.offsetY,$t=new a.Vector3(Xt/Xn*2-1,-xn/dt*2+1,lt);$t.applyMatrix4(g.object.projectionMatrixInverse);var Yn=new a.Vector3(-1,-1,lt),kr=new a.Vector3(1,1,lt);Yn.applyMatrix4(g.object.projectionMatrixInverse),kr.applyMatrix4(g.object.projectionMatrixInverse);var Br=Math.max(g.minZoom,Math.min(g.maxZoom,Zt)),$e=new a.Matrix4;$e.makeTranslation(-$t.x,-$t.y,0);var We=new a.Matrix4().scale(new a.Vector3(1/Br,1/Br,1/Br)),ut=new a.Matrix4;ut.makeTranslation($t.x,$t.y,0);var Ie=new a.Matrix4().multiply(ut).multiply(We).multiply($e);Yn.applyMatrix4(Ie),kr.applyMatrix4(Ie),g.object.left=Yn.x,g.object.right=kr.x,g.object.top=kr.y,g.object.bottom=Yn.y,g.object.zoom=1,g.object.updateProjectionMatrix(),C=!0}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),g.enableZoom=!1}(te(),Ue),g.update()}(yt),g.dispatchEvent(N))}function He(yt){g.enabled!==!1&&g.enableKeys!==!1&&g.enablePan!==!1&&function(Ue){var Zt=!1;switch(Ue.keyCode){case g.keys.UP:ge(0,g.keyPanSpeed),Zt=!0;break;case g.keys.BOTTOM:ge(0,-g.keyPanSpeed),Zt=!0;break;case g.keys.LEFT:ge(g.keyPanSpeed,0),Zt=!0;break;case g.keys.RIGHT:ge(-g.keyPanSpeed,0),Zt=!0}Zt&&(Ue.preventDefault(),g.update())}(yt)}function Vt(yt){switch(yt.touches.length){case 1:switch(g.touches.ONE){case a.TOUCH.ROTATE:if(g.enableRotate===!1)return;Ye(yt),T=F.TOUCH_ROTATE;break;case a.TOUCH.PAN:if(g.enablePan===!1)return;ze(yt),T=F.TOUCH_PAN;break;default:T=F.NONE}break;case 2:switch(g.touches.TWO){case a.TOUCH.DOLLY_PAN:if(g.enableZoom===!1&&g.enablePan===!1)return;Zt=yt,g.enableZoom&&se(Zt),g.enablePan&&ze(Zt),T=F.TOUCH_DOLLY_PAN;break;case a.TOUCH.DOLLY_ROTATE:if(g.enableZoom===!1&&g.enableRotate===!1)return;Ue=yt,g.enableZoom&&se(Ue),g.enableRotate&&Ye(Ue),T=F.TOUCH_DOLLY_ROTATE;break;default:T=F.NONE}break;default:T=F.NONE}var Ue,Zt}function jt(yt){g.enabled!==!1&&(yt.preventDefault(),Vt(yt),T!==F.NONE&&g.dispatchEvent(M))}function Ln(yt){var Ue,Zt;if(g.enabled!==!1)switch(yt.preventDefault(),yt.stopPropagation(),T){case F.TOUCH_ROTATE:if(g.enableRotate===!1)return;xe(yt),g.update();break;case F.TOUCH_PAN:if(g.enablePan===!1)return;De(yt),g.update();break;case F.TOUCH_DOLLY_PAN:if(g.enableZoom===!1&&g.enablePan===!1)return;Zt=yt,g.enableZoom&&tt(Zt),g.enablePan&&De(Zt),g.update();break;case F.TOUCH_DOLLY_ROTATE:if(g.enableZoom===!1&&g.enableRotate===!1)return;Ue=yt,g.enableZoom&&tt(Ue),g.enableRotate&&xe(Ue),g.update();break;default:Vt(yt)}}function nn(yt){g.enabled!==!1&&(g.dispatchEvent(N),T=F.NONE)}function er(yt){g.enabled!==!1&&yt.preventDefault()}g.domElement.addEventListener("contextmenu",er,!1),g.domElement.addEventListener("mousedown",st,!1),g.domElement.addEventListener("wheel",Ot,!1),g.domElement.addEventListener("touchstart",jt,!1),g.domElement.addEventListener("touchend",nn,!1),g.domElement.addEventListener("touchmove",Ln,!1),g.domElement.addEventListener("keydown",He,!1),g.domElement.tabIndex===-1&&(g.domElement.tabIndex=0),this.update()},a.OrbitControls.prototype=Object.create(a.EventDispatcher.prototype),a.OrbitControls.prototype.constructor=a.OrbitControls,a.MapControls=function(v,h){a.OrbitControls.call(this,v,h),this.mouseButtons.LEFT=a.MOUSE.PAN,this.mouseButtons.RIGHT=a.MOUSE.ROTATE,this.touches.ONE=a.TOUCH.PAN,this.touches.TWO=a.TOUCH.DOLLY_ROTATE},a.MapControls.prototype=Object.create(a.EventDispatcher.prototype),a.MapControls.prototype.constructor=a.MapControls,o!==void 0&&(r!==void 0&&r.exports&&(o=r.exports={OrbitControls:a.OrbitControls,MapControls:a.MapControls}),o.OrbitControls=a.OrbitControls,o.MapControls=a.MapControls)},{three:19}],18:[function(w,r,o){(function(){var a,v,h,b=w!==void 0,D=this.THREE||b&&w("three");if(!D)throw new Error("MeshLine requires three.js");function U(){this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this.geometry=new D.BufferGeometry,this.widthCallback=null,this.matrixWorld=new D.Matrix4}function V(g,A,M,N,F){var T;if(g=g.subarray||g.slice?g:g.buffer,M=M.subarray||M.slice?M:M.buffer,g=A?g.subarray?g.subarray(A,F&&A+F):g.slice(A,F&&A+F):g,M.set)M.set(g,N);else for(T=0;T<g.length;T++)M[T+N]=g[T];return M}function I(g){D.ShaderMaterial.call(this,{uniforms:Object.assign({},D.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new D.Color(16777215)},opacity:{value:1},resolution:{value:new D.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 D.Vector2(1,1)}}),vertexShader:D.ShaderChunk.meshline_vert,fragmentShader:D.ShaderChunk.meshline_frag}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(A){this.uniforms.lineWidth.value=A}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(A){this.uniforms.map.value=A}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(A){this.uniforms.useMap.value=A}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(A){this.uniforms.alphaMap.value=A}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(A){this.uniforms.useAlphaMap.value=A}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(A){this.uniforms.color.value=A}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(A){this.uniforms.opacity.value=A}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(A){this.uniforms.resolution.value.copy(A)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(A){this.uniforms.sizeAttenuation.value=A}},near:{enumerable:!0,get:function(){return this.uniforms.near.value},set:function(A){this.uniforms.near.value=A}},far:{enumerable:!0,get:function(){return this.uniforms.far.value},set:function(A){this.uniforms.far.value=A}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(A){this.uniforms.dashArray.value=A,this.useDash=A!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(A){this.uniforms.dashOffset.value=A}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(A){this.uniforms.dashRatio.value=A}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(A){this.uniforms.useDash.value=A}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(A){this.uniforms.visibility.value=A}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(A){this.uniforms.alphaTest.value=A}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(A){this.uniforms.repeat.value.copy(A)}}}),this.setValues(g)}U.prototype.setMatrixWorld=function(g){this.matrixWorld=g},U.prototype.setGeometry=function(g,A){if(this.widthCallback=A,this.positions=[],this.counters=[],g instanceof D.Geometry)for(var M=0;M<g.vertices.length;M++){var N=g.vertices[M];A=M/g.vertices.length,this.positions.push(N.x,N.y,N.z),this.positions.push(N.x,N.y,N.z),this.counters.push(A),this.counters.push(A)}if(D.BufferGeometry,g instanceof Float32Array||g instanceof Array)for(M=0;M<g.length;M+=3)A=M/g.length,this.positions.push(g[M],g[M+1],g[M+2]),this.positions.push(g[M],g[M+1],g[M+2]),this.counters.push(A),this.counters.push(A);this.process()},U.prototype.raycast=(a=new D.Matrix4,v=new D.Ray,h=new D.Sphere,function(g,A){var M=g.linePrecision,N=M*M,F=this.geometry;if(F.boundingSphere===null&&F.computeBoundingSphere(),h.copy(F.boundingSphere),h.applyMatrix4(this.matrixWorld),g.ray.intersectSphere(h)!==!1){a.getInverse(this.matrixWorld),v.copy(g.ray).applyMatrix4(a);var T=new D.Vector3,_=new D.Vector3,Y=new D.Vector3,k=new D.Vector3,S=this instanceof D.LineSegments?2:1;if(F instanceof D.BufferGeometry){var G=F.index,C=F.attributes;if(G!==null)for(var B=G.array,R=C.position.array,u=0,c=B.length-1;u<c;u+=S){var f=B[u],O=B[u+1];T.fromArray(R,3*f),_.fromArray(R,3*O),N<v.distanceSqToSegment(T,_,k,Y)||(k.applyMatrix4(this.matrixWorld),(J=g.ray.origin.distanceTo(k))<g.near||J>g.far||A.push({distance:J,point:Y.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}))}else for(u=0,c=(R=C.position.array).length/3-1;u<c;u+=S)T.fromArray(R,3*u),_.fromArray(R,3*u+3),N<v.distanceSqToSegment(T,_,k,Y)||(k.applyMatrix4(this.matrixWorld),(J=g.ray.origin.distanceTo(k))<g.near||J>g.far||A.push({distance:J,point:Y.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}))}else if(F instanceof D.Geometry){var W=F.vertices,X=W.length;for(u=0;u<X-1;u+=S){var J;N<v.distanceSqToSegment(W[u],W[u+1],k,Y)||(k.applyMatrix4(this.matrixWorld),(J=g.ray.origin.distanceTo(k))<g.near||J>g.far||A.push({distance:J,point:Y.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}))}}}}),U.prototype.compareV3=function(g,A){var M=6*g,N=6*A;return this.positions[M]===this.positions[N]&&this.positions[1+M]===this.positions[1+N]&&this.positions[2+M]===this.positions[2+N]},U.prototype.copyV3=function(g){var A=6*g;return[this.positions[A],this.positions[1+A],this.positions[2+A]]},U.prototype.process=function(){var g,A,M=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];for(var N=0;N<M;N++)this.side.push(1),this.side.push(-1);for(N=0;N<M;N++)g=this.widthCallback?this.widthCallback(N/(M-1)):1,this.width.push(g),this.width.push(g);for(N=0;N<M;N++)this.uvs.push(N/(M-1),0),this.uvs.push(N/(M-1),1);for(A=this.compareV3(0,M-1)?this.copyV3(M-2):this.copyV3(0),this.previous.push(A[0],A[1],A[2]),this.previous.push(A[0],A[1],A[2]),N=0;N<M-1;N++)A=this.copyV3(N),this.previous.push(A[0],A[1],A[2]),this.previous.push(A[0],A[1],A[2]);for(N=1;N<M;N++)A=this.copyV3(N),this.next.push(A[0],A[1],A[2]),this.next.push(A[0],A[1],A[2]);for(A=this.compareV3(M-1,0)?this.copyV3(1):this.copyV3(M-1),this.next.push(A[0],A[1],A[2]),this.next.push(A[0],A[1],A[2]),N=0;N<M-1;N++){var F=2*N;this.indices_array.push(F,1+F,2+F),this.indices_array.push(2+F,1+F,3+F)}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 D.BufferAttribute(new Float32Array(this.positions),3),previous:new D.BufferAttribute(new Float32Array(this.previous),3),next:new D.BufferAttribute(new Float32Array(this.next),3),side:new D.BufferAttribute(new Float32Array(this.side),1),width:new D.BufferAttribute(new Float32Array(this.width),1),uv:new D.BufferAttribute(new Float32Array(this.uvs),2),index:new D.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new D.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)},U.prototype.advance=function(g){var A=this.attributes.position.array,M=this.attributes.previous.array,N=this.attributes.next.array,F=A.length;V(A,0,M,0,F),V(A,6,A,0,F-6),A[F-6]=g.x,A[F-5]=g.y,A[F-4]=g.z,A[F-3]=g.x,A[F-2]=g.y,A[F-1]=g.z,V(A,6,N,0,F-6),N[F-6]=g.x,N[F-5]=g.y,N[F-4]=g.z,N[F-3]=g.x,N[F-2]=g.y,N[F-1]=g.z,this.attributes.position.needsUpdate=!0,this.attributes.previous.needsUpdate=!0,this.attributes.next.needsUpdate=!0},D.ShaderChunk.meshline_vert=["",D.ShaderChunk.logdepthbuf_pars_vertex,D.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;"," 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;","",D.ShaderChunk.logdepthbuf_vertex,D.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",D.ShaderChunk.fog_vertex,"}"].join(`
|
|
`),D.ShaderChunk.meshline_frag=["",D.ShaderChunk.fog_pars_fragment,D.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() {","",D.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);","",D.ShaderChunk.fog_fragment,"}"].join(`
|
|
`),((I.prototype=Object.create(D.ShaderMaterial.prototype)).constructor=I).prototype.isMeshLineMaterial=!0,I.prototype.copy=function(g){return D.ShaderMaterial.prototype.copy.call(this,g),this.lineWidth=g.lineWidth,this.map=g.map,this.useMap=g.useMap,this.alphaMap=g.alphaMap,this.useAlphaMap=g.useAlphaMap,this.color.copy(g.color),this.opacity=g.opacity,this.resolution.copy(g.resolution),this.sizeAttenuation=g.sizeAttenuation,this.near=g.near,this.far=g.far,this.dashArray.copy(g.dashArray),this.dashOffset.copy(g.dashOffset),this.dashRatio.copy(g.dashRatio),this.useDash=g.useDash,this.visibility=g.visibility,this.alphaTest=g.alphaTest,this.repeat.copy(g.repeat),this},o!==void 0?(r!==void 0&&r.exports&&(o=r.exports={MeshLine:U,MeshLineMaterial:I}),o.MeshLine=U,o.MeshLineMaterial=I):(this.MeshLine=U,this.MeshLineMaterial=I)}).call(this)},{three:19}],19:[function(w,r,o){var a,v;a=this,v=function(h){Number.EPSILON===void 0&&(Number.EPSILON=Math.pow(2,-52)),Number.isInteger===void 0&&(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}),Math.sign===void 0&&(Math.sign=function(e){return e<0?-1:0<e?1:+e}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),Object.assign===void 0&&(Object.assign=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!=null)for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(t[l]=i[l])}return t});var b=0,D=1,U=2,V=1,I=2,g=3,A=0,M=1,N=2,F=0,T=0,_=1,Y=2,k=3,S=4,G=5,C=100,B=101,R=102,u=103,c=104,f=200,O=201,W=202,X=203,J=204,te=205,ne=206,ue=207,be=208,je=209,ve=210,Be=0,q=1,ge=2,oe=3,le=4,Pe=5,Ye=6,ze=7,se=0,xe=1,De=2,tt=0,st=1,mt=2,Rt=3,Ot=4,He=5,Vt=301,jt=302,Ln=303,nn=304,er=305,yt=306,Ue=307,Zt=1e3,On=1001,Xn=1002,dt=1003,lt=1004,Xt=1005,xn=1006,$t=1007,Yn=1008,kr=1009,Br=1010,$e=1011,We=1012,ut=1013,Ie=1014,Mt=1015,rn=1016,tn=1017,En=1018,br=1019,Mr=1020,Tr=1021,ti=1022,Gr=1023,ba=1024,Di=1025,wi=Gr,or=1026,ni=1027,H=1028,Nr=1029,Ri=1030,Zn=1031,Xi=1032,xo=1033,Bs=33776,ts=33777,ms=33778,no=33779,ns=35840,la=35841,Fo=35842,Aa=35843,gs=36196,Gs=37808,ro=37809,ys=37810,Oa=37811,vs=37812,io=37813,ao=37814,qr=37815,Dr=37816,rs=37817,xs=37818,is=37819,Bo=37820,Yi=37821,jr=2300,Q=2301,Ce=2400,ce=2401,Te=2402,Ke=3e3,vt=3001,Ft=3007,Jt=3002,In=3003,Gn=3004,sr=3005,hi=3006,oo=3200,Ei=3201,wo=0,Do=1,so=7680,zs=519,Wr=35044,Ma=35048;function ka(){}Object.assign(ka.prototype,{addEventListener:function(e,t){this._listeners===void 0&&(this._listeners={});var n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)},hasEventListener:function(e,t){if(this._listeners===void 0)return!1;var n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1},removeEventListener:function(e,t){if(this._listeners!==void 0){var n=this._listeners[e];if(n!==void 0){var i=n.indexOf(t);i!==-1&&n.splice(i,1)}}},dispatchEvent:function(e){if(this._listeners!==void 0){var t=this._listeners[e.type];if(t!==void 0){e.target=this;for(var n=t.slice(0),i=0,l=n.length;i<l;i++)n[i].call(this,e)}}}});for(var na=[],Go=0;Go<256;Go++)na[Go]=(Go<16?"0":"")+Go.toString(16);var ws,yr={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(na[255&e]+na[e>>8&255]+na[e>>16&255]+na[e>>24&255]+"-"+na[255&t]+na[t>>8&255]+"-"+na[t>>16&15|64]+na[t>>24&255]+"-"+na[63&n|128]+na[n>>8&255]+"-"+na[n>>16&255]+na[n>>24&255]+na[255&i]+na[i>>8&255]+na[i>>16&255]+na[i>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,i,l){return i+(e-t)*(l-i)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*yr.DEG2RAD},radToDeg:function(e){return e*yr.RAD2DEG},isPowerOfTwo:function(e){return(e&e-1)==0&&e!==0},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,i,l){var d=Math.cos,m=Math.sin,x=d(n/2),L=m(n/2),j=d((t+i)/2),Z=m((t+i)/2),ee=d((t-i)/2),ie=m((t-i)/2),z=d((i-t)/2),he=m((i-t)/2);l==="XYX"?e.set(x*Z,L*ee,L*ie,x*j):l==="YZY"?e.set(L*ie,x*Z,L*ee,x*j):l==="ZXZ"?e.set(L*ee,L*ie,x*Z,x*j):l==="XZX"?e.set(x*Z,L*he,L*z,x*j):l==="YXY"?e.set(L*z,x*Z,L*he,x*j):l==="ZYZ"?e.set(L*he,L*z,x*Z,x*j):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function zt(e,t){this.x=e||0,this.y=t||0}function Ai(){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(zt.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(zt.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.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 e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return t===void 0&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),i=Math.sin(t),l=this.x-e.x,d=this.y-e.y;return this.x=l*n-d*i+e.x,this.y=l*i+d*n+e.y,this}}),Object.assign(Ai.prototype,{isMatrix3:!0,set:function(e,t,n,i,l,d,m,x,L){var j=this.elements;return j[0]=e,j[1]=i,j[2]=m,j[3]=t,j[4]=l,j[5]=x,j[6]=n,j[7]=d,j[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(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,l=this.elements,d=n[0],m=n[3],x=n[6],L=n[1],j=n[4],Z=n[7],ee=n[2],ie=n[5],z=n[8],he=i[0],me=i[3],ye=i[6],Ae=i[1],Le=i[4],Ge=i[7],et=i[2],Fe=i[5],at=i[8];return l[0]=d*he+m*Ae+x*et,l[3]=d*me+m*Le+x*Fe,l[6]=d*ye+m*Ge+x*at,l[1]=L*he+j*Ae+Z*et,l[4]=L*me+j*Le+Z*Fe,l[7]=L*ye+j*Ge+Z*at,l[2]=ee*he+ie*Ae+z*et,l[5]=ee*me+ie*Le+z*Fe,l[8]=ee*ye+ie*Ge+z*at,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],i=e[2],l=e[3],d=e[4],m=e[5],x=e[6],L=e[7],j=e[8];return t*d*j-t*m*L-n*l*j+n*m*x+i*l*L-i*d*x},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,i=this.elements,l=n[0],d=n[1],m=n[2],x=n[3],L=n[4],j=n[5],Z=n[6],ee=n[7],ie=n[8],z=ie*L-j*ee,he=j*Z-ie*x,me=ee*x-L*Z,ye=l*z+d*he+m*me;if(ye==0){var Ae="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(t===!0)throw new Error(Ae);return console.warn(Ae),this.identity()}var Le=1/ye;return i[0]=z*Le,i[1]=(m*ee-ie*d)*Le,i[2]=(j*d-m*L)*Le,i[3]=he*Le,i[4]=(ie*l-m*Z)*Le,i[5]=(m*x-j*l)*Le,i[6]=me*Le,i[7]=(d*Z-ee*l)*Le,i[8]=(L*l-d*x)*Le,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,i,l,d,m){var x=Math.cos(l),L=Math.sin(l);this.set(n*x,n*L,-n*(x*d+L*m)+d+e,-i*L,i*x,-i*(-L*d+x*m)+m+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),i=this.elements,l=i[0],d=i[3],m=i[6],x=i[1],L=i[4],j=i[7];return i[0]=t*l+n*x,i[3]=t*d+n*L,i[6]=t*m+n*j,i[1]=-n*l+t*x,i[4]=-n*d+t*L,i[7]=-n*m+t*j,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){t===void 0&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){e===void 0&&(e=[]),t===void 0&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var zo={getDataURL:function(e){var t;if(typeof HTMLCanvasElement=="undefined")return e.src;if(e instanceof HTMLCanvasElement)t=e;else{ws===void 0&&(ws=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),ws.width=e.width,ws.height=e.height;var n=ws.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ws}return 2048<t.width||2048<t.height?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},cu=0;function Xr(e,t,n,i,l,d,m,x,L,j){Object.defineProperty(this,"id",{value:cu++}),this.uuid=yr.generateUUID(),this.name="",this.image=e!==void 0?e:Xr.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=t!==void 0?t:Xr.DEFAULT_MAPPING,this.wrapS=n!==void 0?n:On,this.wrapT=i!==void 0?i:On,this.magFilter=l!==void 0?l:xn,this.minFilter=d!==void 0?d:Yn,this.anisotropy=L!==void 0?L:1,this.format=m!==void 0?m:Gr,this.internalFormat=null,this.type=x!==void 0?x:kr,this.offset=new zt(0,0),this.repeat=new zt(1,1),this.center=new zt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ai,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=j!==void 0?j:Ke,this.version=0,this.onUpdate=null}function Jr(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=i!==void 0?i:1}function Zi(e,t,n){this.width=e,this.height=t,this.scissor=new Jr(0,0,e,t),this.scissorTest=!1,this.viewport=new Jr(0,0,e,t),n=n||{},this.texture=new Xr(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=e,this.texture.image.height=t,this.texture.generateMipmaps=n.generateMipmaps!==void 0&&n.generateMipmaps,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:xn,this.depthBuffer=n.depthBuffer===void 0||n.depthBuffer,this.stencilBuffer=n.stencilBuffer===void 0||n.stencilBuffer,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null}function Us(e,t,n){Zi.call(this,e,t,n),this.samples=4}function Gi(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._w=i!==void 0?i:1}Xr.DEFAULT_IMAGE=void 0,Xr.DEFAULT_MAPPING=300,Xr.prototype=Object.assign(Object.create(ka.prototype),{constructor:Xr,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(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.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(this.image!==void 0){var i=this.image;if(i.uuid===void 0&&(i.uuid=yr.generateUUID()),!t&&e.images[i.uuid]===void 0){var l;if(Array.isArray(i)){l=[];for(var d=0,m=i.length;d<m;d++)l.push(zo.getDataURL(i[d]))}else l=zo.getDataURL(i);e.images[i.uuid]={uuid:i.uuid,url:l}}n.image=i.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||1<e.x)switch(this.wrapS){case Zt:e.x=e.x-Math.floor(e.x);break;case On:e.x=e.x<0?0:1;break;case Xn:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||1<e.y)switch(this.wrapT){case Zt:e.y=e.y-Math.floor(e.y);break;case On:e.y=e.y<0?0:1;break;case Xn:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Xr.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),Object.defineProperties(Jr.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(Jr.prototype,{isVector4:!0,set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){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: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this},add:function(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,l=this.w,d=e.elements;return this.x=d[0]*t+d[4]*n+d[8]*i+d[12]*l,this.y=d[1]*t+d[5]*n+d[9]*i+d[13]*l,this.z=d[2]*t+d[6]*n+d[10]*i+d[14]*l,this.w=d[3]*t+d[7]*n+d[11]*i+d[15]*l,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,i,l,d=e.elements,m=d[0],x=d[4],L=d[8],j=d[1],Z=d[5],ee=d[9],ie=d[2],z=d[6],he=d[10];if(Math.abs(x-j)<.01&&Math.abs(L-ie)<.01&&Math.abs(ee-z)<.01){if(Math.abs(x+j)<.1&&Math.abs(L+ie)<.1&&Math.abs(ee+z)<.1&&Math.abs(m+Z+he-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var me=(m+1)/2,ye=(Z+1)/2,Ae=(he+1)/2,Le=(x+j)/4,Ge=(L+ie)/4,et=(ee+z)/4;return ye<me&&Ae<me?l=me<.01?(n=0,i=.707106781):(i=Le/(n=Math.sqrt(me)),Ge/n):Ae<ye?l=ye<.01?(i=0,n=.707106781):(n=Le/(i=Math.sqrt(ye)),et/i):Ae<.01?(i=n=.707106781,l=0):(n=Ge/(l=Math.sqrt(Ae)),i=et/l),this.set(n,i,l,t),this}var Fe=Math.sqrt((z-ee)*(z-ee)+(L-ie)*(L-ie)+(j-x)*(j-x));return Math.abs(Fe)<.001&&(Fe=1),this.x=(z-ee)/Fe,this.y=(L-ie)/Fe,this.z=(j-x)/Fe,this.w=Math.acos((m+Z+he-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return t===void 0&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return n!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Zi.prototype=Object.assign(Object.create(ka.prototype),{constructor:Zi,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Us.prototype=Object.assign(Object.create(Zi.prototype),{constructor:Us,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Zi.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(Gi,{slerp:function(e,t,n,i){return n.copy(e).slerp(t,i)},slerpFlat:function(e,t,n,i,l,d,m){var x=n[i+0],L=n[i+1],j=n[i+2],Z=n[i+3],ee=l[d+0],ie=l[d+1],z=l[d+2],he=l[d+3];if(Z!==he||x!==ee||L!==ie||j!==z){var me=1-m,ye=x*ee+L*ie+j*z+Z*he,Ae=0<=ye?1:-1,Le=1-ye*ye;if(Le>Number.EPSILON){var Ge=Math.sqrt(Le),et=Math.atan2(Ge,ye*Ae);me=Math.sin(me*et)/Ge,m=Math.sin(m*et)/Ge}var Fe=m*Ae;if(x=x*me+ee*Fe,L=L*me+ie*Fe,j=j*me+z*Fe,Z=Z*me+he*Fe,me===1-m){var at=1/Math.sqrt(x*x+L*L+j*j+Z*Z);x*=at,L*=at,j*=at,Z*=at}}e[t]=x,e[t+1]=L,e[t+2]=j,e[t+3]=Z}}),Object.defineProperties(Gi.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(Gi.prototype,{isQuaternion:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,i=e._y,l=e._z,d=e.order,m=Math.cos,x=Math.sin,L=m(n/2),j=m(i/2),Z=m(l/2),ee=x(n/2),ie=x(i/2),z=x(l/2);return d==="XYZ"?(this._x=ee*j*Z+L*ie*z,this._y=L*ie*Z-ee*j*z,this._z=L*j*z+ee*ie*Z,this._w=L*j*Z-ee*ie*z):d==="YXZ"?(this._x=ee*j*Z+L*ie*z,this._y=L*ie*Z-ee*j*z,this._z=L*j*z-ee*ie*Z,this._w=L*j*Z+ee*ie*z):d==="ZXY"?(this._x=ee*j*Z-L*ie*z,this._y=L*ie*Z+ee*j*z,this._z=L*j*z+ee*ie*Z,this._w=L*j*Z-ee*ie*z):d==="ZYX"?(this._x=ee*j*Z-L*ie*z,this._y=L*ie*Z+ee*j*z,this._z=L*j*z-ee*ie*Z,this._w=L*j*Z+ee*ie*z):d==="YZX"?(this._x=ee*j*Z+L*ie*z,this._y=L*ie*Z+ee*j*z,this._z=L*j*z-ee*ie*Z,this._w=L*j*Z-ee*ie*z):d==="XZY"&&(this._x=ee*j*Z-L*ie*z,this._y=L*ie*Z-ee*j*z,this._z=L*j*z+ee*ie*Z,this._w=L*j*Z+ee*ie*z),t!==!1&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,i=n[0],l=n[4],d=n[8],m=n[1],x=n[5],L=n[9],j=n[2],Z=n[6],ee=n[10],ie=i+x+ee;return 0<ie?(t=.5/Math.sqrt(ie+1),this._w=.25/t,this._x=(Z-L)*t,this._y=(d-j)*t,this._z=(m-l)*t):x<i&&ee<i?(t=2*Math.sqrt(1+i-x-ee),this._w=(Z-L)/t,this._x=.25*t,this._y=(l+m)/t,this._z=(d+j)/t):ee<x?(t=2*Math.sqrt(1+x-i-ee),this._w=(d-j)/t,this._x=(l+m)/t,this._y=.25*t,this._z=(L+Z)/t):(t=2*Math.sqrt(1+ee-i-x),this._w=(m-l)/t,this._x=(d+j)/t,this._y=(L+Z)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=n,this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(yr.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(n===0)return this;var i=Math.min(1,t/n);return this.slerp(e,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,i=e._y,l=e._z,d=e._w,m=t._x,x=t._y,L=t._z,j=t._w;return this._x=n*j+d*m+i*L-l*x,this._y=i*j+d*x+l*m-n*L,this._z=l*j+d*L+n*x-i*m,this._w=d*j-n*m-i*x-l*L,this._onChangeCallback(),this},slerp:function(e,t){if(t===0)return this;if(t===1)return this.copy(e);var n=this._x,i=this._y,l=this._z,d=this._w,m=d*e._w+n*e._x+i*e._y+l*e._z;if(m<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,m=-m):this.copy(e),1<=m)return this._w=d,this._x=n,this._y=i,this._z=l,this;var x=1-m*m;if(x<=Number.EPSILON){var L=1-t;return this._w=L*d+t*this._w,this._x=L*n+t*this._x,this._y=L*i+t*this._y,this._z=L*l+t*this._z,this.normalize(),this._onChangeCallback(),this}var j=Math.sqrt(x),Z=Math.atan2(j,m),ee=Math.sin((1-t)*Z)/j,ie=Math.sin(t*Z)/j;return this._w=d*ee+this._w*ie,this._x=n*ee+this._x*ie,this._y=i*ee+this._y*ie,this._z=l*ee+this._z*ie,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return t===void 0&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var bs=new Re,Hs=new Gi;function Re(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}Object.assign(Re.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Hs.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(Hs.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,i=this.z,l=e.elements;return this.x=l[0]*t+l[3]*n+l[6]*i,this.y=l[1]*t+l[4]*n+l[7]*i,this.z=l[2]*t+l[5]*n+l[8]*i,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,l=e.elements,d=1/(l[3]*t+l[7]*n+l[11]*i+l[15]);return this.x=(l[0]*t+l[4]*n+l[8]*i+l[12])*d,this.y=(l[1]*t+l[5]*n+l[9]*i+l[13])*d,this.z=(l[2]*t+l[6]*n+l[10]*i+l[14])*d,this},applyQuaternion:function(e){var t=this.x,n=this.y,i=this.z,l=e.x,d=e.y,m=e.z,x=e.w,L=x*t+d*i-m*n,j=x*n+m*t-l*i,Z=x*i+l*n-d*t,ee=-l*t-d*n-m*i;return this.x=L*x+ee*-l+j*-m-Z*-d,this.y=j*x+ee*-d+Z*-l-L*-m,this.z=Z*x+ee*-m+L*-d-j*-l,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,i=this.z,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*i,this.y=l[1]*t+l[5]*n+l[9]*i,this.z=l[2]*t+l[6]*n+l[10]*i,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,i=e.y,l=e.z,d=t.x,m=t.y,x=t.z;return this.x=i*x-l*m,this.y=l*d-n*x,this.z=n*m-i*d,this},projectOnVector:function(e){var t=e.lengthSq();if(t===0)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},projectOnPlane:function(e){return bs.copy(this).projectOnVector(e),this.sub(bs)},reflect:function(e){return this.sub(bs.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(yr.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,3*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return t===void 0&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}});var Eo=new Re,ra=new fr,uu=new Re(0,0,0),Ms=new Re(1,1,1),Ao=new Re,Ws=new Re,_a=new Re;function fr(){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(fr.prototype,{isMatrix4:!0,set:function(e,t,n,i,l,d,m,x,L,j,Z,ee,ie,z,he,me){var ye=this.elements;return ye[0]=e,ye[4]=t,ye[8]=n,ye[12]=i,ye[1]=l,ye[5]=d,ye[9]=m,ye[13]=x,ye[2]=L,ye[6]=j,ye[10]=Z,ye[14]=ee,ye[3]=ie,ye[7]=z,ye[11]=he,ye[15]=me,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 fr().fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,n=e.elements,i=1/Eo.setFromMatrixColumn(e,0).length(),l=1/Eo.setFromMatrixColumn(e,1).length(),d=1/Eo.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*l,t[5]=n[5]*l,t[6]=n[6]*l,t[7]=0,t[8]=n[8]*d,t[9]=n[9]*d,t[10]=n[10]*d,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,i=e.y,l=e.z,d=Math.cos(n),m=Math.sin(n),x=Math.cos(i),L=Math.sin(i),j=Math.cos(l),Z=Math.sin(l);if(e.order==="XYZ"){var ee=d*j,ie=d*Z,z=m*j,he=m*Z;t[0]=x*j,t[4]=-x*Z,t[8]=L,t[1]=ie+z*L,t[5]=ee-he*L,t[9]=-m*x,t[2]=he-ee*L,t[6]=z+ie*L,t[10]=d*x}else if(e.order==="YXZ"){var me=x*j,ye=x*Z,Ae=L*j,Le=L*Z;t[0]=me+Le*m,t[4]=Ae*m-ye,t[8]=d*L,t[1]=d*Z,t[5]=d*j,t[9]=-m,t[2]=ye*m-Ae,t[6]=Le+me*m,t[10]=d*x}else if(e.order==="ZXY")me=x*j,ye=x*Z,Ae=L*j,Le=L*Z,t[0]=me-Le*m,t[4]=-d*Z,t[8]=Ae+ye*m,t[1]=ye+Ae*m,t[5]=d*j,t[9]=Le-me*m,t[2]=-d*L,t[6]=m,t[10]=d*x;else if(e.order==="ZYX")ee=d*j,ie=d*Z,z=m*j,he=m*Z,t[0]=x*j,t[4]=z*L-ie,t[8]=ee*L+he,t[1]=x*Z,t[5]=he*L+ee,t[9]=ie*L-z,t[2]=-L,t[6]=m*x,t[10]=d*x;else if(e.order==="YZX"){var Ge=d*x,et=d*L,Fe=m*x,at=m*L;t[0]=x*j,t[4]=at-Ge*Z,t[8]=Fe*Z+et,t[1]=Z,t[5]=d*j,t[9]=-m*j,t[2]=-L*j,t[6]=et*Z+Fe,t[10]=Ge-at*Z}else e.order==="XZY"&&(Ge=d*x,et=d*L,Fe=m*x,at=m*L,t[0]=x*j,t[4]=-Z,t[8]=L*j,t[1]=Ge*Z+at,t[5]=d*j,t[9]=et*Z-Fe,t[2]=Fe*Z-et,t[6]=m*j,t[10]=at*Z+Ge);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(uu,e,Ms)},lookAt:function(e,t,n){var i=this.elements;return _a.subVectors(e,t),_a.lengthSq()===0&&(_a.z=1),_a.normalize(),Ao.crossVectors(n,_a),Ao.lengthSq()===0&&(Math.abs(n.z)===1?_a.x+=1e-4:_a.z+=1e-4,_a.normalize(),Ao.crossVectors(n,_a)),Ao.normalize(),Ws.crossVectors(_a,Ao),i[0]=Ao.x,i[4]=Ws.x,i[8]=_a.x,i[1]=Ao.y,i[5]=Ws.y,i[9]=_a.y,i[2]=Ao.z,i[6]=Ws.z,i[10]=_a.z,this},multiply:function(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,l=this.elements,d=n[0],m=n[4],x=n[8],L=n[12],j=n[1],Z=n[5],ee=n[9],ie=n[13],z=n[2],he=n[6],me=n[10],ye=n[14],Ae=n[3],Le=n[7],Ge=n[11],et=n[15],Fe=i[0],at=i[4],Je=i[8],xt=i[12],Tt=i[1],Et=i[5],At=i[9],Gt=i[13],Yt=i[2],St=i[6],_t=i[10],hn=i[14],bn=i[3],Kn=i[7],qn=i[11],Bn=i[15];return l[0]=d*Fe+m*Tt+x*Yt+L*bn,l[4]=d*at+m*Et+x*St+L*Kn,l[8]=d*Je+m*At+x*_t+L*qn,l[12]=d*xt+m*Gt+x*hn+L*Bn,l[1]=j*Fe+Z*Tt+ee*Yt+ie*bn,l[5]=j*at+Z*Et+ee*St+ie*Kn,l[9]=j*Je+Z*At+ee*_t+ie*qn,l[13]=j*xt+Z*Gt+ee*hn+ie*Bn,l[2]=z*Fe+he*Tt+me*Yt+ye*bn,l[6]=z*at+he*Et+me*St+ye*Kn,l[10]=z*Je+he*At+me*_t+ye*qn,l[14]=z*xt+he*Gt+me*hn+ye*Bn,l[3]=Ae*Fe+Le*Tt+Ge*Yt+et*bn,l[7]=Ae*at+Le*Et+Ge*St+et*Kn,l[11]=Ae*Je+Le*At+Ge*_t+et*qn,l[15]=Ae*xt+Le*Gt+Ge*hn+et*Bn,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[4],i=e[8],l=e[12],d=e[1],m=e[5],x=e[9],L=e[13],j=e[2],Z=e[6],ee=e[10],ie=e[14];return e[3]*(l*x*Z-i*L*Z-l*m*ee+n*L*ee+i*m*ie-n*x*ie)+e[7]*(t*x*ie-t*L*ee+l*d*ee-i*d*ie+i*L*j-l*x*j)+e[11]*(t*L*Z-t*m*ie-l*d*Z+n*d*ie+l*m*j-n*L*j)+e[15]*(-i*m*j-t*x*Z+t*m*ee+i*d*Z-n*d*ee+n*x*j)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,n){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this},getInverse:function(e,t){var n=this.elements,i=e.elements,l=i[0],d=i[1],m=i[2],x=i[3],L=i[4],j=i[5],Z=i[6],ee=i[7],ie=i[8],z=i[9],he=i[10],me=i[11],ye=i[12],Ae=i[13],Le=i[14],Ge=i[15],et=z*Le*ee-Ae*he*ee+Ae*Z*me-j*Le*me-z*Z*Ge+j*he*Ge,Fe=ye*he*ee-ie*Le*ee-ye*Z*me+L*Le*me+ie*Z*Ge-L*he*Ge,at=ie*Ae*ee-ye*z*ee+ye*j*me-L*Ae*me-ie*j*Ge+L*z*Ge,Je=ye*z*Z-ie*Ae*Z-ye*j*he+L*Ae*he+ie*j*Le-L*z*Le,xt=l*et+d*Fe+m*at+x*Je;if(xt==0){var Tt="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(t===!0)throw new Error(Tt);return console.warn(Tt),this.identity()}var Et=1/xt;return n[0]=et*Et,n[1]=(Ae*he*x-z*Le*x-Ae*m*me+d*Le*me+z*m*Ge-d*he*Ge)*Et,n[2]=(j*Le*x-Ae*Z*x+Ae*m*ee-d*Le*ee-j*m*Ge+d*Z*Ge)*Et,n[3]=(z*Z*x-j*he*x-z*m*ee+d*he*ee+j*m*me-d*Z*me)*Et,n[4]=Fe*Et,n[5]=(ie*Le*x-ye*he*x+ye*m*me-l*Le*me-ie*m*Ge+l*he*Ge)*Et,n[6]=(ye*Z*x-L*Le*x-ye*m*ee+l*Le*ee+L*m*Ge-l*Z*Ge)*Et,n[7]=(L*he*x-ie*Z*x+ie*m*ee-l*he*ee-L*m*me+l*Z*me)*Et,n[8]=at*Et,n[9]=(ye*z*x-ie*Ae*x-ye*d*me+l*Ae*me+ie*d*Ge-l*z*Ge)*Et,n[10]=(L*Ae*x-ye*j*x+ye*d*ee-l*Ae*ee-L*d*Ge+l*j*Ge)*Et,n[11]=(ie*j*x-L*z*x-ie*d*ee+l*z*ee+L*d*me-l*j*me)*Et,n[12]=Je*Et,n[13]=(ie*Ae*m-ye*z*m+ye*d*he-l*Ae*he-ie*d*Le+l*z*Le)*Et,n[14]=(ye*j*m-L*Ae*m-ye*d*Z+l*Ae*Z+L*d*Le-l*j*Le)*Et,n[15]=(L*z*m-ie*j*m+ie*d*Z-l*z*Z-L*d*he+l*j*he)*Et,this},scale:function(e){var t=this.elements,n=e.x,i=e.y,l=e.z;return t[0]*=n,t[4]*=i,t[8]*=l,t[1]*=n,t[5]*=i,t[9]*=l,t[2]*=n,t[6]*=i,t[10]*=l,t[3]*=n,t[7]*=i,t[11]*=l,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),i=Math.sin(t),l=1-n,d=e.x,m=e.y,x=e.z,L=l*d,j=l*m;return this.set(L*d+n,L*m-i*x,L*x+i*m,0,L*m+i*x,j*m+n,j*x-i*d,0,L*x-i*m,j*x+i*d,l*x*x+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var i=this.elements,l=t._x,d=t._y,m=t._z,x=t._w,L=l+l,j=d+d,Z=m+m,ee=l*L,ie=l*j,z=l*Z,he=d*j,me=d*Z,ye=m*Z,Ae=x*L,Le=x*j,Ge=x*Z,et=n.x,Fe=n.y,at=n.z;return i[0]=(1-(he+ye))*et,i[1]=(ie+Ge)*et,i[2]=(z-Le)*et,i[3]=0,i[4]=(ie-Ge)*Fe,i[5]=(1-(ee+ye))*Fe,i[6]=(me+Ae)*Fe,i[7]=0,i[8]=(z+Le)*at,i[9]=(me-Ae)*at,i[10]=(1-(ee+he))*at,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:function(e,t,n){var i=this.elements,l=Eo.set(i[0],i[1],i[2]).length(),d=Eo.set(i[4],i[5],i[6]).length(),m=Eo.set(i[8],i[9],i[10]).length();this.determinant()<0&&(l=-l),e.x=i[12],e.y=i[13],e.z=i[14],ra.copy(this);var x=1/l,L=1/d,j=1/m;return ra.elements[0]*=x,ra.elements[1]*=x,ra.elements[2]*=x,ra.elements[4]*=L,ra.elements[5]*=L,ra.elements[6]*=L,ra.elements[8]*=j,ra.elements[9]*=j,ra.elements[10]*=j,t.setFromRotationMatrix(ra),n.x=l,n.y=d,n.z=m,this},makePerspective:function(e,t,n,i,l,d){d===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var m=this.elements,x=2*l/(t-e),L=2*l/(n-i),j=(t+e)/(t-e),Z=(n+i)/(n-i),ee=-(d+l)/(d-l),ie=-2*d*l/(d-l);return m[0]=x,m[4]=0,m[8]=j,m[12]=0,m[1]=0,m[5]=L,m[9]=Z,m[13]=0,m[2]=0,m[6]=0,m[10]=ee,m[14]=ie,m[3]=0,m[7]=0,m[11]=-1,m[15]=0,this},makeOrthographic:function(e,t,n,i,l,d){var m=this.elements,x=1/(t-e),L=1/(n-i),j=1/(d-l),Z=(t+e)*x,ee=(n+i)*L,ie=(d+l)*j;return m[0]=2*x,m[4]=0,m[8]=0,m[12]=-Z,m[1]=0,m[5]=2*L,m[9]=0,m[13]=-ee,m[2]=0,m[6]=0,m[10]=-2*j,m[14]=-ie,m[3]=0,m[7]=0,m[11]=0,m[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){t===void 0&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){e===void 0&&(e=[]),t===void 0&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var Tl=new fr,oc=new Gi;function y(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._order=i||y.DefaultOrder}function E(){this.mask=1}y.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],y.DefaultOrder="XYZ",Object.defineProperties(y.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(y.prototype,{isEuler:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var i=yr.clamp,l=e.elements,d=l[0],m=l[4],x=l[8],L=l[1],j=l[5],Z=l[9],ee=l[2],ie=l[6],z=l[10];return(t=t||this._order)==="XYZ"?(this._y=Math.asin(i(x,-1,1)),Math.abs(x)<.9999999?(this._x=Math.atan2(-Z,z),this._z=Math.atan2(-m,d)):(this._x=Math.atan2(ie,j),this._z=0)):t==="YXZ"?(this._x=Math.asin(-i(Z,-1,1)),Math.abs(Z)<.9999999?(this._y=Math.atan2(x,z),this._z=Math.atan2(L,j)):(this._y=Math.atan2(-ee,d),this._z=0)):t==="ZXY"?(this._x=Math.asin(i(ie,-1,1)),Math.abs(ie)<.9999999?(this._y=Math.atan2(-ee,z),this._z=Math.atan2(-m,j)):(this._y=0,this._z=Math.atan2(L,d))):t==="ZYX"?(this._y=Math.asin(-i(ee,-1,1)),Math.abs(ee)<.9999999?(this._x=Math.atan2(ie,z),this._z=Math.atan2(L,d)):(this._x=0,this._z=Math.atan2(-m,j))):t==="YZX"?(this._z=Math.asin(i(L,-1,1)),Math.abs(L)<.9999999?(this._x=Math.atan2(-Z,j),this._y=Math.atan2(-ee,d)):(this._x=0,this._y=Math.atan2(x,z))):t==="XZY"?(this._z=Math.asin(-i(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(ie,j),this._y=Math.atan2(x,d)):(this._x=Math.atan2(-Z,z),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,n!==!1&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return Tl.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Tl,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return oc.setFromEuler(this),this.setFromQuaternion(oc,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new Re(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(E.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return(this.mask&e.mask)!=0}});var K=0,re=new Re,de=new Gi,fe=new fr,_e=new Re,Me=new Re,Se=new Re,Ve=new Gi,rt=new Re(1,0,0),ft=new Re(0,1,0),ct=new Re(0,0,1),Lt={type:"added"},kn={type:"removed"};function Pt(){Object.defineProperty(this,"id",{value:K++}),this.uuid=yr.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Pt.DefaultUp.clone();var e=new Re,t=new y,n=new Gi,i=new Re(1,1,1);t._onChange(function(){n.setFromEuler(t,!1)}),n._onChange(function(){t.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new fr},normalMatrix:{value:new Ai}}),this.matrix=new fr,this.matrixWorld=new fr,this.matrixAutoUpdate=Pt.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new E,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function Hn(){Pt.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Pt.DefaultUp=new Re(0,1,0),Pt.DefaultMatrixAutoUpdate=!0,Pt.prototype=Object.assign(Object.create(ka.prototype),{constructor:Pt,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return de.setFromAxisAngle(e,t),this.quaternion.multiply(de),this},rotateOnWorldAxis:function(e,t){return de.setFromAxisAngle(e,t),this.quaternion.premultiply(de),this},rotateX:function(e){return this.rotateOnAxis(rt,e)},rotateY:function(e){return this.rotateOnAxis(ft,e)},rotateZ:function(e){return this.rotateOnAxis(ct,e)},translateOnAxis:function(e,t){return re.copy(e).applyQuaternion(this.quaternion),this.position.add(re.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(rt,e)},translateY:function(e){return this.translateOnAxis(ft,e)},translateZ:function(e){return this.translateOnAxis(ct,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(fe.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?_e.copy(e):_e.set(e,t,n);var i=this.parent;this.updateWorldMatrix(!0,!1),Me.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?fe.lookAt(Me,_e,this.up):fe.lookAt(_e,Me,this.up),this.quaternion.setFromRotationMatrix(fe),i&&(fe.extractRotation(i.matrixWorld),de.setFromRotationMatrix(fe),this.quaternion.premultiply(de.inverse()))},add:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),(e.parent=this).children.push(e),e.dispatchEvent(Lt)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this},remove:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(kn)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),fe.getInverse(this.matrixWorld),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),fe.multiply(e.parent.matrixWorld)),e.applyMatrix4(fe),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,i=this.children.length;n<i;n++){var l=this.children[n].getObjectByProperty(e,t);if(l!==void 0)return l}},getWorldPosition:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new Re),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new Gi),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Me,e,Se),e},getWorldScale:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new Re),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Me,Ve,e),e},getWorldDirection:function(e){e===void 0&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new Re),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e=!(this.matrixWorldNeedsUpdate=!1));for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0)for(var i=this.children,l=0,d=i.length;l<d;l++)i[l].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function l(ye,Ae){return ye[Ae.uuid]===void 0&&(ye[Ae.uuid]=Ae.toJSON(e)),Ae.uuid}if(i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){i.geometry=l(e.geometries,this.geometry);var d=this.geometry.parameters;if(d!==void 0&&d.shapes!==void 0){var m=d.shapes;if(Array.isArray(m))for(var x=0,L=m.length;x<L;x++){var j=m[x];l(e.shapes,j)}else l(e.shapes,m)}}if(this.material!==void 0)if(Array.isArray(this.material)){var Z=[];for(x=0,L=this.material.length;x<L;x++)Z.push(l(e.materials,this.material[x]));i.material=Z}else i.material=l(e.materials,this.material);if(0<this.children.length)for(i.children=[],x=0;x<this.children.length;x++)i.children.push(this.children[x].toJSON(e).object);if(t){var ee=me(e.geometries),ie=me(e.materials),z=me(e.textures),he=me(e.images);m=me(e.shapes),0<ee.length&&(n.geometries=ee),0<ie.length&&(n.materials=ie),0<z.length&&(n.textures=z),0<he.length&&(n.images=he),0<m.length&&(n.shapes=m)}return n.object=i,n;function me(ye){var Ae=[];for(var Le in ye){var Ge=ye[Le];delete Ge.metadata,Ae.push(Ge)}return Ae}},clone:function(e){return new this.constructor().copy(this,e)},copy:function(e,t){if(t===void 0&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(var n=0;n<e.children.length;n++){var i=e.children[n];this.add(i.clone())}return this}}),Hn.prototype=Object.assign(Object.create(Pt.prototype),{constructor:Hn,isScene:!0,copy:function(e,t){return Pt.prototype.copy.call(this,e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=Pt.prototype.toJSON.call(this,e);return this.background!==null&&(t.object.background=this.background.toJSON(e)),this.environment!==null&&(t.object.environment=this.environment.toJSON(e)),this.fog!==null&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Yr=[new Re,new Re,new Re,new Re,new Re,new Re,new Re,new Re],zr=new Re,ca=new Ki,Ta=new Re,dr=new Re,Ca=new Re,vr=new Re,Wn=new Re,lo=new Re,Uo=new Re,ua=new Re,Ho=new Re,Sa=new Re;function Ki(e,t){this.min=e!==void 0?e:new Re(1/0,1/0,1/0),this.max=t!==void 0?t:new Re(-1/0,-1/0,-1/0)}function co(e,t,n,i,l){var d,m;for(d=0,m=e.length-3;d<=m;d+=3){Sa.fromArray(e,d);var x=l.x*Math.abs(Sa.x)+l.y*Math.abs(Sa.y)+l.z*Math.abs(Sa.z),L=t.dot(Sa),j=n.dot(Sa),Z=i.dot(Sa);if(Math.max(-Math.max(L,j,Z),Math.min(L,j,Z))>x)return!1}return!0}Object.assign(Ki.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,i=1/0,l=-1/0,d=-1/0,m=-1/0,x=0,L=e.length;x<L;x+=3){var j=e[x],Z=e[x+1],ee=e[x+2];j<t&&(t=j),Z<n&&(n=Z),ee<i&&(i=ee),l<j&&(l=j),d<Z&&(d=Z),m<ee&&(m=ee)}return this.min.set(t,n,i),this.max.set(l,d,m),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,i=1/0,l=-1/0,d=-1/0,m=-1/0,x=0,L=e.count;x<L;x++){var j=e.getX(x),Z=e.getY(x),ee=e.getZ(x);j<t&&(t=j),Z<n&&(n=Z),ee<i&&(i=ee),l<j&&(l=j),d<Z&&(d=Z),m<ee&&(m=ee)}return this.min.set(t,n,i),this.max.set(l,d,m),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=zr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.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(e){return e===void 0&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new Re),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return e===void 0&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new Re),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;t!==void 0&&(t.boundingBox===null&&t.computeBoundingBox(),ca.copy(t.boundingBox),ca.applyMatrix4(e.matrixWorld),this.expandByPoint(ca.min),this.expandByPoint(ca.max));for(var n=e.children,i=0,l=n.length;i<l;i++)this.expandByObject(n[i]);return this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return t===void 0&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Re),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,zr),zr.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n;return n=0<e.normal.x?(t=e.normal.x*this.min.x,e.normal.x*this.max.x):(t=e.normal.x*this.max.x,e.normal.x*this.min.x),0<e.normal.y?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),0<e.normal.z?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(Uo),ua.subVectors(this.max,Uo),Ta.subVectors(e.a,Uo),dr.subVectors(e.b,Uo),Ca.subVectors(e.c,Uo),vr.subVectors(dr,Ta),Wn.subVectors(Ca,dr),lo.subVectors(Ta,Ca);var t=[0,-vr.z,vr.y,0,-Wn.z,Wn.y,0,-lo.z,lo.y,vr.z,0,-vr.x,Wn.z,0,-Wn.x,lo.z,0,-lo.x,-vr.y,vr.x,0,-Wn.y,Wn.x,0,-lo.y,lo.x,0];return!!co(t,Ta,dr,Ca,ua)&&!!co(t=[1,0,0,0,1,0,0,0,1],Ta,dr,Ca,ua)&&(Ho.crossVectors(vr,Wn),co(t=[Ho.x,Ho.y,Ho.z],Ta,dr,Ca,ua))},clampPoint:function(e,t){return t===void 0&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Re),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return zr.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return e===void 0&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(zr).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()||(Yr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Yr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Yr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Yr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Yr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Yr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Yr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Yr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Yr)),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var zi=new Ki;function Zr(e,t){this.center=e!==void 0?e:new Re,this.radius=t!==void 0?t:0}Object.assign(Zr.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;t!==void 0?n.copy(t):zi.setFromPoints(e).getCenter(n);for(var i=0,l=0,d=e.length;l<d;l++)i=Math.max(i,n.distanceToSquared(e[l]));return this.radius=Math.sqrt(i),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return t===void 0&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new Re),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return e===void 0&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Ki),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var Kr=new Re,Li=new Re,Ha=new Re,bi=new Re,Jn=new Re,li=new Re,ri=new Re;function Pr(e,t){this.origin=e!==void 0?e:new Re,this.direction=t!==void 0?t:new Re(0,0,-1)}Object.assign(Pr.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return t===void 0&&(console.warn("THREE.Ray: .at() target is now required"),t=new Re),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,Kr)),this},closestPointToPoint:function(e,t){t===void 0&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Re),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=Kr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Kr.copy(this.direction).multiplyScalar(t).add(this.origin),Kr.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,i){Li.copy(e).add(t).multiplyScalar(.5),Ha.copy(t).sub(e).normalize(),bi.copy(this.origin).sub(Li);var l,d,m,x,L=.5*e.distanceTo(t),j=-this.direction.dot(Ha),Z=bi.dot(this.direction),ee=-bi.dot(Ha),ie=bi.lengthSq(),z=Math.abs(1-j*j);if(0<z)if(d=j*Z-ee,x=L*z,0<=(l=j*ee-Z))if(-x<=d)if(d<=x){var he=1/z;m=(l*=he)*(l+j*(d*=he)+2*Z)+d*(j*l+d+2*ee)+ie}else d=L,m=-(l=Math.max(0,-(j*d+Z)))*l+d*(d+2*ee)+ie;else d=-L,m=-(l=Math.max(0,-(j*d+Z)))*l+d*(d+2*ee)+ie;else m=d<=-x?-(l=Math.max(0,-(-j*L+Z)))*l+(d=0<l?-L:Math.min(Math.max(-L,-ee),L))*(d+2*ee)+ie:d<=x?(l=0,(d=Math.min(Math.max(-L,-ee),L))*(d+2*ee)+ie):-(l=Math.max(0,-(j*L+Z)))*l+(d=0<l?L:Math.min(Math.max(-L,-ee),L))*(d+2*ee)+ie;else d=0<j?-L:L,m=-(l=Math.max(0,-(j*d+Z)))*l+d*(d+2*ee)+ie;return n&&n.copy(this.direction).multiplyScalar(l).add(this.origin),i&&i.copy(Ha).multiplyScalar(d).add(Li),m},intersectSphere:function(e,t){Kr.subVectors(e.center,this.origin);var n=Kr.dot(this.direction),i=Kr.dot(Kr)-n*n,l=e.radius*e.radius;if(l<i)return null;var d=Math.sqrt(l-i),m=n-d,x=n+d;return m<0&&x<0?null:m<0?this.at(x,t):this.at(m,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return 0<=n?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return n===null?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,i,l,d,m,x,L=1/this.direction.x,j=1/this.direction.y,Z=1/this.direction.z,ee=this.origin;return i=0<=L?(n=(e.min.x-ee.x)*L,(e.max.x-ee.x)*L):(n=(e.max.x-ee.x)*L,(e.min.x-ee.x)*L),(d=0<=j?(l=(e.min.y-ee.y)*j,(e.max.y-ee.y)*j):(l=(e.max.y-ee.y)*j,(e.min.y-ee.y)*j))<n||i<l?null:((n<l||n!=n)&&(n=l),(d<i||i!=i)&&(i=d),(x=0<=Z?(m=(e.min.z-ee.z)*Z,(e.max.z-ee.z)*Z):(m=(e.max.z-ee.z)*Z,(e.min.z-ee.z)*Z))<n||i<m?null:((n<m||n!=n)&&(n=m),(x<i||i!=i)&&(i=x),i<0?null:this.at(0<=n?n:i,t)))},intersectsBox:function(e){return this.intersectBox(e,Kr)!==null},intersectTriangle:function(e,t,n,i,l){Jn.subVectors(t,e),li.subVectors(n,e),ri.crossVectors(Jn,li);var d,m=this.direction.dot(ri);if(0<m){if(i)return null;d=1}else{if(!(m<0))return null;d=-1,m=-m}bi.subVectors(this.origin,e);var x=d*this.direction.dot(li.crossVectors(bi,li));if(x<0)return null;var L=d*this.direction.dot(Jn.cross(bi));if(L<0||m<x+L)return null;var j=-d*bi.dot(ri);return j<0?null:this.at(j/m,l)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var Da=new Re,_s=new Re,Cl=new Ai;function ia(e,t){this.normal=e!==void 0?e:new Re(1,0,0),this.constant=t!==void 0?t:0}Object.assign(ia.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var i=Da.subVectors(n,t).cross(_s.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return t===void 0&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new Re),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){t===void 0&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new Re);var n=e.delta(Da),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):void 0;var l=-(e.start.dot(this.normal)+this.constant)/i;return l<0||1<l?void 0:t.copy(n).multiplyScalar(l).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&0<n||n<0&&0<t},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return e===void 0&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Re),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||Cl.getNormalMatrix(e),i=this.coplanarPoint(Da).applyMatrix4(e),l=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(l),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var ha=new Re,Ui=new Re,Ts=new Re,Wa=new Re,bo=new Re,Oo=new Re,Sl=new Re,di=new Re,Ii=new Re,Js=new Re;function ki(e,t,n){this.a=e!==void 0?e:new Re,this.b=t!==void 0?t:new Re,this.c=n!==void 0?n:new Re}Object.assign(ki,{getNormal:function(e,t,n,i){i===void 0&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Re),i.subVectors(n,t),ha.subVectors(e,t),i.cross(ha);var l=i.lengthSq();return 0<l?i.multiplyScalar(1/Math.sqrt(l)):i.set(0,0,0)},getBarycoord:function(e,t,n,i,l){ha.subVectors(i,t),Ui.subVectors(n,t),Ts.subVectors(e,t);var d=ha.dot(ha),m=ha.dot(Ui),x=ha.dot(Ts),L=Ui.dot(Ui),j=Ui.dot(Ts),Z=d*L-m*m;if(l===void 0&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),l=new Re),Z==0)return l.set(-2,-1,-1);var ee=1/Z,ie=(L*x-m*j)*ee,z=(d*j-m*x)*ee;return l.set(1-ie-z,z,ie)},containsPoint:function(e,t,n,i){return ki.getBarycoord(e,t,n,i,Wa),0<=Wa.x&&0<=Wa.y&&Wa.x+Wa.y<=1},getUV:function(e,t,n,i,l,d,m,x){return this.getBarycoord(e,t,n,i,Wa),x.set(0,0),x.addScaledVector(l,Wa.x),x.addScaledVector(d,Wa.y),x.addScaledVector(m,Wa.z),x},isFrontFacing:function(e,t,n,i){return ha.subVectors(n,t),Ui.subVectors(e,t),ha.cross(Ui).dot(i)<0}}),Object.assign(ki.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return ha.subVectors(this.c,this.b),Ui.subVectors(this.a,this.b),.5*ha.cross(Ui).length()},getMidpoint:function(e){return e===void 0&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Re),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return ki.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return e===void 0&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new ia),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return ki.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,i,l){return ki.getUV(e,this.a,this.b,this.c,t,n,i,l)},containsPoint:function(e){return ki.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return ki.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){t===void 0&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Re);var n,i,l=this.a,d=this.b,m=this.c;bo.subVectors(d,l),Oo.subVectors(m,l),di.subVectors(e,l);var x=bo.dot(di),L=Oo.dot(di);if(x<=0&&L<=0)return t.copy(l);Ii.subVectors(e,d);var j=bo.dot(Ii),Z=Oo.dot(Ii);if(0<=j&&Z<=j)return t.copy(d);var ee=x*Z-j*L;if(ee<=0&&0<=x&&j<=0)return n=x/(x-j),t.copy(l).addScaledVector(bo,n);Js.subVectors(e,m);var ie=bo.dot(Js),z=Oo.dot(Js);if(0<=z&&ie<=z)return t.copy(m);var he=ie*L-x*z;if(he<=0&&0<=L&&z<=0)return i=L/(L-z),t.copy(l).addScaledVector(Oo,i);var me=j*z-ie*Z;if(me<=0&&0<=Z-j&&0<=ie-z)return Sl.subVectors(m,d),i=(Z-j)/(Z-j+(ie-z)),t.copy(d).addScaledVector(Sl,i);var ye=1/(me+he+ee);return n=he*ye,i=ee*ye,t.copy(l).addScaledVector(bo,n).addScaledVector(Oo,i)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var Dl={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},ke={h:0,s:0,l:0},ot={h:0,s:0,l:0};function Qe(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}function Ct(e,t,n){return n<0&&(n+=1),1<n&&--n,n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function kt(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function mn(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function gn(e,t,n,i,l,d){this.a=e,this.b=t,this.c=n,this.normal=i&&i.isVector3?i:new Re,this.vertexNormals=Array.isArray(i)?i:[],this.color=l&&l.isColor?l:new Qe,this.vertexColors=Array.isArray(l)?l:[],this.materialIndex=d!==void 0?d:0}Object.assign(Qe.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=yr.euclideanModulo(e,1),t=yr.clamp(t,0,1),n=yr.clamp(n,0,1),t===0)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+t):n+t-n*t,l=2*n-i;this.r=Ct(l,i,e+1/3),this.g=Ct(l,i,e),this.b=Ct(l,i,e-1/3)}return this},setStyle:function(e){function t(ee){ee!==void 0&&parseFloat(ee)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i,l=n[1],d=n[2];switch(l){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)){var m=parseFloat(i[1])/360,x=parseInt(i[2],10)/100,L=parseInt(i[3],10)/100;return t(i[5]),this.setHSL(m,x,L)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var j=n[1],Z=j.length;if(Z===3)return this.r=parseInt(j.charAt(0)+j.charAt(0),16)/255,this.g=parseInt(j.charAt(1)+j.charAt(1),16)/255,this.b=parseInt(j.charAt(2)+j.charAt(2),16)/255,this;if(Z===6)return this.r=parseInt(j.charAt(0)+j.charAt(1),16)/255,this.g=parseInt(j.charAt(2)+j.charAt(3),16)/255,this.b=parseInt(j.charAt(4)+j.charAt(5),16)/255,this}return e&&0<e.length?this.setColorName(e):this},setColorName:function(e){var t=Dl[e];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return t===void 0&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){t===void 0&&(t=2);var n=0<t?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=kt(e.r),this.g=kt(e.g),this.b=kt(e.b),this},copyLinearToSRGB:function(e){return this.r=mn(e.r),this.g=mn(e.g),this.b=mn(e.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(e){e===void 0&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,i=this.r,l=this.g,d=this.b,m=Math.max(i,l,d),x=Math.min(i,l,d),L=(x+m)/2;if(x===m)n=t=0;else{var j=m-x;switch(n=L<=.5?j/(m+x):j/(2-m-x),m){case i:t=(l-d)/j+(l<d?6:0);break;case l:t=(d-i)/j+2;break;case d:t=(i-l)/j+4}t/=6}return e.h=t,e.s=n,e.l=L,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(ke),ke.h+=e,ke.s+=t,ke.l+=n,this.setHSL(ke.h,ke.s,ke.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:function(e,t){this.getHSL(ke),e.getHSL(ot);var n=yr.lerp(ke.h,ot.h,t),i=yr.lerp(ke.s,ot.s,t),l=yr.lerp(ke.l,ot.l,t);return this.setHSL(n,i,l),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return t===void 0&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),Qe.NAMES=Dl,Object.assign(gn.prototype,{clone:function(){return new this.constructor().copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Rn=0;function It(){Object.defineProperty(this,"id",{value:Rn++}),this.uuid=yr.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=_,this.side=A,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=F,this.opacity=1,this.transparent=!1,this.blendSrc=J,this.blendDst=te,this.blendEquation=C,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=oe,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=zs,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=so,this.stencilZFail=so,this.stencilZPass=so,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 _r(e){It.call(this),this.type="MeshBasicMaterial",this.color=new Qe(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=se,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(e)}It.prototype=Object.assign(Object.create(ka.prototype),{constructor:It,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(e!==void 0)for(var t in e){var n=e[t];if(n!==void 0)if(t!=="shading"){var i=this[t];i!==void 0?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===1;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(m){var x=[];for(var L in m){var j=m[L];delete j.metadata,x.push(j)}return x}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()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(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&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,this.combine!==void 0&&(n.combine=this.combine),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.size!==void 0&&(n.size=this.size),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==_&&(n.blending=this.blending),this.flatShading===!0&&(n.flatShading=this.flatShading),this.side!==A&&(n.side=this.side),this.vertexColors!==F&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(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&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),0<this.alphaTest&&(n.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.morphNormals===!0&&(n.morphNormals=!0),this.skinning===!0&&(n.skinning=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),t){var l=i(e.textures),d=i(e.images);0<l.length&&(n.textures=l),0<d.length&&(n.images=d)}return n},clone:function(){return new this.constructor().copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(t!==null){var i=t.length;n=new Array(i);for(var l=0;l!==i;++l)n[l]=t[l].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(It.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),((_r.prototype=Object.create(It.prototype)).constructor=_r).prototype.isMeshBasicMaterial=!0,_r.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var Tn=new Re;function Qt(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n===!0,this.usage=Wr,this.updateRange={offset:0,count:-1},this.version=0}function Rr(e,t,n){Qt.call(this,new Int8Array(e),t,n)}function tr(e,t,n){Qt.call(this,new Uint8Array(e),t,n)}function ci(e,t,n){Qt.call(this,new Uint8ClampedArray(e),t,n)}function Mi(e,t,n){Qt.call(this,new Int16Array(e),t,n)}function pi(e,t,n){Qt.call(this,new Uint16Array(e),t,n)}function we(e,t,n){Qt.call(this,new Int32Array(e),t,n)}function _i(e,t,n){Qt.call(this,new Uint32Array(e),t,n)}function an(e,t,n){Qt.call(this,new Float32Array(e),t,n)}function Cr(e,t,n){Qt.call(this,new Float64Array(e),t,n)}function xr(){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 $i(e){if(e.length===0)return-1/0;for(var t=e[0],n=1,i=e.length;n<i;++n)e[n]>t&&(t=e[n]);return t}Object.defineProperty(Qt.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),Object.assign(Qt.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var i=0,l=this.itemSize;i<l;i++)this.array[e+i]=t.array[n+i];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,i=0,l=e.length;i<l;i++){var d=e[i];d===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),d=new Qe),t[n++]=d.r,t[n++]=d.g,t[n++]=d.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,i=0,l=e.length;i<l;i++){var d=e[i];d===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),d=new zt),t[n++]=d.x,t[n++]=d.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,i=0,l=e.length;i<l;i++){var d=e[i];d===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),d=new Re),t[n++]=d.x,t[n++]=d.y,t[n++]=d.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,i=0,l=e.length;i<l;i++){var d=e[i];d===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),d=new Jr),t[n++]=d.x,t[n++]=d.y,t[n++]=d.z,t[n++]=d.w}return this},applyMatrix3:function(e){for(var t=0,n=this.count;t<n;t++)Tn.x=this.getX(t),Tn.y=this.getY(t),Tn.z=this.getZ(t),Tn.applyMatrix3(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)Tn.x=this.getX(t),Tn.y=this.getY(t),Tn.z=this.getZ(t),Tn.applyMatrix4(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)Tn.x=this.getX(t),Tn.y=this.getY(t),Tn.z=this.getZ(t),Tn.applyNormalMatrix(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)Tn.x=this.getX(t),Tn.y=this.getY(t),Tn.z=this.getZ(t),Tn.transformDirection(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this},set:function(e,t){return t===void 0&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.itemSize<3?0:this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this},setXYZW:function(e,t,n,i,l){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=l,this},onUpload:function(e){return this.onUploadCallback=e,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}}}),(Rr.prototype=Object.create(Qt.prototype)).constructor=Rr,(tr.prototype=Object.create(Qt.prototype)).constructor=tr,(ci.prototype=Object.create(Qt.prototype)).constructor=ci,(Mi.prototype=Object.create(Qt.prototype)).constructor=Mi,(pi.prototype=Object.create(Qt.prototype)).constructor=pi,(we.prototype=Object.create(Qt.prototype)).constructor=we,(_i.prototype=Object.create(Qt.prototype)).constructor=_i,(an.prototype=Object.create(Qt.prototype)).constructor=an,(Cr.prototype=Object.create(Qt.prototype)).constructor=Cr,Object.assign(xr.prototype,{computeGroups:function(e){for(var t,n=[],i=void 0,l=e.faces,d=0;d<l.length;d++){var m=l[d];m.materialIndex!==i&&(i=m.materialIndex,t!==void 0&&(t.count=3*d-t.start,n.push(t)),t={start:3*d,materialIndex:i})}t!==void 0&&(t.count=3*d-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,i=e.vertices,l=e.faceVertexUvs,d=l[0]&&0<l[0].length,m=l[1]&&0<l[1].length,x=e.morphTargets,L=x.length;if(0<L){t=[];for(var j=0;j<L;j++)t[j]={name:x[j].name,data:[]};this.morphTargets.position=t}var Z,ee=e.morphNormals,ie=ee.length;if(0<ie){for(Z=[],j=0;j<ie;j++)Z[j]={name:ee[j].name,data:[]};this.morphTargets.normal=Z}var z=e.skinIndices,he=e.skinWeights,me=z.length===i.length,ye=he.length===i.length;for(0<i.length&&n.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),j=0;j<n.length;j++){var Ae=n[j];this.vertices.push(i[Ae.a],i[Ae.b],i[Ae.c]);var Le=Ae.vertexNormals;if(Le.length===3)this.normals.push(Le[0],Le[1],Le[2]);else{var Ge=Ae.normal;this.normals.push(Ge,Ge,Ge)}var et,Fe=Ae.vertexColors;if(Fe.length===3)this.colors.push(Fe[0],Fe[1],Fe[2]);else{var at=Ae.color;this.colors.push(at,at,at)}d===!0&&((et=l[0][j])!==void 0?this.uvs.push(et[0],et[1],et[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",j),this.uvs.push(new zt,new zt,new zt))),m===!0&&((et=l[1][j])!==void 0?this.uvs2.push(et[0],et[1],et[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",j),this.uvs2.push(new zt,new zt,new zt)));for(var Je=0;Je<L;Je++){var xt=x[Je].vertices;t[Je].data.push(xt[Ae.a],xt[Ae.b],xt[Ae.c])}for(Je=0;Je<ie;Je++){var Tt=ee[Je].vertexNormals[j];Z[Je].data.push(Tt.a,Tt.b,Tt.c)}me&&this.skinIndices.push(z[Ae.a],z[Ae.b],z[Ae.c]),ye&&this.skinWeights.push(he[Ae.a],he[Ae.b],he[Ae.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this}});var Ja=2147483647,Hi=new fr,Mo=new Pt,da=new Re,qa=new Ki,El=new Ki,ji=new Re;function Cn(){Object.defineProperty(this,"id",{value:Ja+=2}),this.uuid=yr.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={}}Cn.prototype=Object.assign(Object.create(ka.prototype),{constructor:Cn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(65535<$i(e)?_i:pi)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:n!==void 0?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(n!==void 0){var i=new Ai().getNormalMatrix(e);n.applyNormalMatrix(i),n.needsUpdate=!0}var l=this.attributes.tangent;return l!==void 0&&(l.transformDirection(e),l.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},rotateX:function(e){return Hi.makeRotationX(e),this.applyMatrix4(Hi),this},rotateY:function(e){return Hi.makeRotationY(e),this.applyMatrix4(Hi),this},rotateZ:function(e){return Hi.makeRotationZ(e),this.applyMatrix4(Hi),this},translate:function(e,t,n){return Hi.makeTranslation(e,t,n),this.applyMatrix4(Hi),this},scale:function(e,t,n){return Hi.makeScale(e,t,n),this.applyMatrix4(Hi),this},lookAt:function(e){return Mo.lookAt(e),Mo.updateMatrix(),this.applyMatrix4(Mo.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(da).negate(),this.translate(da.x,da.y,da.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new an(3*t.vertices.length,3),i=new an(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",i.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var l=new an(t.lineDistances.length,1);this.setAttribute("lineDistance",l.copyArray(t.lineDistances))}t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,i=e.length;n<i;n++){var l=e[n];t.push(l.x,l.y,l.z||0)}return this.setAttribute("position",new an(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var i=n.__directGeometry;if(n.elementsNeedUpdate===!0&&(i=void 0,n.elementsNeedUpdate=!1),i===void 0)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return n.verticesNeedUpdate===!0&&((t=this.attributes.position)!==void 0&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),n.normalsNeedUpdate===!0&&((t=this.attributes.normal)!==void 0&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),n.colorsNeedUpdate===!0&&((t=this.attributes.color)!==void 0&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&((t=this.attributes.uv)!==void 0&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&((t=this.attributes.lineDistance)!==void 0&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=new xr().fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new Qt(t,3).copyVector3sArray(e.vertices)),0<e.normals.length){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new Qt(n,3).copyVector3sArray(e.normals))}if(0<e.colors.length){var i=new Float32Array(3*e.colors.length);this.setAttribute("color",new Qt(i,3).copyColorsArray(e.colors))}if(0<e.uvs.length){var l=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new Qt(l,2).copyVector2sArray(e.uvs))}if(0<e.uvs2.length){var d=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new Qt(d,2).copyVector2sArray(e.uvs2))}for(var m in this.groups=e.groups,e.morphTargets){for(var x=[],L=e.morphTargets[m],j=0,Z=L.length;j<Z;j++){var ee=L[j],ie=new an(3*ee.data.length,3);ie.name=ee.name,x.push(ie.copyVector3sArray(ee.data))}this.morphAttributes[m]=x}if(0<e.skinIndices.length){var z=new an(4*e.skinIndices.length,4);this.setAttribute("skinIndex",z.copyVector4sArray(e.skinIndices))}if(0<e.skinWeights.length){var he=new an(4*e.skinWeights.length,4);this.setAttribute("skinWeight",he.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new Ki);var e=this.attributes.position,t=this.morphAttributes.position;if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,i=t.length;n<i;n++){var l=t[n];qa.setFromBufferAttribute(l),this.morphTargetsRelative?(ji.addVectors(this.boundingBox.min,qa.min),this.boundingBox.expandByPoint(ji),ji.addVectors(this.boundingBox.max,qa.max),this.boundingBox.expandByPoint(ji)):(this.boundingBox.expandByPoint(qa.min),this.boundingBox.expandByPoint(qa.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(){this.boundingSphere===null&&(this.boundingSphere=new Zr);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(qa.setFromBufferAttribute(e),t)for(var i=0,l=t.length;i<l;i++){var d=t[i];El.setFromBufferAttribute(d),this.morphTargetsRelative?(ji.addVectors(qa.min,El.min),qa.expandByPoint(ji),ji.addVectors(qa.max,El.max),qa.expandByPoint(ji)):(qa.expandByPoint(El.min),qa.expandByPoint(El.max))}qa.getCenter(n);var m=0;for(i=0,l=e.count;i<l;i++)ji.fromBufferAttribute(e,i),m=Math.max(m,n.distanceToSquared(ji));if(t)for(i=0,l=t.length;i<l;i++){d=t[i];for(var x=this.morphTargetsRelative,L=0,j=d.count;L<j;L++)ji.fromBufferAttribute(d,L),x&&(da.fromBufferAttribute(e,L),ji.add(da)),m=Math.max(m,n.distanceToSquared(ji))}this.boundingSphere.radius=Math.sqrt(m),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 e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(t.normal===void 0)this.setAttribute("normal",new Qt(new Float32Array(n.length),3));else for(var i=t.normal.array,l=0,d=i.length;l<d;l++)i[l]=0;var m,x,L,j=t.normal.array,Z=new Re,ee=new Re,ie=new Re,z=new Re,he=new Re;if(e){var me=e.array;for(l=0,d=e.count;l<d;l+=3)m=3*me[l+0],x=3*me[l+1],L=3*me[l+2],Z.fromArray(n,m),ee.fromArray(n,x),ie.fromArray(n,L),z.subVectors(ie,ee),he.subVectors(Z,ee),z.cross(he),j[m]+=z.x,j[1+m]+=z.y,j[2+m]+=z.z,j[x]+=z.x,j[1+x]+=z.y,j[2+x]+=z.z,j[L]+=z.x,j[1+L]+=z.y,j[2+L]+=z.z}else for(l=0,d=n.length;l<d;l+=9)Z.fromArray(n,l),ee.fromArray(n,l+3),ie.fromArray(n,l+6),z.subVectors(ie,ee),he.subVectors(Z,ee),z.cross(he),j[l]=z.x,j[l+1]=z.y,j[l+2]=z.z,j[l+3]=z.x,j[l+4]=z.y,j[l+5]=z.z,j[l+6]=z.x,j[l+7]=z.y,j[l+8]=z.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){t===void 0&&(t=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 i in n)if(e.attributes[i]!==void 0)for(var l=n[i].array,d=e.attributes[i],m=d.array,x=d.itemSize*t,L=Math.min(m.length,l.length-x),j=0,Z=x;j<L;j++,Z++)l[Z]=m[j];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)ji.x=e.getX(t),ji.y=e.getY(t),ji.z=e.getZ(t),ji.normalize(),e.setXYZ(t,ji.x,ji.y,ji.z)},toNonIndexed:function(){function e(he,me){for(var ye=he.array,Ae=he.itemSize,Le=new ye.constructor(me.length*Ae),Ge=0,et=0,Fe=0,at=me.length;Fe<at;Fe++){Ge=me[Fe]*Ae;for(var Je=0;Je<Ae;Je++)Le[et++]=ye[Ge++]}return new Qt(Le,Ae)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new Cn,n=this.index.array,i=this.attributes;for(var l in i){var d=e(i[l],n);t.setAttribute(l,d)}var m=this.morphAttributes;for(l in m){for(var x=[],L=m[l],j=0,Z=L.length;j<Z;j++)d=e(L[j],n),x.push(d);t.morphAttributes[l]=x}t.morphTargetsRelative=this.morphTargetsRelative;for(var ee=this.groups,ie=(j=0,ee.length);j<ie;j++){var z=ee[j];t.addGroup(z.start,z.count,z.materialIndex)}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),0<Object.keys(this.userData).length&&(e.userData=this.userData),this.parameters!==void 0){var t=this.parameters;for(var n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};var i=this.index;i!==null&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var l=this.attributes;for(var n in l){var d=(ie=l[n]).toJSON();ie.name!==""&&(d.name=ie.name),e.data.attributes[n]=d}var m={},x=!1;for(var n in this.morphAttributes){for(var L=this.morphAttributes[n],j=[],Z=0,ee=L.length;Z<ee;Z++){var ie;d=(ie=L[Z]).toJSON(),ie.name!==""&&(d.name=ie.name),j.push(d)}0<j.length&&(m[n]=j,x=!0)}x&&(e.data.morphAttributes=m,e.data.morphTargetsRelative=this.morphTargetsRelative);var z=this.groups;0<z.length&&(e.data.groups=JSON.parse(JSON.stringify(z)));var he=this.boundingSphere;return he!==null&&(e.data.boundingSphere={center:he.center.toArray(),radius:he.radius}),e},clone:function(){return new Cn().copy(this)},copy:function(e){var t,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var l=e.index;l!==null&&this.setIndex(l.clone());var d=e.attributes;for(t in d){var m=d[t];this.setAttribute(t,m.clone())}var x=e.morphAttributes;for(t in x){var L=[],j=x[t];for(n=0,i=j.length;n<i;n++)L.push(j[n].clone());this.morphAttributes[t]=L}this.morphTargetsRelative=e.morphTargetsRelative;var Z=e.groups;for(n=0,i=Z.length;n<i;n++){var ee=Z[n];this.addGroup(ee.start,ee.count,ee.materialIndex)}var ie=e.boundingBox;ie!==null&&(this.boundingBox=ie.clone());var z=e.boundingSphere;return z!==null&&(this.boundingSphere=z.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var sc=new fr,qs=new Pr,hu=new Zr,ja=new Re,as=new Re,uo=new Re,Xa=new Re,du=new Re,pu=new Re,Cs=new Re,Po=new Re,lc=new Re,Al=new zt,os=new zt,Xs=new zt,Wi=new Re,Ol=new Re;function Ti(e,t){Pt.call(this),this.type="Mesh",this.geometry=e!==void 0?e:new Cn,this.material=t!==void 0?t:new _r,this.updateMorphTargets()}function Ro(e,t,n,i,l,d,m,x){if((t.side===M?i.intersectTriangle(m,d,l,!0,x):i.intersectTriangle(l,d,m,t.side!==N,x))===null)return null;Ol.copy(x),Ol.applyMatrix4(e.matrixWorld);var L=n.ray.origin.distanceTo(Ol);return L<n.near||L>n.far?null:{distance:L,point:Ol.clone(),object:e}}function Pl(e,t,n,i,l,d,m,x,L,j,Z,ee){ja.fromBufferAttribute(l,j),as.fromBufferAttribute(l,Z),uo.fromBufferAttribute(l,ee);var ie=e.morphTargetInfluences;if(t.morphTargets&&d&&ie){Cs.set(0,0,0),Po.set(0,0,0),lc.set(0,0,0);for(var z=0,he=d.length;z<he;z++){var me=ie[z],ye=d[z];me!==0&&(Xa.fromBufferAttribute(ye,j),du.fromBufferAttribute(ye,Z),pu.fromBufferAttribute(ye,ee),m?(Cs.addScaledVector(Xa,me),Po.addScaledVector(du,me),lc.addScaledVector(pu,me)):(Cs.addScaledVector(Xa.sub(ja),me),Po.addScaledVector(du.sub(as),me),lc.addScaledVector(pu.sub(uo),me)))}ja.add(Cs),as.add(Po),uo.add(lc)}var Ae=Ro(e,t,n,i,ja,as,uo,Wi);if(Ae){x&&(Al.fromBufferAttribute(x,j),os.fromBufferAttribute(x,Z),Xs.fromBufferAttribute(x,ee),Ae.uv=ki.getUV(Wi,ja,as,uo,Al,os,Xs,new zt)),L&&(Al.fromBufferAttribute(L,j),os.fromBufferAttribute(L,Z),Xs.fromBufferAttribute(L,ee),Ae.uv2=ki.getUV(Wi,ja,as,uo,Al,os,Xs,new zt));var Le=new gn(j,Z,ee);ki.getNormal(ja,as,uo,Le.normal),Ae.face=Le}return Ae}Ti.prototype=Object.assign(Object.create(Pt.prototype),{constructor:Ti,isMesh:!0,copy:function(e){return Pt.prototype.copy.call(this,e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var l=i.morphAttributes,d=Object.keys(l);if(0<d.length){var m=l[d[0]];if(m!==void 0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=m.length;e<t;e++)n=m[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var x=i.morphTargets;x!==void 0&&0<x.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,i=this.geometry,l=this.material,d=this.matrixWorld;if(l!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),hu.copy(i.boundingSphere),hu.applyMatrix4(d),e.ray.intersectsSphere(hu)!==!1&&(sc.getInverse(d),qs.copy(e.ray).applyMatrix4(sc),i.boundingBox===null||qs.intersectsBox(i.boundingBox)!==!1))){if(i.isBufferGeometry){var m,x,L,j,Z,ee,ie,z,he,me=i.index,ye=i.attributes.position,Ae=i.morphAttributes.position,Le=i.morphTargetsRelative,Ge=i.attributes.uv,et=i.attributes.uv2,Fe=i.groups,at=i.drawRange;if(me!==null)if(Array.isArray(l))for(j=0,ee=Fe.length;j<ee;j++)for(he=l[(z=Fe[j]).materialIndex],Z=Math.max(z.start,at.start),ie=Math.min(z.start+z.count,at.start+at.count);Z<ie;Z+=3)m=me.getX(Z),x=me.getX(Z+1),L=me.getX(Z+2),(n=Pl(this,he,e,qs,ye,Ae,Le,Ge,et,m,x,L))&&(n.faceIndex=Math.floor(Z/3),n.face.materialIndex=z.materialIndex,t.push(n));else for(j=Math.max(0,at.start),ee=Math.min(me.count,at.start+at.count);j<ee;j+=3)m=me.getX(j),x=me.getX(j+1),L=me.getX(j+2),(n=Pl(this,l,e,qs,ye,Ae,Le,Ge,et,m,x,L))&&(n.faceIndex=Math.floor(j/3),t.push(n));else if(ye!==void 0)if(Array.isArray(l))for(j=0,ee=Fe.length;j<ee;j++)for(he=l[(z=Fe[j]).materialIndex],Z=Math.max(z.start,at.start),ie=Math.min(z.start+z.count,at.start+at.count);Z<ie;Z+=3)(n=Pl(this,he,e,qs,ye,Ae,Le,Ge,et,m=Z,x=Z+1,L=Z+2))&&(n.faceIndex=Math.floor(Z/3),n.face.materialIndex=z.materialIndex,t.push(n));else for(j=Math.max(0,at.start),ee=Math.min(ye.count,at.start+at.count);j<ee;j+=3)(n=Pl(this,l,e,qs,ye,Ae,Le,Ge,et,m=j,x=j+1,L=j+2))&&(n.faceIndex=Math.floor(j/3),t.push(n))}else if(i.isGeometry){var Je,xt,Tt,Et,At=Array.isArray(l),Gt=i.vertices,Yt=i.faces,St=i.faceVertexUvs[0];0<St.length&&(Et=St);for(var _t=0,hn=Yt.length;_t<hn;_t++){var bn=Yt[_t],Kn=At?l[bn.materialIndex]:l;if(Kn!==void 0&&(Je=Gt[bn.a],xt=Gt[bn.b],Tt=Gt[bn.c],n=Ro(this,Kn,e,qs,Je,xt,Tt,Wi))){if(Et&&Et[_t]){var qn=Et[_t];Al.copy(qn[0]),os.copy(qn[1]),Xs.copy(qn[2]),n.uv=ki.getUV(Wi,Je,xt,Tt,Al,os,Xs,new zt)}n.face=bn,n.faceIndex=_t,t.push(n)}}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var fu=0,Pa=new fr,mu=new Pt,pa=new Re;function lr(){Object.defineProperty(this,"id",{value:fu+=2}),this.uuid=yr.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}lr.prototype=Object.assign(Object.create(ka.prototype),{constructor:lr,isGeometry:!0,applyMatrix4:function(e){for(var t=new Ai().getNormalMatrix(e),n=0,i=this.vertices.length;n<i;n++)this.vertices[n].applyMatrix4(e);for(n=0,i=this.faces.length;n<i;n++){var l=this.faces[n];l.normal.applyMatrix3(t).normalize();for(var d=0,m=l.vertexNormals.length;d<m;d++)l.vertexNormals[d].applyMatrix3(t).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return Pa.makeRotationX(e),this.applyMatrix4(Pa),this},rotateY:function(e){return Pa.makeRotationY(e),this.applyMatrix4(Pa),this},rotateZ:function(e){return Pa.makeRotationZ(e),this.applyMatrix4(Pa),this},translate:function(e,t,n){return Pa.makeTranslation(e,t,n),this.applyMatrix4(Pa),this},scale:function(e,t,n){return Pa.makeScale(e,t,n),this.applyMatrix4(Pa),this},lookAt:function(e){return mu.lookAt(e),mu.updateMatrix(),this.applyMatrix4(mu.matrix),this},fromBufferGeometry:function(e){var t=this,n=e.index!==null?e.index.array:void 0,i=e.attributes;if(i.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var l=i.position.array,d=i.normal!==void 0?i.normal.array:void 0,m=i.color!==void 0?i.color.array:void 0,x=i.uv!==void 0?i.uv.array:void 0,L=i.uv2!==void 0?i.uv2.array:void 0;L!==void 0&&(this.faceVertexUvs[1]=[]);for(var j=0;j<l.length;j+=3)t.vertices.push(new Re().fromArray(l,j)),m!==void 0&&t.colors.push(new Qe().fromArray(m,j));function Z(ye,Ae,Le,Ge){var et=m===void 0?[]:[t.colors[ye].clone(),t.colors[Ae].clone(),t.colors[Le].clone()],Fe=new gn(ye,Ae,Le,d===void 0?[]:[new Re().fromArray(d,3*ye),new Re().fromArray(d,3*Ae),new Re().fromArray(d,3*Le)],et,Ge);t.faces.push(Fe),x!==void 0&&t.faceVertexUvs[0].push([new zt().fromArray(x,2*ye),new zt().fromArray(x,2*Ae),new zt().fromArray(x,2*Le)]),L!==void 0&&t.faceVertexUvs[1].push([new zt().fromArray(L,2*ye),new zt().fromArray(L,2*Ae),new zt().fromArray(L,2*Le)])}var ee=e.groups;if(0<ee.length)for(j=0;j<ee.length;j++)for(var ie=ee[j],z=ie.start,he=z,me=z+ie.count;he<me;he+=3)n!==void 0?Z(n[he],n[he+1],n[he+2],ie.materialIndex):Z(he,he+1,he+2,ie.materialIndex);else if(n!==void 0)for(j=0;j<n.length;j+=3)Z(n[j],n[j+1],n[j+2]);else for(j=0;j<l.length/3;j+=3)Z(j,j+1,j+2);return this.computeFaceNormals(),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(pa).negate(),this.translate(pa.x,pa.y,pa.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=t===0?1:1/t,i=new fr;return i.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(i),this},computeFaceNormals:function(){for(var e=new Re,t=new Re,n=0,i=this.faces.length;n<i;n++){var l=this.faces[n],d=this.vertices[l.a],m=this.vertices[l.b],x=this.vertices[l.c];e.subVectors(x,m),t.subVectors(d,m),e.cross(t),e.normalize(),l.normal.copy(e)}},computeVertexNormals:function(e){var t,n,i,l,d,m;for(e===void 0&&(e=!0),m=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)m[t]=new Re;if(e){var x,L,j,Z=new Re,ee=new Re;for(i=0,l=this.faces.length;i<l;i++)d=this.faces[i],x=this.vertices[d.a],L=this.vertices[d.b],j=this.vertices[d.c],Z.subVectors(j,L),ee.subVectors(x,L),Z.cross(ee),m[d.a].add(Z),m[d.b].add(Z),m[d.c].add(Z)}else for(this.computeFaceNormals(),i=0,l=this.faces.length;i<l;i++)m[(d=this.faces[i]).a].add(d.normal),m[d.b].add(d.normal),m[d.c].add(d.normal);for(t=0,n=this.vertices.length;t<n;t++)m[t].normalize();for(i=0,l=this.faces.length;i<l;i++){var ie=(d=this.faces[i]).vertexNormals;ie.length===3?(ie[0].copy(m[d.a]),ie[1].copy(m[d.b]),ie[2].copy(m[d.c])):(ie[0]=m[d.a].clone(),ie[1]=m[d.b].clone(),ie[2]=m[d.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var i=(n=this.faces[e]).vertexNormals;i.length===3?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,i,l;for(n=0,i=this.faces.length;n<i;n++)for((l=this.faces[n]).__originalFaceNormal?l.__originalFaceNormal.copy(l.normal):l.__originalFaceNormal=l.normal.clone(),l.__originalVertexNormals||(l.__originalVertexNormals=[]),e=0,t=l.vertexNormals.length;e<t;e++)l.__originalVertexNormals[e]?l.__originalVertexNormals[e].copy(l.vertexNormals[e]):l.__originalVertexNormals[e]=l.vertexNormals[e].clone();var d=new lr;for(d.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var m=this.morphNormals[e].faceNormals,x=this.morphNormals[e].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)L=new Re,j={a:new Re,b:new Re,c:new Re},m.push(L),x.push(j)}var L,j,Z=this.morphNormals[e];for(d.vertices=this.morphTargets[e].vertices,d.computeFaceNormals(),d.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)l=this.faces[n],L=Z.faceNormals[n],j=Z.vertexNormals[n],L.copy(l.normal),j.a.copy(l.vertexNormals[0]),j.b.copy(l.vertexNormals[1]),j.c.copy(l.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(l=this.faces[n]).normal=l.__originalFaceNormal,l.vertexNormals=l.__originalVertexNormals},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new Ki),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new Zr),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var i,l=this.vertices.length,d=this.vertices,m=e.vertices,x=this.faces,L=e.faces,j=this.colors,Z=e.colors;n===void 0&&(n=0),t!==void 0&&(i=new Ai().getNormalMatrix(t));for(var ee=0,ie=m.length;ee<ie;ee++){var z=m[ee].clone();t!==void 0&&z.applyMatrix4(t),d.push(z)}for(ee=0,ie=Z.length;ee<ie;ee++)j.push(Z[ee].clone());for(ee=0,ie=L.length;ee<ie;ee++){var he,me,ye,Ae=L[ee],Le=Ae.vertexNormals,Ge=Ae.vertexColors;(he=new gn(Ae.a+l,Ae.b+l,Ae.c+l)).normal.copy(Ae.normal),i!==void 0&&he.normal.applyMatrix3(i).normalize();for(var et=0,Fe=Le.length;et<Fe;et++)me=Le[et].clone(),i!==void 0&&me.applyMatrix3(i).normalize(),he.vertexNormals.push(me);for(he.color.copy(Ae.color),et=0,Fe=Ge.length;et<Fe;et++)ye=Ge[et],he.vertexColors.push(ye.clone());he.materialIndex=Ae.materialIndex+n,x.push(he)}for(ee=0,ie=e.faceVertexUvs.length;ee<ie;ee++){var at=e.faceVertexUvs[ee];for(this.faceVertexUvs[ee]===void 0&&(this.faceVertexUvs[ee]=[]),et=0,Fe=at.length;et<Fe;et++){for(var Je=at[et],xt=[],Tt=0,Et=Je.length;Tt<Et;Tt++)xt.push(Je[Tt].clone());this.faceVertexUvs[ee].push(xt)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,i,l,d,m,x,L={},j=[],Z=[],ee=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)e=this.vertices[n],L[t=Math.round(e.x*ee)+"_"+Math.round(e.y*ee)+"_"+Math.round(e.z*ee)]===void 0?(L[t]=n,j.push(this.vertices[n]),Z[n]=j.length-1):Z[n]=Z[L[t]];var ie=[];for(n=0,i=this.faces.length;n<i;n++){(l=this.faces[n]).a=Z[l.a],l.b=Z[l.b],l.c=Z[l.c],d=[l.a,l.b,l.c];for(var z=0;z<3;z++)if(d[z]===d[(z+1)%3]){ie.push(n);break}}for(n=ie.length-1;0<=n;n--){var he=ie[n];for(this.faces.splice(he,1),m=0,x=this.faceVertexUvs.length;m<x;m++)this.faceVertexUvs[m].splice(he,1)}var me=this.vertices.length-j.length;return this.vertices=j,me},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var i=e[t];this.vertices.push(new Re(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort(function(L,j){return L.materialIndex-j.materialIndex});var i,l,d=this.faceVertexUvs[0],m=this.faceVertexUvs[1];for(d&&d.length===t&&(i=[]),m&&m.length===t&&(l=[]),n=0;n<t;n++){var x=e[n]._id;i&&i.push(d[x]),l&&l.push(m[x])}i&&(this.faceVertexUvs[0]=i),l&&(this.faceVertexUvs[1]=l)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),this.parameters!==void 0){var t=this.parameters;for(var n in t)t[n]!==void 0&&(e[n]=t[n]);return e}for(var i=[],l=0;l<this.vertices.length;l++){var d=this.vertices[l];i.push(d.x,d.y,d.z)}var m=[],x=[],L={},j=[],Z={},ee=[],ie={};for(l=0;l<this.faces.length;l++){var z=this.faces[l],he=this.faceVertexUvs[0][l]!==void 0,me=0<z.normal.length(),ye=0<z.vertexNormals.length,Ae=z.color.r!==1||z.color.g!==1||z.color.b!==1,Le=0<z.vertexColors.length,Ge=0;if(Ge=Je(Ge=Je(Ge=Je(Ge=Je(Ge=Je(Ge=Je(Ge=Je(Ge=Je(Ge,0,0),1,!0),2,!1),3,he),4,me),5,ye),6,Ae),7,Le),m.push(Ge),m.push(z.a,z.b,z.c),m.push(z.materialIndex),he){var et=this.faceVertexUvs[0][l];m.push(Et(et[0]),Et(et[1]),Et(et[2]))}if(me&&m.push(xt(z.normal)),ye){var Fe=z.vertexNormals;m.push(xt(Fe[0]),xt(Fe[1]),xt(Fe[2]))}if(Ae&&m.push(Tt(z.color)),Le){var at=z.vertexColors;m.push(Tt(at[0]),Tt(at[1]),Tt(at[2]))}}function Je(At,Gt,Yt){return Yt?At|1<<Gt:At&~(1<<Gt)}function xt(At){var Gt=At.x.toString()+At.y.toString()+At.z.toString();return L[Gt]!==void 0||(L[Gt]=x.length/3,x.push(At.x,At.y,At.z)),L[Gt]}function Tt(At){var Gt=At.r.toString()+At.g.toString()+At.b.toString();return Z[Gt]!==void 0||(Z[Gt]=j.length,j.push(At.getHex())),Z[Gt]}function Et(At){var Gt=At.x.toString()+At.y.toString();return ie[Gt]!==void 0||(ie[Gt]=ee.length/2,ee.push(At.x,At.y)),ie[Gt]}return e.data={},e.data.vertices=i,e.data.normals=x,0<j.length&&(e.data.colors=j),0<ee.length&&(e.data.uvs=[ee]),e.data.faces=m,e},clone:function(){return new lr().copy(this)},copy:function(e){var t,n,i,l,d,m;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=e.name;var x=e.vertices;for(t=0,n=x.length;t<n;t++)this.vertices.push(x[t].clone());var L=e.colors;for(t=0,n=L.length;t<n;t++)this.colors.push(L[t].clone());var j=e.faces;for(t=0,n=j.length;t<n;t++)this.faces.push(j[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var Z=e.faceVertexUvs[t];for(this.faceVertexUvs[t]===void 0&&(this.faceVertexUvs[t]=[]),i=0,l=Z.length;i<l;i++){var ee=Z[i],ie=[];for(d=0,m=ee.length;d<m;d++){var z=ee[d];ie.push(z.clone())}this.faceVertexUvs[t].push(ie)}}var he=e.morphTargets;for(t=0,n=he.length;t<n;t++){var me={};if(me.name=he[t].name,he[t].vertices!==void 0)for(me.vertices=[],i=0,l=he[t].vertices.length;i<l;i++)me.vertices.push(he[t].vertices[i].clone());if(he[t].normals!==void 0)for(me.normals=[],i=0,l=he[t].normals.length;i<l;i++)me.normals.push(he[t].normals[i].clone());this.morphTargets.push(me)}var ye=e.morphNormals;for(t=0,n=ye.length;t<n;t++){var Ae={};if(ye[t].vertexNormals!==void 0)for(Ae.vertexNormals=[],i=0,l=ye[t].vertexNormals.length;i<l;i++){var Le=ye[t].vertexNormals[i],Ge={};Ge.a=Le.a.clone(),Ge.b=Le.b.clone(),Ge.c=Le.c.clone(),Ae.vertexNormals.push(Ge)}if(ye[t].faceNormals!==void 0)for(Ae.faceNormals=[],i=0,l=ye[t].faceNormals.length;i<l;i++)Ae.faceNormals.push(ye[t].faceNormals[i].clone());this.morphNormals.push(Ae)}var et=e.skinWeights;for(t=0,n=et.length;t<n;t++)this.skinWeights.push(et[t].clone());var Fe=e.skinIndices;for(t=0,n=Fe.length;t<n;t++)this.skinIndices.push(Fe[t].clone());var at=e.lineDistances;for(t=0,n=at.length;t<n;t++)this.lineDistances.push(at[t]);var Je=e.boundingBox;Je!==null&&(this.boundingBox=Je.clone());var xt=e.boundingSphere;return xt!==null&&(this.boundingSphere=xt.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var sh=function(e){function t(n,i,l,d,m,x){e.call(this),this.type="BoxGeometry",this.parameters={width:n,height:i,depth:l,widthSegments:d,heightSegments:m,depthSegments:x},this.fromBufferGeometry(new cc(n,i,l,d,m,x)),this.mergeVertices()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(lr),cc=function(e){function t(n,i,l,d,m,x){e.call(this),this.type="BoxBufferGeometry",this.parameters={width:n,height:i,depth:l,widthSegments:d,heightSegments:m,depthSegments:x};var L=this;n=n||1,i=i||1,l=l||1,d=Math.floor(d)||1,m=Math.floor(m)||1;var j=[],Z=[],ee=[],ie=[],z=0,he=0;function me(ye,Ae,Le,Ge,et,Fe,at,Je,xt,Tt,Et){var At,Gt,Yt=Fe/xt,St=at/Tt,_t=Fe/2,hn=at/2,bn=Je/2,Kn=xt+1,qn=Tt+1,Bn=0,ur=0,Sn=new Re;for(Gt=0;Gt<qn;Gt++){var Ne=Gt*St-hn;for(At=0;At<Kn;At++){var nt=At*Yt-_t;Sn[ye]=nt*Ge,Sn[Ae]=Ne*et,Sn[Le]=bn,Z.push(Sn.x,Sn.y,Sn.z),Sn[ye]=0,Sn[Ae]=0,Sn[Le]=0<Je?1:-1,ee.push(Sn.x,Sn.y,Sn.z),ie.push(At/xt),ie.push(1-Gt/Tt),Bn+=1}}for(Gt=0;Gt<Tt;Gt++)for(At=0;At<xt;At++){var qt=z+At+Kn*Gt,Ht=z+At+Kn*(Gt+1),rr=z+(At+1)+Kn*(Gt+1),Dn=z+(At+1)+Kn*Gt;j.push(qt,Ht,Dn),j.push(Ht,rr,Dn),ur+=6}L.addGroup(he,ur,Et),he+=ur,z+=Bn}me("z","y","x",-1,-1,l,i,n,x=Math.floor(x)||1,m,0),me("z","y","x",1,-1,l,i,-n,x,m,1),me("x","z","y",1,1,n,l,i,d,x,2),me("x","z","y",1,-1,n,l,-i,d,x,3),me("x","y","z",1,-1,n,i,l,d,m,4),me("x","y","z",-1,-1,n,i,-l,d,m,5),this.setIndex(j),this.setAttribute("position",new an(Z,3)),this.setAttribute("normal",new an(ee,3)),this.setAttribute("uv",new an(ie,2))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(Cn);function Ss(e){var t={};for(var n in e)for(var i in t[n]={},e[n]){var l=e[n][i];l&&(l.isColor||l.isMatrix3||l.isMatrix4||l.isVector2||l.isVector3||l.isVector4||l.isTexture)?t[n][i]=l.clone():Array.isArray(l)?t[n][i]=l.slice():t[n][i]=l}return t}function Qi(e){for(var t={},n=0;n<e.length;n++){var i=Ss(e[n]);for(var l in i)t[l]=i[l]}return t}var lh={clone:Ss,merge:Qi},uc=`void main() {
|
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
}`,ch=`void main() {
|
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
}`;function Ya(e){It.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=uc,this.fragmentShader=ch,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,e!==void 0&&(e.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function Lo(){Pt.call(this),this.type="Camera",this.matrixWorldInverse=new fr,this.projectionMatrix=new fr,this.projectionMatrixInverse=new fr}function Ni(e,t,n,i){Lo.call(this),this.type="PerspectiveCamera",this.fov=e!==void 0?e:50,this.zoom=1,this.near=n!==void 0?n:.1,this.far=i!==void 0?i:2e3,this.focus=10,this.aspect=t!==void 0?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Ys(e,t,n,i){Pt.call(this),this.type="CubeCamera";var l=new Ni(90,1,e,t);l.up.set(0,-1,0),l.lookAt(new Re(1,0,0)),this.add(l);var d=new Ni(90,1,e,t);d.up.set(0,-1,0),d.lookAt(new Re(-1,0,0)),this.add(d);var m=new Ni(90,1,e,t);m.up.set(0,0,1),m.lookAt(new Re(0,1,0)),this.add(m);var x=new Ni(90,1,e,t);x.up.set(0,0,-1),x.lookAt(new Re(0,-1,0)),this.add(x);var L=new Ni(90,1,e,t);L.up.set(0,-1,0),L.lookAt(new Re(0,0,1)),this.add(L);var j=new Ni(90,1,e,t);j.up.set(0,-1,0),j.lookAt(new Re(0,0,-1)),this.add(j),i=i||{format:ti,magFilter:xn,minFilter:xn},this.renderTarget=new Zs(n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(Z,ee){this.parent===null&&this.updateMatrixWorld();var ie=Z.getRenderTarget(),z=this.renderTarget,he=z.texture.generateMipmaps;z.texture.generateMipmaps=!1,Z.setRenderTarget(z,0),Z.render(ee,l),Z.setRenderTarget(z,1),Z.render(ee,d),Z.setRenderTarget(z,2),Z.render(ee,m),Z.setRenderTarget(z,3),Z.render(ee,x),Z.setRenderTarget(z,4),Z.render(ee,L),z.texture.generateMipmaps=he,Z.setRenderTarget(z,5),Z.render(ee,j),Z.setRenderTarget(ie)},this.clear=function(Z,ee,ie,z){for(var he=Z.getRenderTarget(),me=this.renderTarget,ye=0;ye<6;ye++)Z.setRenderTarget(me,ye),Z.clear(ee,ie,z);Z.setRenderTarget(he)}}function Zs(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),Zi.call(this,e,e,t)}function Rl(e,t,n,i,l,d,m,x,L,j,Z,ee){Xr.call(this,null,d,m,x,L,j,i,l,Z,ee),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=L!==void 0?L:dt,this.minFilter=j!==void 0?j:dt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}((Ya.prototype=Object.create(It.prototype)).constructor=Ya).prototype.isShaderMaterial=!0,Ya.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ss(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},Ya.prototype.toJSON=function(e){var t=It.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}0<Object.keys(this.defines).length&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var l={};for(var d in this.extensions)this.extensions[d]===!0&&(l[d]=!0);return 0<Object.keys(l).length&&(t.extensions=l),t},Lo.prototype=Object.assign(Object.create(Pt.prototype),{constructor:Lo,isCamera:!0,copy:function(e,t){return Pt.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){e===void 0&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Re),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Pt.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){Pt.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return new this.constructor().copy(this)}}),Ni.prototype=Object.assign(Object.create(Lo.prototype),{constructor:Ni,isPerspectiveCamera:!0,copy:function(e,t){return Lo.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*yr.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*yr.DEG2RAD*this.fov);return .5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*yr.RAD2DEG*Math.atan(Math.tan(.5*yr.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(e,t,n,i,l,d){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=l,this.view.height=d,this.updateProjectionMatrix()},clearViewOffset:function(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*yr.DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,l=-.5*i,d=this.view;if(this.view!==null&&this.view.enabled){var m=d.fullWidth,x=d.fullHeight;l+=d.offsetX*i/m,t-=d.offsetY*n/x,i*=d.width/m,n*=d.height/x}var L=this.filmOffset;L!==0&&(l+=e*L/this.getFilmWidth()),this.projectionMatrix.makePerspective(l,l+i,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Pt.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),(Ys.prototype=Object.create(Pt.prototype)).constructor=Ys,((Zs.prototype=Object.create(Zi.prototype)).constructor=Zs).prototype.isWebGLCubeRenderTarget=!0,Zs.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new Hn,i={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {"," return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {"," vWorldDirection = transformDirection( position, modelMatrix );"," #include <begin_vertex>"," #include <project_vertex>","}"].join(`
|
|
`),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {"," vec3 direction = normalize( vWorldDirection );"," vec2 sampleUV;"," sampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;"," sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;"," gl_FragColor = texture2D( tEquirect, sampleUV );","}"].join(`
|
|
`)},l=new Ya({type:"CubemapFromEquirect",uniforms:Ss(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:M,blending:T});l.uniforms.tEquirect.value=t;var d=new Ti(new cc(5,5,5),l);n.add(d);var m=new Ys(1,10,1);return m.renderTarget=this,m.renderTarget.texture.name="CubeCameraTexture",m.update(e,n),d.geometry.dispose(),d.material.dispose(),this},((Rl.prototype=Object.create(Xr.prototype)).constructor=Rl).prototype.isDataTexture=!0;var Ks=new Zr,$s=new Re;function Qs(e,t,n,i,l,d){this.planes=[e!==void 0?e:new ia,t!==void 0?t:new ia,n!==void 0?n:new ia,i!==void 0?i:new ia,l!==void 0?l:new ia,d!==void 0?d:new ia]}Object.assign(Qs.prototype,{set:function(e,t,n,i,l,d){var m=this.planes;return m[0].copy(e),m[1].copy(t),m[2].copy(n),m[3].copy(i),m[4].copy(l),m[5].copy(d),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,i=n[0],l=n[1],d=n[2],m=n[3],x=n[4],L=n[5],j=n[6],Z=n[7],ee=n[8],ie=n[9],z=n[10],he=n[11],me=n[12],ye=n[13],Ae=n[14],Le=n[15];return t[0].setComponents(m-i,Z-x,he-ee,Le-me).normalize(),t[1].setComponents(m+i,Z+x,he+ee,Le+me).normalize(),t[2].setComponents(m+l,Z+L,he+ie,Le+ye).normalize(),t[3].setComponents(m-l,Z-L,he-ie,Le-ye).normalize(),t[4].setComponents(m-d,Z-j,he-z,Le-Ae).normalize(),t[5].setComponents(m+d,Z+j,he+z,Le+Ae).normalize(),this},intersectsObject:function(e){var t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),Ks.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Ks)},intersectsSprite:function(e){return Ks.center.set(0,0,0),Ks.radius=.7071067811865476,Ks.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ks)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,i=-e.radius,l=0;l<6;l++)if(t[l].distanceToPoint(n)<i)return!1;return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var i=t[n];if($s.x=0<i.normal.x?e.max.x:e.min.x,$s.y=0<i.normal.y?e.max.y:e.min.y,$s.z=0<i.normal.z?e.max.z:e.min.z,i.distanceToPoint($s)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}});var wn={common:{diffuse:{value:new Qe(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Ai},uv2Transform:{value:new Ai},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 zt(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 Qe(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 Qe(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Ai}},sprite:{diffuse:{value:new Qe(15658734)},opacity:{value:1},center:{value:new zt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Ai}}};function uh(){var e=null,t=!1,n=null;function i(l,d){t!==!1&&(n(l,d),e.requestAnimationFrame(i))}return{start:function(){t!==!0&&n!==null&&(e.requestAnimationFrame(i),t=!0)},stop:function(){t=!1},setAnimationLoop:function(l){n=l},setContext:function(l){e=l}}}function Ll(e,t,n,i){lr.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new el(e,t,n,i)),this.mergeVertices()}function el(e,t,n,i){Cn.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};var l,d,m=(e=e||1)/2,x=(t=t||1)/2,L=Math.floor(n)||1,j=Math.floor(i)||1,Z=L+1,ee=j+1,ie=e/L,z=t/j,he=[],me=[],ye=[],Ae=[];for(d=0;d<ee;d++){var Le=d*z-x;for(l=0;l<Z;l++){var Ge=l*ie-m;me.push(Ge,-Le,0),ye.push(0,0,1),Ae.push(l/L),Ae.push(1-d/j)}}for(d=0;d<j;d++)for(l=0;l<L;l++){var et=l+Z*d,Fe=l+Z*(d+1),at=l+1+Z*(d+1),Je=l+1+Z*d;he.push(et,Fe,Je),he.push(Fe,at,Je)}this.setIndex(he),this.setAttribute("position",new an(me,3)),this.setAttribute("normal",new an(ye,3)),this.setAttribute("uv",new an(Ae,2))}(Ll.prototype=Object.create(lr.prototype)).constructor=Ll,(el.prototype=Object.create(Cn.prototype)).constructor=el;var Er={alphamap_fragment:`#ifdef USE_ALPHAMAP
|
|
diffuseColor.a *= texture2D( alphaMap, vUv ).g;
|
|
#endif`,alphamap_pars_fragment:`#ifdef USE_ALPHAMAP
|
|
uniform sampler2D alphaMap;
|
|
#endif`,alphatest_fragment:`#ifdef ALPHATEST
|
|
if ( diffuseColor.a < ALPHATEST ) discard;
|
|
#endif`,aomap_fragment:`#ifdef USE_AOMAP
|
|
float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
|
|
reflectedLight.indirectDiffuse *= ambientOcclusion;
|
|
#if defined( USE_ENVMAP ) && defined( STANDARD )
|
|
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
|
|
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );
|
|
#endif
|
|
#endif`,aomap_pars_fragment:`#ifdef USE_AOMAP
|
|
uniform sampler2D aoMap;
|
|
uniform float aoMapIntensity;
|
|
#endif`,begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:`vec3 objectNormal = vec3( normal );
|
|
#ifdef USE_TANGENT
|
|
vec3 objectTangent = vec3( tangent.xyz );
|
|
#endif`,bsdfs:`vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {
|
|
const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
|
|
const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
|
|
vec4 r = roughness * c0 + c1;
|
|
float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
|
|
return vec2( -1.04, 1.04 ) * a004 + r.zw;
|
|
}
|
|
float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
|
|
#if defined ( PHYSICALLY_CORRECT_LIGHTS )
|
|
float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
|
|
if( cutoffDistance > 0.0 ) {
|
|
distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
|
|
}
|
|
return distanceFalloff;
|
|
#else
|
|
if( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
|
|
return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );
|
|
}
|
|
return 1.0;
|
|
#endif
|
|
}
|
|
vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {
|
|
return RECIPROCAL_PI * diffuseColor;
|
|
}
|
|
vec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {
|
|
float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );
|
|
return ( 1.0 - specularColor ) * fresnel + specularColor;
|
|
}
|
|
vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {
|
|
float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );
|
|
vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;
|
|
return Fr * fresnel + F0;
|
|
}
|
|
float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {
|
|
float a2 = pow2( alpha );
|
|
float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
|
|
float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
|
|
return 1.0 / ( gl * gv );
|
|
}
|
|
float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
|
|
float a2 = pow2( alpha );
|
|
float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
|
|
float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
|
|
return 0.5 / max( gv + gl, EPSILON );
|
|
}
|
|
float D_GGX( const in float alpha, const in float dotNH ) {
|
|
float a2 = pow2( alpha );
|
|
float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
|
|
return RECIPROCAL_PI * a2 / pow2( denom );
|
|
}
|
|
vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {
|
|
float alpha = pow2( roughness );
|
|
vec3 halfDir = normalize( incidentLight.direction + viewDir );
|
|
float dotNL = saturate( dot( normal, incidentLight.direction ) );
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
|
float dotNH = saturate( dot( normal, halfDir ) );
|
|
float dotLH = saturate( dot( incidentLight.direction, halfDir ) );
|
|
vec3 F = F_Schlick( specularColor, dotLH );
|
|
float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );
|
|
float D = D_GGX( alpha, dotNH );
|
|
return F * ( G * D );
|
|
}
|
|
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
|
|
const float LUT_SIZE = 64.0;
|
|
const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
|
|
const float LUT_BIAS = 0.5 / LUT_SIZE;
|
|
float dotNV = saturate( dot( N, V ) );
|
|
vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
|
|
uv = uv * LUT_SCALE + LUT_BIAS;
|
|
return uv;
|
|
}
|
|
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
|
|
float l = length( f );
|
|
return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
|
|
}
|
|
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
|
|
float x = dot( v1, v2 );
|
|
float y = abs( x );
|
|
float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
|
|
float b = 3.4175940 + ( 4.1616724 + y ) * y;
|
|
float v = a / b;
|
|
float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
|
|
return cross( v1, v2 ) * theta_sintheta;
|
|
}
|
|
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
|
|
vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
|
|
vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
|
|
vec3 lightNormal = cross( v1, v2 );
|
|
if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
|
|
vec3 T1, T2;
|
|
T1 = normalize( V - N * dot( V, N ) );
|
|
T2 = - cross( N, T1 );
|
|
mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
|
|
vec3 coords[ 4 ];
|
|
coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
|
|
coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
|
|
coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
|
|
coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
|
|
coords[ 0 ] = normalize( coords[ 0 ] );
|
|
coords[ 1 ] = normalize( coords[ 1 ] );
|
|
coords[ 2 ] = normalize( coords[ 2 ] );
|
|
coords[ 3 ] = normalize( coords[ 3 ] );
|
|
vec3 vectorFormFactor = vec3( 0.0 );
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
|
|
float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
|
|
return vec3( result );
|
|
}
|
|
vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
|
vec2 brdf = integrateSpecularBRDF( dotNV, roughness );
|
|
return specularColor * brdf.x + brdf.y;
|
|
}
|
|
void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
|
|
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
|
|
vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );
|
|
vec2 brdf = integrateSpecularBRDF( dotNV, roughness );
|
|
vec3 FssEss = F * brdf.x + brdf.y;
|
|
float Ess = brdf.x + brdf.y;
|
|
float Ems = 1.0 - Ess;
|
|
vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
|
|
singleScatter += FssEss;
|
|
multiScatter += Fms * Ems;
|
|
}
|
|
float G_BlinnPhong_Implicit( ) {
|
|
return 0.25;
|
|
}
|
|
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
|
|
return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
|
|
}
|
|
vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {
|
|
vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );
|
|
float dotNH = saturate( dot( geometry.normal, halfDir ) );
|
|
float dotLH = saturate( dot( incidentLight.direction, halfDir ) );
|
|
vec3 F = F_Schlick( specularColor, dotLH );
|
|
float G = G_BlinnPhong_Implicit( );
|
|
float D = D_BlinnPhong( shininess, dotNH );
|
|
return F * ( G * D );
|
|
}
|
|
float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {
|
|
return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );
|
|
}
|
|
float BlinnExponentToGGXRoughness( const in float blinnExponent ) {
|
|
return sqrt( 2.0 / ( blinnExponent + 2.0 ) );
|
|
}
|
|
#if defined( USE_SHEEN )
|
|
float D_Charlie(float roughness, float NoH) {
|
|
float invAlpha = 1.0 / roughness;
|
|
float cos2h = NoH * NoH;
|
|
float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);
|
|
}
|
|
float V_Neubelt(float NoV, float NoL) {
|
|
return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));
|
|
}
|
|
vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {
|
|
vec3 N = geometry.normal;
|
|
vec3 V = geometry.viewDir;
|
|
vec3 H = normalize( V + L );
|
|
float dotNH = saturate( dot( N, H ) );
|
|
return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );
|
|
}
|
|
#endif`,bumpmap_pars_fragment:`#ifdef USE_BUMPMAP
|
|
uniform sampler2D bumpMap;
|
|
uniform float bumpScale;
|
|
vec2 dHdxy_fwd() {
|
|
vec2 dSTdx = dFdx( vUv );
|
|
vec2 dSTdy = dFdy( vUv );
|
|
float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
|
|
float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
|
|
float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
|
|
return vec2( dBx, dBy );
|
|
}
|
|
vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {
|
|
vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );
|
|
vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );
|
|
vec3 vN = surf_norm;
|
|
vec3 R1 = cross( vSigmaY, vN );
|
|
vec3 R2 = cross( vN, vSigmaX );
|
|
float fDet = dot( vSigmaX, R1 );
|
|
fDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );
|
|
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
|
|
return normalize( abs( fDet ) * surf_norm - vGrad );
|
|
}
|
|
#endif`,clipping_planes_fragment:`#if NUM_CLIPPING_PLANES > 0
|
|
vec4 plane;
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
|
|
plane = clippingPlanes[ i ];
|
|
if ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;
|
|
}
|
|
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
|
|
bool clipped = true;
|
|
#pragma unroll_loop
|
|
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
|
|
plane = clippingPlanes[ i ];
|
|
clipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;
|
|
}
|
|
if ( clipped ) discard;
|
|
#endif
|
|
#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0
|
|
#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )
|
|
varying vec3 vViewPosition;
|
|
#endif
|
|
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
|
|
#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )
|
|
varying vec3 vViewPosition;
|
|
#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )
|
|
vViewPosition = - mvPosition.xyz;
|
|
#endif`,color_fragment:`#ifdef USE_COLOR
|
|
diffuseColor.rgb *= vColor;
|
|
#endif`,color_pars_fragment:`#ifdef USE_COLOR
|
|
varying vec3 vColor;
|
|
#endif`,color_pars_vertex:`#ifdef USE_COLOR
|
|
varying vec3 vColor;
|
|
#endif`,color_vertex:`#ifdef USE_COLOR
|
|
vColor.xyz = color.xyz;
|
|
#endif`,common:`#define PI 3.14159265359
|
|
#define PI2 6.28318530718
|
|
#define PI_HALF 1.5707963267949
|
|
#define RECIPROCAL_PI 0.31830988618
|
|
#define RECIPROCAL_PI2 0.15915494
|
|
#define LOG2 1.442695
|
|
#define EPSILON 1e-6
|
|
#ifndef saturate
|
|
#define saturate(a) clamp( a, 0.0, 1.0 )
|
|
#endif
|
|
#define whiteComplement(a) ( 1.0 - saturate( a ) )
|
|
float pow2( const in float x ) { return x*x; }
|
|
float pow3( const in float x ) { return x*x*x; }
|
|
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
|
|
float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }
|
|
highp float rand( const in vec2 uv ) {
|
|
const highp float a = 12.9898, b = 78.233, c = 43758.5453;
|
|
highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
|
|
return fract(sin(sn) * c);
|
|
}
|
|
#ifdef HIGH_PRECISION
|
|
float precisionSafeLength( vec3 v ) { return length( v ); }
|
|
#else
|
|
float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }
|
|
float precisionSafeLength( vec3 v ) {
|
|
float maxComponent = max3( abs( v ) );
|
|
return length( v / maxComponent ) * maxComponent;
|
|
}
|
|
#endif
|
|
struct IncidentLight {
|
|
vec3 color;
|
|
vec3 direction;
|
|
bool visible;
|
|
};
|
|
struct ReflectedLight {
|
|
vec3 directDiffuse;
|
|
vec3 directSpecular;
|
|
vec3 indirectDiffuse;
|
|
vec3 indirectSpecular;
|
|
};
|
|
struct GeometricContext {
|
|
vec3 position;
|
|
vec3 normal;
|
|
vec3 viewDir;
|
|
#ifdef CLEARCOAT
|
|
vec3 clearcoatNormal;
|
|
#endif
|
|
};
|
|
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
|
|
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
|
|
}
|
|
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
|
|
return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
|
|
}
|
|
vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {
|
|
float distance = dot( planeNormal, point - pointOnPlane );
|
|
return - distance * planeNormal + point;
|
|
}
|
|
float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {
|
|
return sign( dot( point - pointOnPlane, planeNormal ) );
|
|
}
|
|
vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {
|
|
return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;
|
|
}
|
|
mat3 transposeMat3( const in mat3 m ) {
|
|
mat3 tmp;
|
|
tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
|
|
tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
|
|
tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
|
|
return tmp;
|
|
}
|
|
float linearToRelativeLuminance( const in vec3 color ) {
|
|
vec3 weights = vec3( 0.2126, 0.7152, 0.0722 );
|
|
return dot( weights, color.rgb );
|
|
}
|
|
bool isPerspectiveMatrix( mat4 m ) {
|
|
return m[ 2 ][ 3 ] == - 1.0;
|
|
}`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV
|
|
#define cubeUV_maxMipLevel 8.0
|
|
#define cubeUV_minMipLevel 4.0
|
|
#define cubeUV_maxTileSize 256.0
|
|
#define cubeUV_minTileSize 16.0
|
|
float getFace(vec3 direction) {
|
|
vec3 absDirection = abs(direction);
|
|
float face = -1.0;
|
|
if (absDirection.x > absDirection.z) {
|
|
if (absDirection.x > absDirection.y)
|
|
face = direction.x > 0.0 ? 0.0 : 3.0;
|
|
else
|
|
face = direction.y > 0.0 ? 1.0 : 4.0;
|
|
} else {
|
|
if (absDirection.z > absDirection.y)
|
|
face = direction.z > 0.0 ? 2.0 : 5.0;
|
|
else
|
|
face = direction.y > 0.0 ? 1.0 : 4.0;
|
|
}
|
|
return face;
|
|
}
|
|
vec2 getUV(vec3 direction, float face) {
|
|
vec2 uv;
|
|
if (face == 0.0) {
|
|
uv = vec2(-direction.z, direction.y) / abs(direction.x);
|
|
} else if (face == 1.0) {
|
|
uv = vec2(direction.x, -direction.z) / abs(direction.y);
|
|
} else if (face == 2.0) {
|
|
uv = direction.xy / abs(direction.z);
|
|
} else if (face == 3.0) {
|
|
uv = vec2(direction.z, direction.y) / abs(direction.x);
|
|
} else if (face == 4.0) {
|
|
uv = direction.xz / abs(direction.y);
|
|
} else {
|
|
uv = vec2(-direction.x, direction.y) / abs(direction.z);
|
|
}
|
|
return 0.5 * (uv + 1.0);
|
|
}
|
|
vec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {
|
|
float face = getFace(direction);
|
|
float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);
|
|
mipInt = max(mipInt, cubeUV_minMipLevel);
|
|
float faceSize = exp2(mipInt);
|
|
float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);
|
|
vec2 uv = getUV(direction, face) * (faceSize - 1.0);
|
|
vec2 f = fract(uv);
|
|
uv += 0.5 - f;
|
|
if (face > 2.0) {
|
|
uv.y += faceSize;
|
|
face -= 3.0;
|
|
}
|
|
uv.x += face * faceSize;
|
|
if(mipInt < cubeUV_maxMipLevel){
|
|
uv.y += 2.0 * cubeUV_maxTileSize;
|
|
}
|
|
uv.y += filterInt * 2.0 * cubeUV_minTileSize;
|
|
uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);
|
|
uv *= texelSize;
|
|
vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;
|
|
uv.x += texelSize;
|
|
vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;
|
|
uv.y += texelSize;
|
|
vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;
|
|
uv.x -= texelSize;
|
|
vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;
|
|
vec3 tm = mix(tl, tr, f.x);
|
|
vec3 bm = mix(bl, br, f.x);
|
|
return mix(tm, bm, f.y);
|
|
}
|
|
#define r0 1.0
|
|
#define v0 0.339
|
|
#define m0 -2.0
|
|
#define r1 0.8
|
|
#define v1 0.276
|
|
#define m1 -1.0
|
|
#define r4 0.4
|
|
#define v4 0.046
|
|
#define m4 2.0
|
|
#define r5 0.305
|
|
#define v5 0.016
|
|
#define m5 3.0
|
|
#define r6 0.21
|
|
#define v6 0.0038
|
|
#define m6 4.0
|
|
float roughnessToMip(float roughness) {
|
|
float mip = 0.0;
|
|
if (roughness >= r1) {
|
|
mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;
|
|
} else if (roughness >= r4) {
|
|
mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;
|
|
} else if (roughness >= r5) {
|
|
mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;
|
|
} else if (roughness >= r6) {
|
|
mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;
|
|
} else {
|
|
mip = -2.0 * log2(1.16 * roughness); }
|
|
return mip;
|
|
}
|
|
vec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {
|
|
float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);
|
|
float mipF = fract(mip);
|
|
float mipInt = floor(mip);
|
|
vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);
|
|
if (mipF == 0.0) {
|
|
return vec4(color0, 1.0);
|
|
} else {
|
|
vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);
|
|
return vec4(mix(color0, color1, mipF), 1.0);
|
|
}
|
|
}
|
|
#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal;
|
|
#ifdef USE_INSTANCING
|
|
transformedNormal = mat3( instanceMatrix ) * transformedNormal;
|
|
#endif
|
|
transformedNormal = normalMatrix * transformedNormal;
|
|
#ifdef FLIP_SIDED
|
|
transformedNormal = - transformedNormal;
|
|
#endif
|
|
#ifdef USE_TANGENT
|
|
vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
|
|
#ifdef FLIP_SIDED
|
|
transformedTangent = - transformedTangent;
|
|
#endif
|
|
#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP
|
|
uniform sampler2D displacementMap;
|
|
uniform float displacementScale;
|
|
uniform float displacementBias;
|
|
#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP
|
|
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
|
|
#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP
|
|
vec4 emissiveColor = texture2D( emissiveMap, vUv );
|
|
emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;
|
|
totalEmissiveRadiance *= emissiveColor.rgb;
|
|
#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP
|
|
uniform sampler2D emissiveMap;
|
|
#endif`,encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:`
|
|
vec4 LinearToLinear( in vec4 value ) {
|
|
return value;
|
|
}
|
|
vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
|
|
return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );
|
|
}
|
|
vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
|
|
return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );
|
|
}
|
|
vec4 sRGBToLinear( in vec4 value ) {
|
|
return 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 );
|
|
}
|
|
vec4 LinearTosRGB( in vec4 value ) {
|
|
return 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 );
|
|
}
|
|
vec4 RGBEToLinear( in vec4 value ) {
|
|
return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
|
|
}
|
|
vec4 LinearToRGBE( in vec4 value ) {
|
|
float maxComponent = max( max( value.r, value.g ), value.b );
|
|
float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
|
|
return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
|
|
}
|
|
vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
|
|
return vec4( value.rgb * value.a * maxRange, 1.0 );
|
|
}
|
|
vec4 LinearToRGBM( in vec4 value, in float maxRange ) {
|
|
float maxRGB = max( value.r, max( value.g, value.b ) );
|
|
float M = clamp( maxRGB / maxRange, 0.0, 1.0 );
|
|
M = ceil( M * 255.0 ) / 255.0;
|
|
return vec4( value.rgb / ( M * maxRange ), M );
|
|
}
|
|
vec4 RGBDToLinear( in vec4 value, in float maxRange ) {
|
|
return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );
|
|
}
|
|
vec4 LinearToRGBD( in vec4 value, in float maxRange ) {
|
|
float maxRGB = max( value.r, max( value.g, value.b ) );
|
|
float D = max( maxRange / maxRGB, 1.0 );
|
|
D = clamp( floor( D ) / 255.0, 0.0, 1.0 );
|
|
return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );
|
|
}
|
|
const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );
|
|
vec4 LinearToLogLuv( in vec4 value ) {
|
|
vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;
|
|
Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );
|
|
vec4 vResult;
|
|
vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
|
|
float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;
|
|
vResult.w = fract( Le );
|
|
vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;
|
|
return vResult;
|
|
}
|
|
const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );
|
|
vec4 LogLuvToLinear( in vec4 value ) {
|
|
float Le = value.z * 255.0 + value.w;
|
|
vec3 Xp_Y_XYZp;
|
|
Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );
|
|
Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;
|
|
Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;
|
|
vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;
|
|
return vec4( max( vRGB, 0.0 ), 1.0 );
|
|
}`,envmap_fragment:`#ifdef USE_ENVMAP
|
|
#ifdef ENV_WORLDPOS
|
|
vec3 cameraToFrag;
|
|
|
|
if ( isOrthographic ) {
|
|
cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
|
|
} else {
|
|
cameraToFrag = normalize( vWorldPosition - cameraPosition );
|
|
}
|
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
|
#ifdef ENVMAP_MODE_REFLECTION
|
|
vec3 reflectVec = reflect( cameraToFrag, worldNormal );
|
|
#else
|
|
vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
|
|
#endif
|
|
#else
|
|
vec3 reflectVec = vReflect;
|
|
#endif
|
|
#ifdef ENVMAP_TYPE_CUBE
|
|
vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
|
|
#elif defined( ENVMAP_TYPE_CUBE_UV )
|
|
vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );
|
|
#elif defined( ENVMAP_TYPE_EQUIREC )
|
|
vec2 sampleUV;
|
|
reflectVec = normalize( reflectVec );
|
|
sampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
|
|
sampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;
|
|
vec4 envColor = texture2D( envMap, sampleUV );
|
|
#elif defined( ENVMAP_TYPE_SPHERE )
|
|
reflectVec = normalize( reflectVec );
|
|
vec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );
|
|
vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );
|
|
#else
|
|
vec4 envColor = vec4( 0.0 );
|
|
#endif
|
|
#ifndef ENVMAP_TYPE_CUBE_UV
|
|
envColor = envMapTexelToLinear( envColor );
|
|
#endif
|
|
#ifdef ENVMAP_BLENDING_MULTIPLY
|
|
outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
|
|
#elif defined( ENVMAP_BLENDING_MIX )
|
|
outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
|
|
#elif defined( ENVMAP_BLENDING_ADD )
|
|
outgoingLight += envColor.xyz * specularStrength * reflectivity;
|
|
#endif
|
|
#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP
|
|
uniform float envMapIntensity;
|
|
uniform float flipEnvMap;
|
|
uniform int maxMipLevel;
|
|
#ifdef ENVMAP_TYPE_CUBE
|
|
uniform samplerCube envMap;
|
|
#else
|
|
uniform sampler2D envMap;
|
|
#endif
|
|
|
|
#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP
|
|
uniform float reflectivity;
|
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
|
|
#define ENV_WORLDPOS
|
|
#endif
|
|
#ifdef ENV_WORLDPOS
|
|
varying vec3 vWorldPosition;
|
|
uniform float refractionRatio;
|
|
#else
|
|
varying vec3 vReflect;
|
|
#endif
|
|
#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP
|
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )
|
|
#define ENV_WORLDPOS
|
|
#endif
|
|
#ifdef ENV_WORLDPOS
|
|
|
|
varying vec3 vWorldPosition;
|
|
#else
|
|
varying vec3 vReflect;
|
|
uniform float refractionRatio;
|
|
#endif
|
|
#endif`,envmap_physical_pars_fragment:`#if defined( USE_ENVMAP )
|
|
#ifdef ENVMAP_MODE_REFRACTION
|
|
uniform float refractionRatio;
|
|
#endif
|
|
vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {
|
|
vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );
|
|
#ifdef ENVMAP_TYPE_CUBE
|
|
vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );
|
|
#ifdef TEXTURE_LOD_EXT
|
|
vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );
|
|
#else
|
|
vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );
|
|
#endif
|
|
envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;
|
|
#elif defined( ENVMAP_TYPE_CUBE_UV )
|
|
vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );
|
|
#else
|
|
vec4 envMapColor = vec4( 0.0 );
|
|
#endif
|
|
return PI * envMapColor.rgb * envMapIntensity;
|
|
}
|
|
float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {
|
|
float maxMIPLevelScalar = float( maxMIPLevel );
|
|
float sigma = PI * roughness * roughness / ( 1.0 + roughness );
|
|
float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );
|
|
return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );
|
|
}
|
|
vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {
|
|
#ifdef ENVMAP_MODE_REFLECTION
|
|
vec3 reflectVec = reflect( -viewDir, normal );
|
|
reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
|
|
#else
|
|
vec3 reflectVec = refract( -viewDir, normal, refractionRatio );
|
|
#endif
|
|
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
|
|
float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );
|
|
#ifdef ENVMAP_TYPE_CUBE
|
|
vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );
|
|
#ifdef TEXTURE_LOD_EXT
|
|
vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );
|
|
#else
|
|
vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );
|
|
#endif
|
|
envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;
|
|
#elif defined( ENVMAP_TYPE_CUBE_UV )
|
|
vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );
|
|
#elif defined( ENVMAP_TYPE_EQUIREC )
|
|
vec2 sampleUV;
|
|
sampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
|
|
sampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;
|
|
#ifdef TEXTURE_LOD_EXT
|
|
vec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );
|
|
#else
|
|
vec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );
|
|
#endif
|
|
envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;
|
|
#elif defined( ENVMAP_TYPE_SPHERE )
|
|
vec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );
|
|
#ifdef TEXTURE_LOD_EXT
|
|
vec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );
|
|
#else
|
|
vec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );
|
|
#endif
|
|
envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;
|
|
#endif
|
|
return envMapColor.rgb * envMapIntensity;
|
|
}
|
|
#endif`,envmap_vertex:`#ifdef USE_ENVMAP
|
|
#ifdef ENV_WORLDPOS
|
|
vWorldPosition = worldPosition.xyz;
|
|
#else
|
|
vec3 cameraToVertex;
|
|
if ( isOrthographic ) {
|
|
cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
|
|
} else {
|
|
cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
|
|
}
|
|
vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
|
|
#ifdef ENVMAP_MODE_REFLECTION
|
|
vReflect = reflect( cameraToVertex, worldNormal );
|
|
#else
|
|
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
|
|
#endif
|
|
#endif
|
|
#endif`,fog_vertex:`#ifdef USE_FOG
|
|
fogDepth = -mvPosition.z;
|
|
#endif`,fog_pars_vertex:`#ifdef USE_FOG
|
|
varying float fogDepth;
|
|
#endif`,fog_fragment:`#ifdef USE_FOG
|
|
#ifdef FOG_EXP2
|
|
float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );
|
|
#else
|
|
float fogFactor = smoothstep( fogNear, fogFar, fogDepth );
|
|
#endif
|
|
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
|
|
#endif`,fog_pars_fragment:`#ifdef USE_FOG
|
|
uniform vec3 fogColor;
|
|
varying float fogDepth;
|
|
#ifdef FOG_EXP2
|
|
uniform float fogDensity;
|
|
#else
|
|
uniform float fogNear;
|
|
uniform float fogFar;
|
|
#endif
|
|
#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP
|
|
uniform sampler2D gradientMap;
|
|
#endif
|
|
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
|
|
float dotNL = dot( normal, lightDirection );
|
|
vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
|
|
#ifdef USE_GRADIENTMAP
|
|
return texture2D( gradientMap, coord ).rgb;
|
|
#else
|
|
return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );
|
|
#endif
|
|
}`,lightmap_fragment:`#ifdef USE_LIGHTMAP
|
|
vec4 lightMapTexel= texture2D( lightMap, vUv2 );
|
|
reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
|
|
#endif`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP
|
|
uniform sampler2D lightMap;
|
|
uniform float lightMapIntensity;
|
|
#endif`,lights_lambert_vertex:`vec3 diffuse = vec3( 1.0 );
|
|
GeometricContext geometry;
|
|
geometry.position = mvPosition.xyz;
|
|
geometry.normal = normalize( transformedNormal );
|
|
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );
|
|
GeometricContext backGeometry;
|
|
backGeometry.position = geometry.position;
|
|
backGeometry.normal = -geometry.normal;
|
|
backGeometry.viewDir = geometry.viewDir;
|
|
vLightFront = vec3( 0.0 );
|
|
vIndirectFront = vec3( 0.0 );
|
|
#ifdef DOUBLE_SIDED
|
|
vLightBack = vec3( 0.0 );
|
|
vIndirectBack = vec3( 0.0 );
|
|
#endif
|
|
IncidentLight directLight;
|
|
float dotNL;
|
|
vec3 directLightColor_Diffuse;
|
|
#if NUM_POINT_LIGHTS > 0
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
|
|
getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );
|
|
dotNL = dot( geometry.normal, directLight.direction );
|
|
directLightColor_Diffuse = PI * directLight.color;
|
|
vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
|
|
#ifdef DOUBLE_SIDED
|
|
vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
|
|
#endif
|
|
}
|
|
#endif
|
|
#if NUM_SPOT_LIGHTS > 0
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
|
|
getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );
|
|
dotNL = dot( geometry.normal, directLight.direction );
|
|
directLightColor_Diffuse = PI * directLight.color;
|
|
vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
|
|
#ifdef DOUBLE_SIDED
|
|
vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
|
|
#endif
|
|
}
|
|
#endif
|
|
#if NUM_DIR_LIGHTS > 0
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
|
|
getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );
|
|
dotNL = dot( geometry.normal, directLight.direction );
|
|
directLightColor_Diffuse = PI * directLight.color;
|
|
vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
|
|
#ifdef DOUBLE_SIDED
|
|
vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
|
|
#endif
|
|
}
|
|
#endif
|
|
#if NUM_HEMI_LIGHTS > 0
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
|
|
vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );
|
|
#ifdef DOUBLE_SIDED
|
|
vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );
|
|
#endif
|
|
}
|
|
#endif`,lights_pars_begin:`uniform bool receiveShadow;
|
|
uniform vec3 ambientLightColor;
|
|
uniform vec3 lightProbe[ 9 ];
|
|
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
|
|
float x = normal.x, y = normal.y, z = normal.z;
|
|
vec3 result = shCoefficients[ 0 ] * 0.886227;
|
|
result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
|
|
result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
|
|
result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
|
|
result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
|
|
result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
|
|
result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
|
|
result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
|
|
result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
|
|
return result;
|
|
}
|
|
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {
|
|
vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );
|
|
vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
|
|
return irradiance;
|
|
}
|
|
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
|
|
vec3 irradiance = ambientLightColor;
|
|
#ifndef PHYSICALLY_CORRECT_LIGHTS
|
|
irradiance *= PI;
|
|
#endif
|
|
return irradiance;
|
|
}
|
|
#if NUM_DIR_LIGHTS > 0
|
|
struct DirectionalLight {
|
|
vec3 direction;
|
|
vec3 color;
|
|
int shadow;
|
|
float shadowBias;
|
|
float shadowRadius;
|
|
vec2 shadowMapSize;
|
|
};
|
|
uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
|
|
void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {
|
|
directLight.color = directionalLight.color;
|
|
directLight.direction = directionalLight.direction;
|
|
directLight.visible = true;
|
|
}
|
|
#endif
|
|
#if NUM_POINT_LIGHTS > 0
|
|
struct PointLight {
|
|
vec3 position;
|
|
vec3 color;
|
|
float distance;
|
|
float decay;
|
|
int shadow;
|
|
float shadowBias;
|
|
float shadowRadius;
|
|
vec2 shadowMapSize;
|
|
float shadowCameraNear;
|
|
float shadowCameraFar;
|
|
};
|
|
uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
|
|
void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {
|
|
vec3 lVector = pointLight.position - geometry.position;
|
|
directLight.direction = normalize( lVector );
|
|
float lightDistance = length( lVector );
|
|
directLight.color = pointLight.color;
|
|
directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );
|
|
directLight.visible = ( directLight.color != vec3( 0.0 ) );
|
|
}
|
|
#endif
|
|
#if NUM_SPOT_LIGHTS > 0
|
|
struct SpotLight {
|
|
vec3 position;
|
|
vec3 direction;
|
|
vec3 color;
|
|
float distance;
|
|
float decay;
|
|
float coneCos;
|
|
float penumbraCos;
|
|
int shadow;
|
|
float shadowBias;
|
|
float shadowRadius;
|
|
vec2 shadowMapSize;
|
|
};
|
|
uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
|
|
void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {
|
|
vec3 lVector = spotLight.position - geometry.position;
|
|
directLight.direction = normalize( lVector );
|
|
float lightDistance = length( lVector );
|
|
float angleCos = dot( directLight.direction, spotLight.direction );
|
|
if ( angleCos > spotLight.coneCos ) {
|
|
float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );
|
|
directLight.color = spotLight.color;
|
|
directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );
|
|
directLight.visible = true;
|
|
} else {
|
|
directLight.color = vec3( 0.0 );
|
|
directLight.visible = false;
|
|
}
|
|
}
|
|
#endif
|
|
#if NUM_RECT_AREA_LIGHTS > 0
|
|
struct RectAreaLight {
|
|
vec3 color;
|
|
vec3 position;
|
|
vec3 halfWidth;
|
|
vec3 halfHeight;
|
|
};
|
|
uniform sampler2D ltc_1; uniform sampler2D ltc_2;
|
|
uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
|
|
#endif
|
|
#if NUM_HEMI_LIGHTS > 0
|
|
struct HemisphereLight {
|
|
vec3 direction;
|
|
vec3 skyColor;
|
|
vec3 groundColor;
|
|
};
|
|
uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
|
|
vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {
|
|
float dotNL = dot( geometry.normal, hemiLight.direction );
|
|
float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
|
|
vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
|
|
#ifndef PHYSICALLY_CORRECT_LIGHTS
|
|
irradiance *= PI;
|
|
#endif
|
|
return irradiance;
|
|
}
|
|
#endif`,lights_toon_fragment:`ToonMaterial material;
|
|
material.diffuseColor = diffuseColor.rgb;
|
|
material.specularColor = specular;
|
|
material.specularShininess = shininess;
|
|
material.specularStrength = specularStrength;`,lights_toon_pars_fragment:`varying vec3 vViewPosition;
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#endif
|
|
struct ToonMaterial {
|
|
vec3 diffuseColor;
|
|
vec3 specularColor;
|
|
float specularShininess;
|
|
float specularStrength;
|
|
};
|
|
void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
|
|
vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;
|
|
#ifndef PHYSICALLY_CORRECT_LIGHTS
|
|
irradiance *= PI;
|
|
#endif
|
|
reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
|
|
reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;
|
|
}
|
|
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
|
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
|
|
}
|
|
#define RE_Direct RE_Direct_Toon
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon
|
|
#define Material_LightProbeLOD( material ) (0)`,lights_phong_fragment:`BlinnPhongMaterial material;
|
|
material.diffuseColor = diffuseColor.rgb;
|
|
material.specularColor = specular;
|
|
material.specularShininess = shininess;
|
|
material.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition;
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#endif
|
|
struct BlinnPhongMaterial {
|
|
vec3 diffuseColor;
|
|
vec3 specularColor;
|
|
float specularShininess;
|
|
float specularStrength;
|
|
};
|
|
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
|
|
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
|
|
vec3 irradiance = dotNL * directLight.color;
|
|
#ifndef PHYSICALLY_CORRECT_LIGHTS
|
|
irradiance *= PI;
|
|
#endif
|
|
reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
|
|
reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;
|
|
}
|
|
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
|
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
|
|
}
|
|
#define RE_Direct RE_Direct_BlinnPhong
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong
|
|
#define Material_LightProbeLOD( material ) (0)`,lights_physical_fragment:`PhysicalMaterial material;
|
|
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
|
|
vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
|
|
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
|
|
material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;
|
|
material.specularRoughness = min( material.specularRoughness, 1.0 );
|
|
#ifdef REFLECTIVITY
|
|
material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );
|
|
#else
|
|
material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );
|
|
#endif
|
|
#ifdef CLEARCOAT
|
|
material.clearcoat = saturate( clearcoat ); material.clearcoatRoughness = max( clearcoatRoughness, 0.0525 );
|
|
material.clearcoatRoughness += geometryRoughness;
|
|
material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
|
|
#endif
|
|
#ifdef USE_SHEEN
|
|
material.sheenColor = sheen;
|
|
#endif`,lights_physical_pars_fragment:`struct PhysicalMaterial {
|
|
vec3 diffuseColor;
|
|
float specularRoughness;
|
|
vec3 specularColor;
|
|
#ifdef CLEARCOAT
|
|
float clearcoat;
|
|
float clearcoatRoughness;
|
|
#endif
|
|
#ifdef USE_SHEEN
|
|
vec3 sheenColor;
|
|
#endif
|
|
};
|
|
#define MAXIMUM_SPECULAR_COEFFICIENT 0.16
|
|
#define DEFAULT_SPECULAR_COEFFICIENT 0.04
|
|
float clearcoatDHRApprox( const in float roughness, const in float dotNL ) {
|
|
return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );
|
|
}
|
|
#if NUM_RECT_AREA_LIGHTS > 0
|
|
void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
|
|
vec3 normal = geometry.normal;
|
|
vec3 viewDir = geometry.viewDir;
|
|
vec3 position = geometry.position;
|
|
vec3 lightPos = rectAreaLight.position;
|
|
vec3 halfWidth = rectAreaLight.halfWidth;
|
|
vec3 halfHeight = rectAreaLight.halfHeight;
|
|
vec3 lightColor = rectAreaLight.color;
|
|
float roughness = material.specularRoughness;
|
|
vec3 rectCoords[ 4 ];
|
|
rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
|
|
rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
|
|
rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
|
|
vec2 uv = LTC_Uv( normal, viewDir, roughness );
|
|
vec4 t1 = texture2D( ltc_1, uv );
|
|
vec4 t2 = texture2D( ltc_2, uv );
|
|
mat3 mInv = mat3(
|
|
vec3( t1.x, 0, t1.y ),
|
|
vec3( 0, 1, 0 ),
|
|
vec3( t1.z, 0, t1.w )
|
|
);
|
|
vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
|
|
reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
|
|
reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
|
|
}
|
|
#endif
|
|
void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
|
|
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
|
|
vec3 irradiance = dotNL * directLight.color;
|
|
#ifndef PHYSICALLY_CORRECT_LIGHTS
|
|
irradiance *= PI;
|
|
#endif
|
|
#ifdef CLEARCOAT
|
|
float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );
|
|
vec3 ccIrradiance = ccDotNL * directLight.color;
|
|
#ifndef PHYSICALLY_CORRECT_LIGHTS
|
|
ccIrradiance *= PI;
|
|
#endif
|
|
float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );
|
|
reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );
|
|
#else
|
|
float clearcoatDHR = 0.0;
|
|
#endif
|
|
#ifdef USE_SHEEN
|
|
reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(
|
|
material.specularRoughness,
|
|
directLight.direction,
|
|
geometry,
|
|
material.sheenColor
|
|
);
|
|
#else
|
|
reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);
|
|
#endif
|
|
reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
|
|
}
|
|
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
|
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
|
|
}
|
|
void 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) {
|
|
#ifdef CLEARCOAT
|
|
float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );
|
|
reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );
|
|
float ccDotNL = ccDotNV;
|
|
float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );
|
|
#else
|
|
float clearcoatDHR = 0.0;
|
|
#endif
|
|
float clearcoatInv = 1.0 - clearcoatDHR;
|
|
vec3 singleScattering = vec3( 0.0 );
|
|
vec3 multiScattering = vec3( 0.0 );
|
|
vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
|
|
BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );
|
|
vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );
|
|
reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;
|
|
reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
|
|
reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
|
|
}
|
|
#define RE_Direct RE_Direct_Physical
|
|
#define RE_Direct_RectArea RE_Direct_RectArea_Physical
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
|
|
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
|
|
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
|
|
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
|
|
}`,lights_fragment_begin:`
|
|
GeometricContext geometry;
|
|
geometry.position = - vViewPosition;
|
|
geometry.normal = normal;
|
|
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
|
|
#ifdef CLEARCOAT
|
|
geometry.clearcoatNormal = clearcoatNormal;
|
|
#endif
|
|
IncidentLight directLight;
|
|
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
|
|
PointLight pointLight;
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
|
|
pointLight = pointLights[ i ];
|
|
getPointDirectLightIrradiance( pointLight, geometry, directLight );
|
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
|
|
directLight.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;
|
|
#endif
|
|
RE_Direct( directLight, geometry, material, reflectedLight );
|
|
}
|
|
#endif
|
|
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
|
|
SpotLight spotLight;
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
|
|
spotLight = spotLights[ i ];
|
|
getSpotDirectLightIrradiance( spotLight, geometry, directLight );
|
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
|
directLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
|
|
#endif
|
|
RE_Direct( directLight, geometry, material, reflectedLight );
|
|
}
|
|
#endif
|
|
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
|
|
DirectionalLight directionalLight;
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
|
|
directionalLight = directionalLights[ i ];
|
|
getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );
|
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
|
|
directLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
|
#endif
|
|
RE_Direct( directLight, geometry, material, reflectedLight );
|
|
}
|
|
#endif
|
|
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
|
|
RectAreaLight rectAreaLight;
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
|
|
rectAreaLight = rectAreaLights[ i ];
|
|
RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );
|
|
}
|
|
#endif
|
|
#if defined( RE_IndirectDiffuse )
|
|
vec3 iblIrradiance = vec3( 0.0 );
|
|
vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
|
|
irradiance += getLightProbeIrradiance( lightProbe, geometry );
|
|
#if ( NUM_HEMI_LIGHTS > 0 )
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
|
|
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );
|
|
}
|
|
#endif
|
|
#endif
|
|
#if defined( RE_IndirectSpecular )
|
|
vec3 radiance = vec3( 0.0 );
|
|
vec3 clearcoatRadiance = vec3( 0.0 );
|
|
#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse )
|
|
#ifdef USE_LIGHTMAP
|
|
vec4 lightMapTexel= texture2D( lightMap, vUv2 );
|
|
vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
|
|
#ifndef PHYSICALLY_CORRECT_LIGHTS
|
|
lightMapIrradiance *= PI;
|
|
#endif
|
|
irradiance += lightMapIrradiance;
|
|
#endif
|
|
#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
|
|
iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );
|
|
#endif
|
|
#endif
|
|
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
|
|
radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );
|
|
#ifdef CLEARCOAT
|
|
clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );
|
|
#endif
|
|
#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse )
|
|
RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
|
|
#endif
|
|
#if defined( RE_IndirectSpecular )
|
|
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
|
|
#endif`,logdepthbuf_fragment:`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
|
|
gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
|
|
#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
|
|
uniform float logDepthBufFC;
|
|
varying float vFragDepth;
|
|
varying float vIsPerspective;
|
|
#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGDEPTHBUF
|
|
#ifdef USE_LOGDEPTHBUF_EXT
|
|
varying float vFragDepth;
|
|
varying float vIsPerspective;
|
|
#else
|
|
uniform float logDepthBufFC;
|
|
#endif
|
|
#endif`,logdepthbuf_vertex:`#ifdef USE_LOGDEPTHBUF
|
|
#ifdef USE_LOGDEPTHBUF_EXT
|
|
vFragDepth = 1.0 + gl_Position.w;
|
|
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
|
|
#else
|
|
if ( isPerspectiveMatrix( projectionMatrix ) ) {
|
|
gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
|
|
gl_Position.z *= gl_Position.w;
|
|
}
|
|
#endif
|
|
#endif`,map_fragment:`#ifdef USE_MAP
|
|
vec4 texelColor = texture2D( map, vUv );
|
|
texelColor = mapTexelToLinear( texelColor );
|
|
diffuseColor *= texelColor;
|
|
#endif`,map_pars_fragment:`#ifdef USE_MAP
|
|
uniform sampler2D map;
|
|
#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_MAP
|
|
vec4 mapTexel = texture2D( map, uv );
|
|
diffuseColor *= mapTexelToLinear( mapTexel );
|
|
#endif
|
|
#ifdef USE_ALPHAMAP
|
|
diffuseColor.a *= texture2D( alphaMap, uv ).g;
|
|
#endif`,map_particle_pars_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
uniform mat3 uvTransform;
|
|
#endif
|
|
#ifdef USE_MAP
|
|
uniform sampler2D map;
|
|
#endif
|
|
#ifdef USE_ALPHAMAP
|
|
uniform sampler2D alphaMap;
|
|
#endif`,metalnessmap_fragment:`float metalnessFactor = metalness;
|
|
#ifdef USE_METALNESSMAP
|
|
vec4 texelMetalness = texture2D( metalnessMap, vUv );
|
|
metalnessFactor *= texelMetalness.b;
|
|
#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP
|
|
uniform sampler2D metalnessMap;
|
|
#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS
|
|
objectNormal *= morphTargetBaseInfluence;
|
|
objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
|
|
objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
|
|
objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
|
|
objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
|
|
#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS
|
|
uniform float morphTargetBaseInfluence;
|
|
#ifndef USE_MORPHNORMALS
|
|
uniform float morphTargetInfluences[ 8 ];
|
|
#else
|
|
uniform float morphTargetInfluences[ 4 ];
|
|
#endif
|
|
#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS
|
|
transformed *= morphTargetBaseInfluence;
|
|
transformed += morphTarget0 * morphTargetInfluences[ 0 ];
|
|
transformed += morphTarget1 * morphTargetInfluences[ 1 ];
|
|
transformed += morphTarget2 * morphTargetInfluences[ 2 ];
|
|
transformed += morphTarget3 * morphTargetInfluences[ 3 ];
|
|
#ifndef USE_MORPHNORMALS
|
|
transformed += morphTarget4 * morphTargetInfluences[ 4 ];
|
|
transformed += morphTarget5 * morphTargetInfluences[ 5 ];
|
|
transformed += morphTarget6 * morphTargetInfluences[ 6 ];
|
|
transformed += morphTarget7 * morphTargetInfluences[ 7 ];
|
|
#endif
|
|
#endif`,normal_fragment_begin:`#ifdef FLAT_SHADED
|
|
vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );
|
|
vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );
|
|
vec3 normal = normalize( cross( fdx, fdy ) );
|
|
#else
|
|
vec3 normal = normalize( vNormal );
|
|
#ifdef DOUBLE_SIDED
|
|
normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );
|
|
#endif
|
|
#ifdef USE_TANGENT
|
|
vec3 tangent = normalize( vTangent );
|
|
vec3 bitangent = normalize( vBitangent );
|
|
#ifdef DOUBLE_SIDED
|
|
tangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );
|
|
bitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );
|
|
#endif
|
|
#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )
|
|
mat3 vTBN = mat3( tangent, bitangent, normal );
|
|
#endif
|
|
#endif
|
|
#endif
|
|
vec3 geometryNormal = normal;`,normal_fragment_maps:`#ifdef OBJECTSPACE_NORMALMAP
|
|
normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
|
|
#ifdef FLIP_SIDED
|
|
normal = - normal;
|
|
#endif
|
|
#ifdef DOUBLE_SIDED
|
|
normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );
|
|
#endif
|
|
normal = normalize( normalMatrix * normal );
|
|
#elif defined( TANGENTSPACE_NORMALMAP )
|
|
vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
|
|
mapN.xy *= normalScale;
|
|
#ifdef USE_TANGENT
|
|
normal = normalize( vTBN * mapN );
|
|
#else
|
|
normal = perturbNormal2Arb( -vViewPosition, normal, mapN );
|
|
#endif
|
|
#elif defined( USE_BUMPMAP )
|
|
normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );
|
|
#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP
|
|
uniform sampler2D normalMap;
|
|
uniform vec2 normalScale;
|
|
#endif
|
|
#ifdef OBJECTSPACE_NORMALMAP
|
|
uniform mat3 normalMatrix;
|
|
#endif
|
|
#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )
|
|
vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {
|
|
vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );
|
|
vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );
|
|
vec2 st0 = dFdx( vUv.st );
|
|
vec2 st1 = dFdy( vUv.st );
|
|
float scale = sign( st1.t * st0.s - st0.t * st1.s );
|
|
vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );
|
|
vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );
|
|
vec3 N = normalize( surf_norm );
|
|
mat3 tsn = mat3( S, T, N );
|
|
mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );
|
|
return normalize( tsn * mapN );
|
|
}
|
|
#endif`,clearcoat_normal_fragment_begin:`#ifdef CLEARCOAT
|
|
vec3 clearcoatNormal = geometryNormal;
|
|
#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP
|
|
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;
|
|
clearcoatMapN.xy *= clearcoatNormalScale;
|
|
#ifdef USE_TANGENT
|
|
clearcoatNormal = normalize( vTBN * clearcoatMapN );
|
|
#else
|
|
clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );
|
|
#endif
|
|
#endif`,clearcoat_normalmap_pars_fragment:`#ifdef USE_CLEARCOAT_NORMALMAP
|
|
uniform sampler2D clearcoatNormalMap;
|
|
uniform vec2 clearcoatNormalScale;
|
|
#endif`,packing:`vec3 packNormalToRGB( const in vec3 normal ) {
|
|
return normalize( normal ) * 0.5 + 0.5;
|
|
}
|
|
vec3 unpackRGBToNormal( const in vec3 rgb ) {
|
|
return 2.0 * rgb.xyz - 1.0;
|
|
}
|
|
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
|
|
const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
|
|
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
|
|
const float ShiftRight8 = 1. / 256.;
|
|
vec4 packDepthToRGBA( const in float v ) {
|
|
vec4 r = vec4( fract( v * PackFactors ), v );
|
|
r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;
|
|
}
|
|
float unpackRGBAToDepth( const in vec4 v ) {
|
|
return dot( v, UnpackFactors );
|
|
}
|
|
vec4 pack2HalfToRGBA( vec2 v ) {
|
|
vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));
|
|
return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);
|
|
}
|
|
vec2 unpackRGBATo2Half( vec4 v ) {
|
|
return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
|
|
}
|
|
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
|
|
return ( viewZ + near ) / ( near - far );
|
|
}
|
|
float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {
|
|
return linearClipZ * ( near - far ) - near;
|
|
}
|
|
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
|
|
return (( near + viewZ ) * far ) / (( far - near ) * viewZ );
|
|
}
|
|
float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
|
|
return ( near * far ) / ( ( far - near ) * invClipZ - far );
|
|
}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA
|
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 );
|
|
#ifdef USE_INSTANCING
|
|
mvPosition = instanceMatrix * mvPosition;
|
|
#endif
|
|
mvPosition = modelViewMatrix * mvPosition;
|
|
gl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING
|
|
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
|
|
#endif`,dithering_pars_fragment:`#ifdef DITHERING
|
|
vec3 dithering( vec3 color ) {
|
|
float grid_position = rand( gl_FragCoord.xy );
|
|
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
|
|
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
|
|
return color + dither_shift_RGB;
|
|
}
|
|
#endif`,roughnessmap_fragment:`float roughnessFactor = roughness;
|
|
#ifdef USE_ROUGHNESSMAP
|
|
vec4 texelRoughness = texture2D( roughnessMap, vUv );
|
|
roughnessFactor *= texelRoughness.g;
|
|
#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP
|
|
uniform sampler2D roughnessMap;
|
|
#endif`,shadowmap_pars_fragment:`#ifdef USE_SHADOWMAP
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
|
|
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
|
|
#endif
|
|
#if NUM_SPOT_LIGHT_SHADOWS > 0
|
|
uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
|
|
varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
|
|
#endif
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
|
uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
|
|
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
|
|
#endif
|
|
float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
|
|
return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
|
|
}
|
|
vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
|
|
return unpackRGBATo2Half( texture2D( shadow, uv ) );
|
|
}
|
|
float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
|
|
float occlusion = 1.0;
|
|
vec2 distribution = texture2DDistribution( shadow, uv );
|
|
float hard_shadow = step( compare , distribution.x );
|
|
if (hard_shadow != 1.0 ) {
|
|
float distance = compare - distribution.x ;
|
|
float variance = max( 0.00000, distribution.y * distribution.y );
|
|
float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
|
|
}
|
|
return occlusion;
|
|
}
|
|
float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
|
|
float shadow = 1.0;
|
|
shadowCoord.xyz /= shadowCoord.w;
|
|
shadowCoord.z += shadowBias;
|
|
bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
|
|
bool inFrustum = all( inFrustumVec );
|
|
bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
|
|
bool frustumTest = all( frustumTestVec );
|
|
if ( frustumTest ) {
|
|
#if defined( SHADOWMAP_TYPE_PCF )
|
|
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
|
|
float dx0 = - texelSize.x * shadowRadius;
|
|
float dy0 = - texelSize.y * shadowRadius;
|
|
float dx1 = + texelSize.x * shadowRadius;
|
|
float dy1 = + texelSize.y * shadowRadius;
|
|
float dx2 = dx0 / 2.0;
|
|
float dy2 = dy0 / 2.0;
|
|
float dx3 = dx1 / 2.0;
|
|
float dy3 = dy1 / 2.0;
|
|
shadow = (
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
|
|
) * ( 1.0 / 17.0 );
|
|
#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
|
|
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
|
|
float dx = texelSize.x;
|
|
float dy = texelSize.y;
|
|
vec2 uv = shadowCoord.xy;
|
|
vec2 f = fract( uv * shadowMapSize + 0.5 );
|
|
uv -= f * texelSize;
|
|
shadow = (
|
|
texture2DCompare( shadowMap, uv, shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
|
|
texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
|
|
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
|
|
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
|
|
f.x ) +
|
|
mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
|
|
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
|
|
f.x ) +
|
|
mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
|
|
texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
|
|
f.y ) +
|
|
mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
|
|
texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
|
|
f.y ) +
|
|
mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
|
|
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
|
|
f.x ),
|
|
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
|
|
texture2DCompare( shadowMap, uv + + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
|
|
f.x ),
|
|
f.y )
|
|
) * ( 1.0 / 9.0 );
|
|
#elif defined( SHADOWMAP_TYPE_VSM )
|
|
shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
|
|
#else
|
|
shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
|
|
#endif
|
|
}
|
|
return shadow;
|
|
}
|
|
vec2 cubeToUV( vec3 v, float texelSizeY ) {
|
|
vec3 absV = abs( v );
|
|
float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
|
|
absV *= scaleToCube;
|
|
v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
|
|
vec2 planar = v.xy;
|
|
float almostATexel = 1.5 * texelSizeY;
|
|
float almostOne = 1.0 - almostATexel;
|
|
if ( absV.z >= almostOne ) {
|
|
if ( v.z > 0.0 )
|
|
planar.x = 4.0 - v.x;
|
|
} else if ( absV.x >= almostOne ) {
|
|
float signX = sign( v.x );
|
|
planar.x = v.z * signX + 2.0 * signX;
|
|
} else if ( absV.y >= almostOne ) {
|
|
float signY = sign( v.y );
|
|
planar.x = v.x + 2.0 * signY + 2.0;
|
|
planar.y = v.z * signY - 2.0;
|
|
}
|
|
return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
|
|
}
|
|
float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
|
|
vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
|
|
vec3 lightToPosition = shadowCoord.xyz;
|
|
float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;
|
|
vec3 bd3D = normalize( lightToPosition );
|
|
#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
|
|
vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
|
|
return (
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
|
|
) * ( 1.0 / 9.0 );
|
|
#else
|
|
return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
|
|
#endif
|
|
}
|
|
#endif`,shadowmap_pars_vertex:`#ifdef USE_SHADOWMAP
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
|
|
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
|
|
#endif
|
|
#if NUM_SPOT_LIGHT_SHADOWS > 0
|
|
uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];
|
|
varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
|
|
#endif
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
|
uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
|
|
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
|
|
#endif
|
|
#endif`,shadowmap_vertex:`#ifdef USE_SHADOWMAP
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
|
|
vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;
|
|
}
|
|
#endif
|
|
#if NUM_SPOT_LIGHT_SHADOWS > 0
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
|
|
vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;
|
|
}
|
|
#endif
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
|
|
vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;
|
|
}
|
|
#endif
|
|
#endif`,shadowmask_pars_fragment:`float getShadowMask() {
|
|
float shadow = 1.0;
|
|
#ifdef USE_SHADOWMAP
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
DirectionalLight directionalLight;
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
|
|
directionalLight = directionalLights[ i ];
|
|
shadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
|
}
|
|
#endif
|
|
#if NUM_SPOT_LIGHT_SHADOWS > 0
|
|
SpotLight spotLight;
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
|
|
spotLight = spotLights[ i ];
|
|
shadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
|
|
}
|
|
#endif
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
|
PointLight pointLight;
|
|
#pragma unroll_loop
|
|
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
|
|
pointLight = pointLights[ i ];
|
|
shadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
|
|
}
|
|
#endif
|
|
#endif
|
|
return shadow;
|
|
}`,skinbase_vertex:`#ifdef USE_SKINNING
|
|
mat4 boneMatX = getBoneMatrix( skinIndex.x );
|
|
mat4 boneMatY = getBoneMatrix( skinIndex.y );
|
|
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
|
|
mat4 boneMatW = getBoneMatrix( skinIndex.w );
|
|
#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING
|
|
uniform mat4 bindMatrix;
|
|
uniform mat4 bindMatrixInverse;
|
|
#ifdef BONE_TEXTURE
|
|
uniform highp sampler2D boneTexture;
|
|
uniform int boneTextureSize;
|
|
mat4 getBoneMatrix( const in float i ) {
|
|
float j = i * 4.0;
|
|
float x = mod( j, float( boneTextureSize ) );
|
|
float y = floor( j / float( boneTextureSize ) );
|
|
float dx = 1.0 / float( boneTextureSize );
|
|
float dy = 1.0 / float( boneTextureSize );
|
|
y = dy * ( y + 0.5 );
|
|
vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
|
|
vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
|
|
vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
|
|
vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );
|
|
mat4 bone = mat4( v1, v2, v3, v4 );
|
|
return bone;
|
|
}
|
|
#else
|
|
uniform mat4 boneMatrices[ MAX_BONES ];
|
|
mat4 getBoneMatrix( const in float i ) {
|
|
mat4 bone = boneMatrices[ int(i) ];
|
|
return bone;
|
|
}
|
|
#endif
|
|
#endif`,skinning_vertex:`#ifdef USE_SKINNING
|
|
vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
|
|
vec4 skinned = vec4( 0.0 );
|
|
skinned += boneMatX * skinVertex * skinWeight.x;
|
|
skinned += boneMatY * skinVertex * skinWeight.y;
|
|
skinned += boneMatZ * skinVertex * skinWeight.z;
|
|
skinned += boneMatW * skinVertex * skinWeight.w;
|
|
transformed = ( bindMatrixInverse * skinned ).xyz;
|
|
#endif`,skinnormal_vertex:`#ifdef USE_SKINNING
|
|
mat4 skinMatrix = mat4( 0.0 );
|
|
skinMatrix += skinWeight.x * boneMatX;
|
|
skinMatrix += skinWeight.y * boneMatY;
|
|
skinMatrix += skinWeight.z * boneMatZ;
|
|
skinMatrix += skinWeight.w * boneMatW;
|
|
skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
|
|
objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
|
|
#ifdef USE_TANGENT
|
|
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
|
|
#endif
|
|
#endif`,specularmap_fragment:`float specularStrength;
|
|
#ifdef USE_SPECULARMAP
|
|
vec4 texelSpecular = texture2D( specularMap, vUv );
|
|
specularStrength = texelSpecular.r;
|
|
#else
|
|
specularStrength = 1.0;
|
|
#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP
|
|
uniform sampler2D specularMap;
|
|
#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING )
|
|
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
|
|
#endif`,tonemapping_pars_fragment:`#ifndef saturate
|
|
#define saturate(a) clamp( a, 0.0, 1.0 )
|
|
#endif
|
|
uniform float toneMappingExposure;
|
|
uniform float toneMappingWhitePoint;
|
|
vec3 LinearToneMapping( vec3 color ) {
|
|
return toneMappingExposure * color;
|
|
}
|
|
vec3 ReinhardToneMapping( vec3 color ) {
|
|
color *= toneMappingExposure;
|
|
return saturate( color / ( vec3( 1.0 ) + color ) );
|
|
}
|
|
#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 ) )
|
|
vec3 Uncharted2ToneMapping( vec3 color ) {
|
|
color *= toneMappingExposure;
|
|
return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );
|
|
}
|
|
vec3 OptimizedCineonToneMapping( vec3 color ) {
|
|
color *= toneMappingExposure;
|
|
color = max( vec3( 0.0 ), color - 0.004 );
|
|
return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
|
|
}
|
|
vec3 ACESFilmicToneMapping( vec3 color ) {
|
|
color *= toneMappingExposure;
|
|
return saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );
|
|
}`,uv_pars_fragment:`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
|
|
varying vec2 vUv;
|
|
#endif`,uv_pars_vertex:`#ifdef USE_UV
|
|
#ifdef UVS_VERTEX_ONLY
|
|
vec2 vUv;
|
|
#else
|
|
varying vec2 vUv;
|
|
#endif
|
|
uniform mat3 uvTransform;
|
|
#endif`,uv_vertex:`#ifdef USE_UV
|
|
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
|
#endif`,uv2_pars_fragment:`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
|
|
varying vec2 vUv2;
|
|
#endif`,uv2_pars_vertex:`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
|
|
attribute vec2 uv2;
|
|
varying vec2 vUv2;
|
|
uniform mat3 uv2Transform;
|
|
#endif`,uv2_vertex:`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
|
|
vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
|
|
#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )
|
|
vec4 worldPosition = vec4( transformed, 1.0 );
|
|
#ifdef USE_INSTANCING
|
|
worldPosition = instanceMatrix * worldPosition;
|
|
#endif
|
|
worldPosition = modelMatrix * worldPosition;
|
|
#endif`,background_frag:`uniform sampler2D t2D;
|
|
varying vec2 vUv;
|
|
void main() {
|
|
vec4 texColor = texture2D( t2D, vUv );
|
|
gl_FragColor = mapTexelToLinear( texColor );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
}`,background_vert:`varying vec2 vUv;
|
|
uniform mat3 uvTransform;
|
|
void main() {
|
|
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
|
gl_Position = vec4( position.xy, 1.0, 1.0 );
|
|
}`,cube_frag:`#include <envmap_common_pars_fragment>
|
|
uniform float opacity;
|
|
varying vec3 vWorldDirection;
|
|
#include <cube_uv_reflection_fragment>
|
|
void main() {
|
|
vec3 vReflect = vWorldDirection;
|
|
#include <envmap_fragment>
|
|
gl_FragColor = envColor;
|
|
gl_FragColor.a *= opacity;
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
}`,cube_vert:`varying vec3 vWorldDirection;
|
|
#include <common>
|
|
void main() {
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
#include <begin_vertex>
|
|
#include <project_vertex>
|
|
gl_Position.z = gl_Position.w;
|
|
}`,depth_frag:`#if DEPTH_PACKING == 3200
|
|
uniform float opacity;
|
|
#endif
|
|
#include <common>
|
|
#include <packing>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
vec4 diffuseColor = vec4( 1.0 );
|
|
#if DEPTH_PACKING == 3200
|
|
diffuseColor.a = opacity;
|
|
#endif
|
|
#include <map_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <logdepthbuf_fragment>
|
|
#if DEPTH_PACKING == 3200
|
|
gl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );
|
|
#elif DEPTH_PACKING == 3201
|
|
gl_FragColor = packDepthToRGBA( gl_FragCoord.z );
|
|
#endif
|
|
}`,depth_vert:`#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <skinbase_vertex>
|
|
#ifdef USE_DISPLACEMENTMAP
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinnormal_vertex>
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
}`,distanceRGBA_frag:`#define DISTANCE
|
|
uniform vec3 referencePosition;
|
|
uniform float nearDistance;
|
|
uniform float farDistance;
|
|
varying vec3 vWorldPosition;
|
|
#include <common>
|
|
#include <packing>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main () {
|
|
#include <clipping_planes_fragment>
|
|
vec4 diffuseColor = vec4( 1.0 );
|
|
#include <map_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
float dist = length( vWorldPosition - referencePosition );
|
|
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
|
|
dist = saturate( dist );
|
|
gl_FragColor = packDepthToRGBA( dist );
|
|
}`,distanceRGBA_vert:`#define DISTANCE
|
|
varying vec3 vWorldPosition;
|
|
#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <skinbase_vertex>
|
|
#ifdef USE_DISPLACEMENTMAP
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinnormal_vertex>
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <worldpos_vertex>
|
|
#include <clipping_planes_vertex>
|
|
vWorldPosition = worldPosition.xyz;
|
|
}`,equirect_frag:`uniform sampler2D tEquirect;
|
|
varying vec3 vWorldDirection;
|
|
#include <common>
|
|
void main() {
|
|
vec3 direction = normalize( vWorldDirection );
|
|
vec2 sampleUV;
|
|
sampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
|
|
sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;
|
|
vec4 texColor = texture2D( tEquirect, sampleUV );
|
|
gl_FragColor = mapTexelToLinear( texColor );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
}`,equirect_vert:`varying vec3 vWorldDirection;
|
|
#include <common>
|
|
void main() {
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
#include <begin_vertex>
|
|
#include <project_vertex>
|
|
}`,linedashed_frag:`uniform vec3 diffuse;
|
|
uniform float opacity;
|
|
uniform float dashSize;
|
|
uniform float totalSize;
|
|
varying float vLineDistance;
|
|
#include <common>
|
|
#include <color_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
if ( mod( vLineDistance, totalSize ) > dashSize ) {
|
|
discard;
|
|
}
|
|
vec3 outgoingLight = vec3( 0.0 );
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <logdepthbuf_fragment>
|
|
#include <color_fragment>
|
|
outgoingLight = diffuseColor.rgb;
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
}`,linedashed_vert:`uniform float scale;
|
|
attribute float lineDistance;
|
|
varying float vLineDistance;
|
|
#include <common>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <color_vertex>
|
|
vLineDistance = scale * lineDistance;
|
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
gl_Position = projectionMatrix * mvPosition;
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <fog_vertex>
|
|
}`,meshbasic_frag:`uniform vec3 diffuse;
|
|
uniform float opacity;
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#endif
|
|
#include <common>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <uv2_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <aomap_pars_fragment>
|
|
#include <lightmap_pars_fragment>
|
|
#include <envmap_common_pars_fragment>
|
|
#include <envmap_pars_fragment>
|
|
#include <cube_uv_reflection_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <specularmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <specularmap_fragment>
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
#ifdef USE_LIGHTMAP
|
|
|
|
vec4 lightMapTexel= texture2D( lightMap, vUv2 );
|
|
reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
|
|
#else
|
|
reflectedLight.indirectDiffuse += vec3( 1.0 );
|
|
#endif
|
|
#include <aomap_fragment>
|
|
reflectedLight.indirectDiffuse *= diffuseColor.rgb;
|
|
vec3 outgoingLight = reflectedLight.indirectDiffuse;
|
|
#include <envmap_fragment>
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
}`,meshbasic_vert:`#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <uv2_pars_vertex>
|
|
#include <envmap_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <uv2_vertex>
|
|
#include <color_vertex>
|
|
#include <skinbase_vertex>
|
|
#ifdef USE_ENVMAP
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <worldpos_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <envmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,meshlambert_frag:`uniform vec3 diffuse;
|
|
uniform vec3 emissive;
|
|
uniform float opacity;
|
|
varying vec3 vLightFront;
|
|
varying vec3 vIndirectFront;
|
|
#ifdef DOUBLE_SIDED
|
|
varying vec3 vLightBack;
|
|
varying vec3 vIndirectBack;
|
|
#endif
|
|
#include <common>
|
|
#include <packing>
|
|
#include <dithering_pars_fragment>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <uv2_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <aomap_pars_fragment>
|
|
#include <lightmap_pars_fragment>
|
|
#include <emissivemap_pars_fragment>
|
|
#include <envmap_common_pars_fragment>
|
|
#include <envmap_pars_fragment>
|
|
#include <cube_uv_reflection_fragment>
|
|
#include <bsdfs>
|
|
#include <lights_pars_begin>
|
|
#include <fog_pars_fragment>
|
|
#include <shadowmap_pars_fragment>
|
|
#include <shadowmask_pars_fragment>
|
|
#include <specularmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
vec3 totalEmissiveRadiance = emissive;
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <specularmap_fragment>
|
|
#include <emissivemap_fragment>
|
|
reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );
|
|
#ifdef DOUBLE_SIDED
|
|
reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;
|
|
#else
|
|
reflectedLight.indirectDiffuse += vIndirectFront;
|
|
#endif
|
|
#include <lightmap_fragment>
|
|
reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );
|
|
#ifdef DOUBLE_SIDED
|
|
reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;
|
|
#else
|
|
reflectedLight.directDiffuse = vLightFront;
|
|
#endif
|
|
reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();
|
|
#include <aomap_fragment>
|
|
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
|
|
#include <envmap_fragment>
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
}`,meshlambert_vert:`#define LAMBERT
|
|
varying vec3 vLightFront;
|
|
varying vec3 vIndirectFront;
|
|
#ifdef DOUBLE_SIDED
|
|
varying vec3 vLightBack;
|
|
varying vec3 vIndirectBack;
|
|
#endif
|
|
#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <uv2_pars_vertex>
|
|
#include <envmap_pars_vertex>
|
|
#include <bsdfs>
|
|
#include <lights_pars_begin>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <shadowmap_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <uv2_vertex>
|
|
#include <color_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <worldpos_vertex>
|
|
#include <envmap_vertex>
|
|
#include <lights_lambert_vertex>
|
|
#include <shadowmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,meshmatcap_frag:`#define MATCAP
|
|
uniform vec3 diffuse;
|
|
uniform float opacity;
|
|
uniform sampler2D matcap;
|
|
varying vec3 vViewPosition;
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#endif
|
|
#include <common>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
vec3 viewDir = normalize( vViewPosition );
|
|
vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
|
|
vec3 y = cross( viewDir, x );
|
|
vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
|
|
#ifdef USE_MATCAP
|
|
vec4 matcapColor = texture2D( matcap, uv );
|
|
matcapColor = matcapTexelToLinear( matcapColor );
|
|
#else
|
|
vec4 matcapColor = vec4( 1.0 );
|
|
#endif
|
|
vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
}`,meshmatcap_vert:`#define MATCAP
|
|
varying vec3 vViewPosition;
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#endif
|
|
#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#ifndef FLAT_SHADED
|
|
vNormal = normalize( transformedNormal );
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <fog_vertex>
|
|
vViewPosition = - mvPosition.xyz;
|
|
}`,meshtoon_frag:`#define TOON
|
|
uniform vec3 diffuse;
|
|
uniform vec3 emissive;
|
|
uniform vec3 specular;
|
|
uniform float shininess;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <packing>
|
|
#include <dithering_pars_fragment>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <uv2_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <aomap_pars_fragment>
|
|
#include <lightmap_pars_fragment>
|
|
#include <emissivemap_pars_fragment>
|
|
#include <gradientmap_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <bsdfs>
|
|
#include <lights_pars_begin>
|
|
#include <lights_toon_pars_fragment>
|
|
#include <shadowmap_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <specularmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
vec3 totalEmissiveRadiance = emissive;
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <specularmap_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
#include <emissivemap_fragment>
|
|
#include <lights_toon_fragment>
|
|
#include <lights_fragment_begin>
|
|
#include <lights_fragment_maps>
|
|
#include <lights_fragment_end>
|
|
#include <aomap_fragment>
|
|
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
}`,meshtoon_vert:`#define TOON
|
|
varying vec3 vViewPosition;
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#endif
|
|
#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <uv2_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <shadowmap_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <uv2_vertex>
|
|
#include <color_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#ifndef FLAT_SHADED
|
|
vNormal = normalize( transformedNormal );
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
vViewPosition = - mvPosition.xyz;
|
|
#include <worldpos_vertex>
|
|
#include <shadowmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,meshphong_frag:`#define PHONG
|
|
uniform vec3 diffuse;
|
|
uniform vec3 emissive;
|
|
uniform vec3 specular;
|
|
uniform float shininess;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <packing>
|
|
#include <dithering_pars_fragment>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <uv2_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <aomap_pars_fragment>
|
|
#include <lightmap_pars_fragment>
|
|
#include <emissivemap_pars_fragment>
|
|
#include <envmap_common_pars_fragment>
|
|
#include <envmap_pars_fragment>
|
|
#include <cube_uv_reflection_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <bsdfs>
|
|
#include <lights_pars_begin>
|
|
#include <lights_phong_pars_fragment>
|
|
#include <shadowmap_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <specularmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
vec3 totalEmissiveRadiance = emissive;
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <specularmap_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
#include <emissivemap_fragment>
|
|
#include <lights_phong_fragment>
|
|
#include <lights_fragment_begin>
|
|
#include <lights_fragment_maps>
|
|
#include <lights_fragment_end>
|
|
#include <aomap_fragment>
|
|
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
|
|
#include <envmap_fragment>
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
}`,meshphong_vert:`#define PHONG
|
|
varying vec3 vViewPosition;
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#endif
|
|
#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <uv2_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <envmap_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <shadowmap_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <uv2_vertex>
|
|
#include <color_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#ifndef FLAT_SHADED
|
|
vNormal = normalize( transformedNormal );
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
vViewPosition = - mvPosition.xyz;
|
|
#include <worldpos_vertex>
|
|
#include <envmap_vertex>
|
|
#include <shadowmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,meshphysical_frag:`#define STANDARD
|
|
#ifdef PHYSICAL
|
|
#define REFLECTIVITY
|
|
#define CLEARCOAT
|
|
#define TRANSPARENCY
|
|
#endif
|
|
uniform vec3 diffuse;
|
|
uniform vec3 emissive;
|
|
uniform float roughness;
|
|
uniform float metalness;
|
|
uniform float opacity;
|
|
#ifdef TRANSPARENCY
|
|
uniform float transparency;
|
|
#endif
|
|
#ifdef REFLECTIVITY
|
|
uniform float reflectivity;
|
|
#endif
|
|
#ifdef CLEARCOAT
|
|
uniform float clearcoat;
|
|
uniform float clearcoatRoughness;
|
|
#endif
|
|
#ifdef USE_SHEEN
|
|
uniform vec3 sheen;
|
|
#endif
|
|
varying vec3 vViewPosition;
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#ifdef USE_TANGENT
|
|
varying vec3 vTangent;
|
|
varying vec3 vBitangent;
|
|
#endif
|
|
#endif
|
|
#include <common>
|
|
#include <packing>
|
|
#include <dithering_pars_fragment>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <uv2_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <aomap_pars_fragment>
|
|
#include <lightmap_pars_fragment>
|
|
#include <emissivemap_pars_fragment>
|
|
#include <bsdfs>
|
|
#include <cube_uv_reflection_fragment>
|
|
#include <envmap_common_pars_fragment>
|
|
#include <envmap_physical_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <lights_pars_begin>
|
|
#include <lights_physical_pars_fragment>
|
|
#include <shadowmap_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <clearcoat_normalmap_pars_fragment>
|
|
#include <roughnessmap_pars_fragment>
|
|
#include <metalnessmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
vec3 totalEmissiveRadiance = emissive;
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <roughnessmap_fragment>
|
|
#include <metalnessmap_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
#include <clearcoat_normal_fragment_begin>
|
|
#include <clearcoat_normal_fragment_maps>
|
|
#include <emissivemap_fragment>
|
|
#include <lights_physical_fragment>
|
|
#include <lights_fragment_begin>
|
|
#include <lights_fragment_maps>
|
|
#include <lights_fragment_end>
|
|
#include <aomap_fragment>
|
|
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
|
|
#ifdef TRANSPARENCY
|
|
diffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );
|
|
#endif
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
}`,meshphysical_vert:`#define STANDARD
|
|
varying vec3 vViewPosition;
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#ifdef USE_TANGENT
|
|
varying vec3 vTangent;
|
|
varying vec3 vBitangent;
|
|
#endif
|
|
#endif
|
|
#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <uv2_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <shadowmap_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <uv2_vertex>
|
|
#include <color_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#ifndef FLAT_SHADED
|
|
vNormal = normalize( transformedNormal );
|
|
#ifdef USE_TANGENT
|
|
vTangent = normalize( transformedTangent );
|
|
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
|
|
#endif
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
vViewPosition = - mvPosition.xyz;
|
|
#include <worldpos_vertex>
|
|
#include <shadowmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,normal_frag:`#define NORMAL
|
|
uniform float opacity;
|
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
|
|
varying vec3 vViewPosition;
|
|
#endif
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#ifdef USE_TANGENT
|
|
varying vec3 vTangent;
|
|
varying vec3 vBitangent;
|
|
#endif
|
|
#endif
|
|
#include <packing>
|
|
#include <uv_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
#include <logdepthbuf_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
|
|
}`,normal_vert:`#define NORMAL
|
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
|
|
varying vec3 vViewPosition;
|
|
#endif
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#ifdef USE_TANGENT
|
|
varying vec3 vTangent;
|
|
varying vec3 vBitangent;
|
|
#endif
|
|
#endif
|
|
#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#ifndef FLAT_SHADED
|
|
vNormal = normalize( transformedNormal );
|
|
#ifdef USE_TANGENT
|
|
vTangent = normalize( transformedTangent );
|
|
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
|
|
#endif
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
|
|
vViewPosition = - mvPosition.xyz;
|
|
#endif
|
|
}`,points_frag:`uniform vec3 diffuse;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <color_pars_fragment>
|
|
#include <map_particle_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
vec3 outgoingLight = vec3( 0.0 );
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_particle_fragment>
|
|
#include <color_fragment>
|
|
#include <alphatest_fragment>
|
|
outgoingLight = diffuseColor.rgb;
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
}`,points_vert:`uniform float size;
|
|
uniform float scale;
|
|
#include <common>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <color_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <project_vertex>
|
|
gl_PointSize = size;
|
|
#ifdef USE_SIZEATTENUATION
|
|
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
|
if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
|
|
#endif
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <worldpos_vertex>
|
|
#include <fog_vertex>
|
|
}`,shadow_frag:`uniform vec3 color;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <packing>
|
|
#include <fog_pars_fragment>
|
|
#include <bsdfs>
|
|
#include <lights_pars_begin>
|
|
#include <shadowmap_pars_fragment>
|
|
#include <shadowmask_pars_fragment>
|
|
void main() {
|
|
gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
#include <fog_fragment>
|
|
}`,shadow_vert:`#include <fog_pars_vertex>
|
|
#include <shadowmap_pars_vertex>
|
|
void main() {
|
|
#include <begin_vertex>
|
|
#include <project_vertex>
|
|
#include <worldpos_vertex>
|
|
#include <shadowmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,sprite_frag:`uniform vec3 diffuse;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
#include <clipping_planes_fragment>
|
|
vec3 outgoingLight = vec3( 0.0 );
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
outgoingLight = diffuseColor.rgb;
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );
|
|
#include <tonemapping_fragment>
|
|
#include <encodings_fragment>
|
|
#include <fog_fragment>
|
|
}`,sprite_vert:`uniform float rotation;
|
|
uniform vec2 center;
|
|
#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
|
|
vec2 scale;
|
|
scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
|
|
scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
|
|
#ifndef USE_SIZEATTENUATION
|
|
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
|
if ( isPerspective ) scale *= - mvPosition.z;
|
|
#endif
|
|
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
|
|
vec2 rotatedPosition;
|
|
rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
|
|
rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
|
|
mvPosition.xy += rotatedPosition;
|
|
gl_Position = projectionMatrix * mvPosition;
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <fog_vertex>
|
|
}`},_o={basic:{uniforms:Qi([wn.common,wn.specularmap,wn.envmap,wn.aomap,wn.lightmap,wn.fog]),vertexShader:Er.meshbasic_vert,fragmentShader:Er.meshbasic_frag},lambert:{uniforms:Qi([wn.common,wn.specularmap,wn.envmap,wn.aomap,wn.lightmap,wn.emissivemap,wn.fog,wn.lights,{emissive:{value:new Qe(0)}}]),vertexShader:Er.meshlambert_vert,fragmentShader:Er.meshlambert_frag},phong:{uniforms:Qi([wn.common,wn.specularmap,wn.envmap,wn.aomap,wn.lightmap,wn.emissivemap,wn.bumpmap,wn.normalmap,wn.displacementmap,wn.fog,wn.lights,{emissive:{value:new Qe(0)},specular:{value:new Qe(1118481)},shininess:{value:30}}]),vertexShader:Er.meshphong_vert,fragmentShader:Er.meshphong_frag},standard:{uniforms:Qi([wn.common,wn.envmap,wn.aomap,wn.lightmap,wn.emissivemap,wn.bumpmap,wn.normalmap,wn.displacementmap,wn.roughnessmap,wn.metalnessmap,wn.fog,wn.lights,{emissive:{value:new Qe(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Er.meshphysical_vert,fragmentShader:Er.meshphysical_frag},toon:{uniforms:Qi([wn.common,wn.specularmap,wn.aomap,wn.lightmap,wn.emissivemap,wn.bumpmap,wn.normalmap,wn.displacementmap,wn.gradientmap,wn.fog,wn.lights,{emissive:{value:new Qe(0)},specular:{value:new Qe(1118481)},shininess:{value:30}}]),vertexShader:Er.meshtoon_vert,fragmentShader:Er.meshtoon_frag},matcap:{uniforms:Qi([wn.common,wn.bumpmap,wn.normalmap,wn.displacementmap,wn.fog,{matcap:{value:null}}]),vertexShader:Er.meshmatcap_vert,fragmentShader:Er.meshmatcap_frag},points:{uniforms:Qi([wn.points,wn.fog]),vertexShader:Er.points_vert,fragmentShader:Er.points_frag},dashed:{uniforms:Qi([wn.common,wn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Er.linedashed_vert,fragmentShader:Er.linedashed_frag},depth:{uniforms:Qi([wn.common,wn.displacementmap]),vertexShader:Er.depth_vert,fragmentShader:Er.depth_frag},normal:{uniforms:Qi([wn.common,wn.bumpmap,wn.normalmap,wn.displacementmap,{opacity:{value:1}}]),vertexShader:Er.normal_vert,fragmentShader:Er.normal_frag},sprite:{uniforms:Qi([wn.sprite,wn.fog]),vertexShader:Er.sprite_vert,fragmentShader:Er.sprite_frag},background:{uniforms:{uvTransform:{value:new Ai},t2D:{value:null}},vertexShader:Er.background_vert,fragmentShader:Er.background_frag},cube:{uniforms:Qi([wn.envmap,{opacity:{value:1}}]),vertexShader:Er.cube_vert,fragmentShader:Er.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Er.equirect_vert,fragmentShader:Er.equirect_frag},distanceRGBA:{uniforms:Qi([wn.common,wn.displacementmap,{referencePosition:{value:new Re},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Er.distanceRGBA_vert,fragmentShader:Er.distanceRGBA_frag},shadow:{uniforms:Qi([wn.lights,wn.fog,{color:{value:new Qe(0)},opacity:{value:1}}]),vertexShader:Er.shadow_vert,fragmentShader:Er.shadow_frag}};function Lr(e,t,n,i){var l,d,m=new Qe(0),x=0,L=null,j=0,Z=null;function ee(ie,z){t.buffers.color.setClear(ie.r,ie.g,ie.b,z,i)}return{getClearColor:function(){return m},setClearColor:function(ie,z){m.set(ie),ee(m,x=z!==void 0?z:1)},getClearAlpha:function(){return x},setClearAlpha:function(ie){ee(m,x=ie)},render:function(ie,z,he,me){var ye=z.background,Ae=e.xr,Le=Ae.getSession&&Ae.getSession();if(Le&&Le.environmentBlendMode==="additive"&&(ye=null),ye===null?ee(m,x):ye&&ye.isColor&&(ee(ye,1),me=!0),(e.autoClear||me)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),ye&&(ye.isCubeTexture||ye.isWebGLCubeRenderTarget||ye.mapping===yt)){d===void 0&&((d=new Ti(new cc(1,1,1),new Ya({type:"BackgroundCubeMaterial",uniforms:Ss(_o.cube.uniforms),vertexShader:_o.cube.vertexShader,fragmentShader:_o.cube.fragmentShader,side:M,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(et,Fe,at){this.matrixWorld.copyPosition(at.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(d));var Ge=ye.isWebGLCubeRenderTarget?ye.texture:ye;d.material.uniforms.envMap.value=Ge,d.material.uniforms.flipEnvMap.value=Ge.isCubeTexture?-1:1,L===ye&&j===Ge.version&&Z===e.toneMapping||(d.material.needsUpdate=!0,L=ye,j=Ge.version,Z=e.toneMapping),ie.unshift(d,d.geometry,d.material,0,0,null)}else ye&&ye.isTexture&&(l===void 0&&((l=new Ti(new el(2,2),new Ya({type:"BackgroundMaterial",uniforms:Ss(_o.background.uniforms),vertexShader:_o.background.vertexShader,fragmentShader:_o.background.fragmentShader,side:A,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(l)),(l.material.uniforms.t2D.value=ye).matrixAutoUpdate===!0&&ye.updateMatrix(),l.material.uniforms.uvTransform.value.copy(ye.matrix),L===ye&&j===ye.version&&Z===e.toneMapping||(l.material.needsUpdate=!0,j=(L=ye).version,Z=e.toneMapping),ie.unshift(l,l.geometry,l.material,0,0,null))}}}function hc(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Ds(e,t,n,i,l,d,m,x,L,j){Xr.call(this,e=e!==void 0?e:[],t=t!==void 0?t:Vt,n,i,l,d,m=m!==void 0?m:ti,x,L,j),this.flipY=!1}function gu(e,t,n,i){Xr.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.magFilter=dt,this.minFilter=dt,this.wrapR=On,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Na(e,t,n,i){Xr.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.magFilter=dt,this.minFilter=dt,this.wrapR=On,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}_o.physical={uniforms:Qi([_o.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new Qe(0)},clearcoatNormalScale:{value:new zt(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:Er.meshphysical_vert,fragmentShader:Er.meshphysical_frag},((Ds.prototype=Object.create(Xr.prototype)).constructor=Ds).prototype.isCubeTexture=!0,Object.defineProperty(Ds.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),((gu.prototype=Object.create(Xr.prototype)).constructor=gu).prototype.isDataTexture2DArray=!0,((Na.prototype=Object.create(Xr.prototype)).constructor=Na).prototype.isDataTexture3D=!0;var zh=new Xr,yu=new gu,hh=new Na,dh=new Ds,ph=[],Za=[],ss=new Float32Array(16),vu=new Float32Array(9),fh=new Float32Array(4);function ls(e,t,n){var i=e[0];if(i<=0||0<i)return e;var l=t*n,d=ph[l];if(d===void 0&&(d=new Float32Array(l),ph[l]=d),t!==0){i.toArray(d,0);for(var m=1,x=0;m!==t;++m)x+=n,e[m].toArray(d,x)}return d}function ho(e,t){if(e.length===t.length){for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return;return 1}}function Va(e,t){for(var n=0,i=t.length;n<i;n++)e[n]=t[n]}function mh(e,t){var n=Za[t];n===void 0&&(n=new Int32Array(t),Za[t]=n);for(var i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function gh(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function yh(e,t){var n=this.cache;if(t.x!==void 0)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(ho(n,t))return;e.uniform2fv(this.addr,t),Va(n,t)}}function Es(e,t){var n=this.cache;if(t.x!==void 0)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(t.r!==void 0)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(ho(n,t))return;e.uniform3fv(this.addr,t),Va(n,t)}}function Jd(e,t){var n=this.cache;if(t.x!==void 0)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(ho(n,t))return;e.uniform4fv(this.addr,t),Va(n,t)}}function As(e,t){var n=this.cache,i=t.elements;if(i===void 0){if(ho(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Va(n,t)}else{if(ho(n,i))return;fh.set(i),e.uniformMatrix2fv(this.addr,!1,fh),Va(n,i)}}function Uh(e,t){var n=this.cache,i=t.elements;if(i===void 0){if(ho(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Va(n,t)}else{if(ho(n,i))return;vu.set(i),e.uniformMatrix3fv(this.addr,!1,vu),Va(n,i)}}function Hh(e,t){var n=this.cache,i=t.elements;if(i===void 0){if(ho(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Va(n,t)}else{if(ho(n,i))return;ss.set(i),e.uniformMatrix4fv(this.addr,!1,ss),Va(n,i)}}function vh(e,t,n){var i=this.cache,l=n.allocateTextureUnit();i[0]!==l&&(e.uniform1i(this.addr,l),i[0]=l),n.safeSetTexture2D(t||zh,l)}function Wh(e,t,n){var i=this.cache,l=n.allocateTextureUnit();i[0]!==l&&(e.uniform1i(this.addr,l),i[0]=l),n.setTexture2DArray(t||yu,l)}function Jh(e,t,n){var i=this.cache,l=n.allocateTextureUnit();i[0]!==l&&(e.uniform1i(this.addr,l),i[0]=l),n.setTexture3D(t||hh,l)}function qh(e,t,n){var i=this.cache,l=n.allocateTextureUnit();i[0]!==l&&(e.uniform1i(this.addr,l),i[0]=l),n.safeSetTextureCube(t||dh,l)}function Xh(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Ka(e,t){var n=this.cache;ho(n,t)||(e.uniform2iv(this.addr,t),Va(n,t))}function Wo(e,t){var n=this.cache;ho(n,t)||(e.uniform3iv(this.addr,t),Va(n,t))}function xu(e,t){var n=this.cache;ho(n,t)||(e.uniform4iv(this.addr,t),Va(n,t))}function Il(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Yh(e,t){e.uniform1fv(this.addr,t)}function Zh(e,t){e.uniform1iv(this.addr,t)}function Kh(e,t){e.uniform2iv(this.addr,t)}function kl(e,t){e.uniform3iv(this.addr,t)}function dc(e,t){e.uniform4iv(this.addr,t)}function $h(e,t){var n=ls(t,this.size,2);e.uniform2fv(this.addr,n)}function Qh(e,t){var n=ls(t,this.size,3);e.uniform3fv(this.addr,n)}function wu(e,t){var n=ls(t,this.size,4);e.uniform4fv(this.addr,n)}function ed(e,t){var n=ls(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function bu(e,t){var n=ls(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function xh(e,t){var n=ls(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Mu(e,t,n){var i=t.length,l=mh(n,i);e.uniform1iv(this.addr,l);for(var d=0;d!==i;++d)n.safeSetTexture2D(t[d]||zh,l[d])}function td(e,t,n){var i=t.length,l=mh(n,i);e.uniform1iv(this.addr,l);for(var d=0;d!==i;++d)n.safeSetTextureCube(t[d]||dh,l[d])}function _u(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(i){switch(t.type){case 5126:return gh;case 35664:return yh;case 35665:return Es;case 35666:return Jd;case 35674:return As;case 35675:return Uh;case 35676:return Hh;case 5124:case 35670:return Xh;case 35667:case 35671:return Ka;case 35668:case 35672:return Wo;case 35669:case 35673:return xu;case 5125:return Il;case 35678:case 36198:case 36298:case 36306:case 35682:return vh;case 35679:case 36299:case 36307:return Jh;case 35680:case 36300:case 36308:case 36293:return qh;case 36289:case 36303:case 36311:case 36292:return Wh}}()}function wh(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(i){switch(t.type){case 5126:return Yh;case 35664:return $h;case 35665:return Qh;case 35666:return wu;case 35674:return ed;case 35675:return bu;case 35676:return xh;case 5124:case 35670:return Zh;case 35667:case 35671:return Kh;case 35668:case 35672:return kl;case 35669:case 35673:return dc;case 35678:case 36198:case 36298:case 36306:case 35682:return Mu;case 35680:case 36300:case 36308:case 36293:return td}}()}function Tu(e){this.id=e,this.seq=[],this.map={}}wh.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Va(t,e)},Tu.prototype.setValue=function(e,t,n){for(var i=this.seq,l=0,d=i.length;l!==d;++l){var m=i[l];m.setValue(e,t[m.id],n)}};var bh=/([\w\d_]+)(\])?(\[|\.)?/g;function Mh(e,t){e.seq.push(t),e.map[t.id]=t}function cs(e,t,n){var i=e.name,l=i.length;for(bh.lastIndex=0;;){var d=bh.exec(i),m=bh.lastIndex,x=d[1],L=d[2]==="]",j=d[3];if(L&&(x|=0),j===void 0||j==="["&&m+2===l){Mh(n,new(j===void 0?_u:wh)(x,e,t));break}var Z=n.map[x];Z===void 0&&Mh(n,Z=new Tu(x)),n=Z}}function us(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),i=0;i<n;++i){var l=e.getActiveUniform(t,i);cs(l,e.getUniformLocation(t,l.name),this)}}function _h(e,t,n){var i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}us.prototype.setValue=function(e,t,n,i){var l=this.map[t];l!==void 0&&l.setValue(e,n,i)},us.prototype.setOptional=function(e,t,n){var i=t[n];i!==void 0&&this.setValue(e,n,i)},us.upload=function(e,t,n,i){for(var l=0,d=t.length;l!==d;++l){var m=t[l],x=n[m.id];x.needsUpdate!==!1&&m.setValue(e,x.value,i)}},us.seqWithValue=function(e,t){for(var n=[],i=0,l=e.length;i!==l;++i){var d=e[i];d.id in t&&n.push(d)}return n};var qd=0;function Th(e){switch(e){case Ke:return["Linear","( value )"];case vt:return["sRGB","( value )"];case Jt:return["RGBE","( value )"];case Gn:return["RGBM","( value, 7.0 )"];case sr:return["RGBM","( value, 16.0 )"];case hi:return["RGBD","( value, 256.0 )"];case Ft:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case In:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function Jo(e,t,n){var i=e.getShaderParameter(t,35713),l=e.getShaderInfoLog(t).trim();return i&&l===""?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+`
|
|
`+l+function(d){for(var m=d.split(`
|
|
`),x=0;x<m.length;x++)m[x]=x+1+": "+m[x];return m.join(`
|
|
`)}(e.getShaderSource(t))}function tl(e,t){var n=Th(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function nl(e){return e!==""}function Cu(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function pc(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var jl=/^[ \t]*#include +<([\w\d./]+)>/gm;function nr(e){return e.replace(jl,Su)}function Su(e,t){var n=Er[t];if(n===void 0)throw new Error("Can not resolve #include <"+t+">");return nr(n)}var Ch=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function Os(e){return e.replace(Ch,Sh)}function Sh(e,t,n,i){for(var l="",d=parseInt(t);d<parseInt(n);d++)l+=i.replace(/\[ i \]/g,"[ "+d+" ]").replace(/UNROLLED_LOOP_INDEX/g,d);return l}function Dh(e){var t="precision "+e.precision+` float;
|
|
precision `+e.precision+" int;";return e.precision==="highp"?t+=`
|
|
#define HIGH_PRECISION`:e.precision==="mediump"?t+=`
|
|
#define MEDIUM_PRECISION`:e.precision==="lowp"&&(t+=`
|
|
#define LOW_PRECISION`),t}function Ra(e,t,n){var i,l,d,m,x,L,j,Z=e.getContext(),ee=n.defines,ie=n.vertexShader,z=n.fragmentShader,he=(l="SHADOWMAP_TYPE_BASIC",(i=n).shadowMapType===V?l="SHADOWMAP_TYPE_PCF":i.shadowMapType===I?l="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===g&&(l="SHADOWMAP_TYPE_VSM"),l),me=function(ur){var Sn="ENVMAP_TYPE_CUBE";if(ur.envMap)switch(ur.envMapMode){case Vt:case jt:Sn="ENVMAP_TYPE_CUBE";break;case yt:case Ue:Sn="ENVMAP_TYPE_CUBE_UV";break;case Ln:case nn:Sn="ENVMAP_TYPE_EQUIREC";break;case er:Sn="ENVMAP_TYPE_SPHERE"}return Sn}(n),ye=function(ur){var Sn="ENVMAP_MODE_REFLECTION";if(ur.envMap)switch(ur.envMapMode){case jt:case nn:Sn="ENVMAP_MODE_REFRACTION"}return Sn}(n),Ae=function(ur){var Sn="ENVMAP_BLENDING_NONE";if(ur.envMap)switch(ur.combine){case se:Sn="ENVMAP_BLENDING_MULTIPLY";break;case xe:Sn="ENVMAP_BLENDING_MIX";break;case De:Sn="ENVMAP_BLENDING_ADD"}return Sn}(n),Le=0<e.gammaFactor?e.gammaFactor:1,Ge=n.isWebGL2?"":[(d=n).extensionDerivatives||d.envMapCubeUV||d.bumpMap||d.tangentSpaceNormalMap||d.clearcoatNormalMap||d.flatShading||d.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(d.extensionFragDepth||d.logarithmicDepthBuffer)&&d.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",d.extensionDrawBuffers&&d.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(d.extensionShaderTextureLOD||d.envMap)&&d.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(nl).join(`
|
|
`),et=function(ur){var Sn=[];for(var Ne in ur){var nt=ur[Ne];nt!==!1&&Sn.push("#define "+Ne+" "+nt)}return Sn.join(`
|
|
`)}(ee),Fe=Z.createProgram(),at=n.numMultiviewViews;if(n.isRawShaderMaterial?(0<(m=[et].filter(nl).join(`
|
|
`)).length&&(m+=`
|
|
`),0<(x=[Ge,et].filter(nl).join(`
|
|
`)).length&&(x+=`
|
|
`)):(m=[Dh(n),"#define SHADER_NAME "+n.shaderName,et,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+Le,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+ye:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+he:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.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"," attribute vec4 tangent;","#endif","#ifdef USE_COLOR"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
|
|
`].filter(nl).join(`
|
|
`),x=[Ge,Dh(n),"#define SHADER_NAME "+n.shaderName,et,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+Le,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+me:"",n.envMap?"#define "+ye:"",n.envMap?"#define "+Ae:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+he:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==tt?"#define TONE_MAPPING":"",n.toneMapping!==tt?Er.tonemapping_pars_fragment:"",n.toneMapping!==tt?function(ur,Sn){var Ne;switch(Sn){case st:Ne="Linear";break;case mt:Ne="Reinhard";break;case Rt:Ne="Uncharted2";break;case Ot:Ne="OptimizedCineon";break;case He:Ne="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+Sn)}return"vec3 toneMapping( vec3 color ) { return "+Ne+"ToneMapping( color ); }"}(0,n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?Er.encodings_pars_fragment:"",n.mapEncoding?tl("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?tl("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?tl("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?tl("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?tl("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?(L=n.outputEncoding,j=Th(L),"vec4 linearToOutputTexel( vec4 value ) { return LinearTo"+j[0]+j[1]+"; }"):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
|
|
`].filter(nl).join(`
|
|
`)),ie=pc(ie=Cu(ie=nr(ie),n),n),z=pc(z=Cu(z=nr(z),n),n),ie=Os(ie),z=Os(z),n.isWebGL2&&!n.isRawShaderMaterial){var Je=!1,xt=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&ie.match(xt)!==null&&z.match(xt)!==null&&(Je=!0,ie=ie.replace(xt,""),z=z.replace(xt,"")),m=[`#version 300 es
|
|
`,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
`)+`
|
|
`+m,x=[`#version 300 es
|
|
`,"#define varying in",Je?"":"out highp vec4 pc_fragColor;",Je?"":"#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(`
|
|
`)+`
|
|
`+x,0<at&&(m=(m=m.replace(`#version 300 es
|
|
`,[`#version 300 es
|
|
`,"#extension GL_OVR_multiview2 : require","layout(num_views = "+at+") in;","#define VIEW_ID gl_ViewID_OVR"].join(`
|
|
`))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join(`
|
|
`),["uniform mat4 modelViewMatrices["+at+"];","uniform mat4 projectionMatrices["+at+"];","uniform mat4 viewMatrices["+at+"];","uniform mat3 normalMatrices["+at+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join(`
|
|
`)),x=(x=x.replace(`#version 300 es
|
|
`,[`#version 300 es
|
|
`,"#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join(`
|
|
`))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+at+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join(`
|
|
`)))}var Tt,Et,At=x+z,Gt=_h(Z,35633,m+ie),Yt=_h(Z,35632,At);if(Z.attachShader(Fe,Gt),Z.attachShader(Fe,Yt),n.index0AttributeName!==void 0?Z.bindAttribLocation(Fe,0,n.index0AttributeName):n.morphTargets===!0&&Z.bindAttribLocation(Fe,0,"position"),Z.linkProgram(Fe),e.debug.checkShaderErrors){var St=Z.getProgramInfoLog(Fe).trim(),_t=Z.getShaderInfoLog(Gt).trim(),hn=Z.getShaderInfoLog(Yt).trim(),bn=!0,Kn=!0;if(Z.getProgramParameter(Fe,35714)===!1){bn=!1;var qn=Jo(Z,Gt,"vertex"),Bn=Jo(Z,Yt,"fragment");console.error("THREE.WebGLProgram: shader error: ",Z.getError(),"35715",Z.getProgramParameter(Fe,35715),"gl.getProgramInfoLog",St,qn,Bn)}else St!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",St):_t!==""&&hn!==""||(Kn=!1);Kn&&(this.diagnostics={runnable:bn,programLog:St,vertexShader:{log:_t,prefix:m},fragmentShader:{log:hn,prefix:x}})}return Z.deleteShader(Gt),Z.deleteShader(Yt),this.getUniforms=function(){return Tt===void 0&&(Tt=new us(Z,Fe)),Tt},this.getAttributes=function(){return Et===void 0&&(Et=function(ur,Sn){for(var Ne={},nt=ur.getProgramParameter(Sn,35721),qt=0;qt<nt;qt++){var Ht=ur.getActiveAttrib(Sn,qt).name;Ne[Ht]=ur.getAttribLocation(Sn,Ht)}return Ne}(Z,Fe)),Et},this.destroy=function(){Z.deleteProgram(Fe),this.program=void 0},this.name=n.shaderName,this.id=qd++,this.cacheKey=t,this.usedTimes=1,this.program=Fe,this.vertexShader=Gt,this.fragmentShader=Yt,this.numMultiviewViews=at,this}function nd(e,t,n){var i=[],l=n.isWebGL2,d=n.logarithmicDepthBuffer,m=n.floatVertexTextures,x=n.precision,L=n.maxVertexUniforms,j=n.vertexTextures,Z={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"},ee=["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 ie(z){var he;return z?z.isTexture?he=z.encoding:z.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),he=z.texture.encoding):he=Ke,he}this.getParameters=function(z,he,me,ye,Ae,Le,Ge){var et=ye.fog,Fe=z.isMeshStandardMaterial?ye.environment:null,at=z.envMap||Fe,Je=Z[z.type],xt=Ge.isSkinnedMesh?function(Gt){var Yt=Ge.skeleton.bones;if(m)return 1024;var St=L,_t=Math.floor((St-20)/4),hn=Math.min(_t,Yt.length);return hn<Yt.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+Yt.length+" bones. This GPU supports "+hn+"."),0):hn}():0;z.precision!==null&&(x=n.getMaxPrecision(z.precision))!==z.precision&&console.warn("THREE.WebGLProgram.getParameters:",z.precision,"not supported, using",x,"instead.");var Tt=function(Gt,Yt){var St;if(Je){var _t=_o[Je];St={name:Gt.type,uniforms:lh.clone(_t.uniforms),vertexShader:_t.vertexShader,fragmentShader:_t.fragmentShader}}else St={name:Gt.type,uniforms:Gt.uniforms,vertexShader:Gt.vertexShader,fragmentShader:Gt.fragmentShader};return St}(z);z.onBeforeCompile(Tt,e);var Et=e.getRenderTarget(),At=Et&&Et.isWebGLMultiviewRenderTarget?Et.numViews:0;return{isWebGL2:l,shaderID:Je,shaderName:Tt.name,uniforms:Tt.uniforms,vertexShader:Tt.vertexShader,fragmentShader:Tt.fragmentShader,defines:z.defines,isRawShaderMaterial:z.isRawShaderMaterial,isShaderMaterial:z.isShaderMaterial,precision:x,instancing:Ge.isInstancedMesh===!0,supportsVertexTextures:j,numMultiviewViews:At,outputEncoding:Et!==null?ie(Et.texture):e.outputEncoding,map:!!z.map,mapEncoding:ie(z.map),matcap:!!z.matcap,matcapEncoding:ie(z.matcap),envMap:!!at,envMapMode:at&&at.mapping,envMapEncoding:ie(at),envMapCubeUV:!!at&&(at.mapping===yt||at.mapping===Ue),lightMap:!!z.lightMap,lightMapEncoding:ie(z.lightMap),aoMap:!!z.aoMap,emissiveMap:!!z.emissiveMap,emissiveMapEncoding:ie(z.emissiveMap),bumpMap:!!z.bumpMap,normalMap:!!z.normalMap,objectSpaceNormalMap:z.normalMapType===Do,tangentSpaceNormalMap:z.normalMapType===wo,clearcoatNormalMap:!!z.clearcoatNormalMap,displacementMap:!!z.displacementMap,roughnessMap:!!z.roughnessMap,metalnessMap:!!z.metalnessMap,specularMap:!!z.specularMap,alphaMap:!!z.alphaMap,gradientMap:!!z.gradientMap,sheen:!!z.sheen,combine:z.combine,vertexTangents:z.normalMap&&z.vertexTangents,vertexColors:z.vertexColors,vertexUvs:!!(z.map||z.bumpMap||z.normalMap||z.specularMap||z.alphaMap||z.emissiveMap||z.roughnessMap||z.metalnessMap||z.clearcoatNormalMap||z.displacementMap),uvsVertexOnly:!(z.map||z.bumpMap||z.normalMap||z.specularMap||z.alphaMap||z.emissiveMap||z.roughnessMap||z.metalnessMap||z.clearcoatNormalMap||!z.displacementMap),fog:!!et,useFog:z.fog,fogExp2:et&&et.isFogExp2,flatShading:z.flatShading,sizeAttenuation:z.sizeAttenuation,logarithmicDepthBuffer:d,skinning:z.skinning&&0<xt,maxBones:xt,useVertexTexture:m,morphTargets:z.morphTargets,morphNormals:z.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:he.directional.length,numPointLights:he.point.length,numSpotLights:he.spot.length,numRectAreaLights:he.rectArea.length,numHemiLights:he.hemi.length,numDirLightShadows:he.directionalShadowMap.length,numPointLightShadows:he.pointShadowMap.length,numSpotLightShadows:he.spotShadowMap.length,numClippingPlanes:Ae,numClipIntersection:Le,dithering:z.dithering,shadowMapEnabled:e.shadowMap.enabled&&0<me.length,shadowMapType:e.shadowMap.type,toneMapping:z.toneMapped?e.toneMapping:tt,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:z.premultipliedAlpha,alphaTest:z.alphaTest,doubleSided:z.side===N,flipSided:z.side===M,depthPacking:z.depthPacking!==void 0&&z.depthPacking,index0AttributeName:z.index0AttributeName,extensionDerivatives:z.extensions&&z.extensions.derivatives,extensionFragDepth:z.extensions&&z.extensions.frawbuffers,extensionDrawbuffers:z.extensions&&z.extensions.drawbuffers,extensionShaderTextureLOD:z.extensions&&z.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||t.get("EXT_frag_depth")!==null,rendererExtensionDrawBuffers:l||t.get("WEBGL_draw_buffers")!==null,rendererExtensionShaderTextureLod:l||t.get("EXT_shader_texture_lod")!==null,onBeforeCompile:z.onBeforeCompile}},this.getProgramCacheKey=function(z){var he=[];if(z.shaderID?he.push(z.shaderID):(he.push(z.fragmentShader),he.push(z.vertexShader)),z.defines!==void 0)for(var me in z.defines)he.push(me),he.push(z.defines[me]);if(z.isRawShaderMaterial===void 0){for(var ye=0;ye<ee.length;ye++)he.push(z[ee[ye]]);he.push(e.outputEncoding),he.push(e.gammaFactor)}return he.push(z.onBeforeCompile.toString()),he.join()},this.acquireProgram=function(z,he){for(var me,ye=0,Ae=i.length;ye<Ae;ye++){var Le=i[ye];if(Le.cacheKey===he){++(me=Le).usedTimes;break}}return me===void 0&&(me=new Ra(e,he,z),i.push(me)),me},this.releaseProgram=function(z){if(--z.usedTimes==0){var he=i.indexOf(z);i[he]=i[i.length-1],i.pop(),z.destroy()}},this.programs=i}function rd(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Xd(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function qo(){var e=[],t=0,n=[],i=[],l={id:-1};function d(m,x,L,j,Z,ee){var ie=e[t];return ie===void 0?(ie={id:m.id,object:m,geometry:x,material:L,program:L.program||l,groupOrder:j,renderOrder:m.renderOrder,z:Z,group:ee},e[t]=ie):(ie.id=m.id,ie.object=m,ie.geometry=x,ie.material=L,ie.program=L.program||l,ie.groupOrder=j,ie.renderOrder=m.renderOrder,ie.z=Z,ie.group=ee),t++,ie}return{opaque:n,transparent:i,init:function(){t=0,n.length=0,i.length=0},push:function(m,x,L,j,Z,ee){var ie=d(m,x,L,j,Z,ee);(L.transparent===!0?i:n).push(ie)},unshift:function(m,x,L,j,Z,ee){var ie=d(m,x,L,j,Z,ee);(L.transparent===!0?i:n).unshift(ie)},sort:function(m,x){1<n.length&&n.sort(m||rd),1<i.length&&i.sort(x||Xd)}}}var Fa=0;function Eh(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Ah(){for(var e=new function(){var m={};return{get:function(x){if(m[x.id]!==void 0)return m[x.id];var L;switch(x.type){case"DirectionalLight":L={direction:new Re,color:new Qe,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new zt};break;case"SpotLight":L={position:new Re,direction:new Re,color:new Qe,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new zt};break;case"PointLight":L={position:new Re,color:new Qe,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new zt,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":L={direction:new Re,skyColor:new Qe,groundColor:new Qe};break;case"RectAreaLight":L={color:new Qe,position:new Re,halfWidth:new Re,halfHeight:new Re}}return m[x.id]=L}}},t={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++)t.probe.push(new Re);var i=new Re,l=new fr,d=new fr;return{setup:function(m,x,L){for(var j=0,Z=0,ee=0,ie=0;ie<9;ie++)t.probe[ie].set(0,0,0);var z=0,he=0,me=0,ye=0,Ae=0,Le=0,Ge=0,et=0,Fe=L.matrixWorldInverse;m.sort(Eh),ie=0;for(var at=m.length;ie<at;ie++){var Je=m[ie],xt=Je.color,Tt=Je.intensity,Et=Je.distance,At=Je.shadow&&Je.shadow.map?Je.shadow.map.texture:null;if(Je.isAmbientLight)j+=xt.r*Tt,Z+=xt.g*Tt,ee+=xt.b*Tt;else if(Je.isLightProbe)for(var Gt=0;Gt<9;Gt++)t.probe[Gt].addScaledVector(Je.sh.coefficients[Gt],Tt);else if(Je.isDirectionalLight){if((St=e.get(Je)).color.copy(Je.color).multiplyScalar(Je.intensity),St.direction.setFromMatrixPosition(Je.matrixWorld),i.setFromMatrixPosition(Je.target.matrixWorld),St.direction.sub(i),St.direction.transformDirection(Fe),St.shadow=Je.castShadow,Je.castShadow){var Yt=Je.shadow;St.shadowBias=Yt.bias,St.shadowRadius=Yt.radius,St.shadowMapSize=Yt.mapSize,t.directionalShadowMap[z]=At,t.directionalShadowMatrix[z]=Je.shadow.matrix,Le++}t.directional[z]=St,z++}else if(Je.isSpotLight)(St=e.get(Je)).position.setFromMatrixPosition(Je.matrixWorld),St.position.applyMatrix4(Fe),St.color.copy(xt).multiplyScalar(Tt),St.distance=Et,St.direction.setFromMatrixPosition(Je.matrixWorld),i.setFromMatrixPosition(Je.target.matrixWorld),St.direction.sub(i),St.direction.transformDirection(Fe),St.coneCos=Math.cos(Je.angle),St.penumbraCos=Math.cos(Je.angle*(1-Je.penumbra)),St.decay=Je.decay,St.shadow=Je.castShadow,Je.castShadow&&(Yt=Je.shadow,St.shadowBias=Yt.bias,St.shadowRadius=Yt.radius,St.shadowMapSize=Yt.mapSize,t.spotShadowMap[me]=At,t.spotShadowMatrix[me]=Je.shadow.matrix,et++),t.spot[me]=St,me++;else if(Je.isRectAreaLight)(St=e.get(Je)).color.copy(xt).multiplyScalar(Tt),St.position.setFromMatrixPosition(Je.matrixWorld),St.position.applyMatrix4(Fe),d.identity(),l.copy(Je.matrixWorld),l.premultiply(Fe),d.extractRotation(l),St.halfWidth.set(.5*Je.width,0,0),St.halfHeight.set(0,.5*Je.height,0),St.halfWidth.applyMatrix4(d),St.halfHeight.applyMatrix4(d),t.rectArea[ye]=St,ye++;else if(Je.isPointLight)(St=e.get(Je)).position.setFromMatrixPosition(Je.matrixWorld),St.position.applyMatrix4(Fe),St.color.copy(Je.color).multiplyScalar(Je.intensity),St.distance=Je.distance,St.decay=Je.decay,St.shadow=Je.castShadow,Je.castShadow&&(Yt=Je.shadow,St.shadowBias=Yt.bias,St.shadowRadius=Yt.radius,St.shadowMapSize=Yt.mapSize,St.shadowCameraNear=Yt.camera.near,St.shadowCameraFar=Yt.camera.far,t.pointShadowMap[he]=At,t.pointShadowMatrix[he]=Je.shadow.matrix,Ge++),t.point[he]=St,he++;else if(Je.isHemisphereLight){var St;(St=e.get(Je)).direction.setFromMatrixPosition(Je.matrixWorld),St.direction.transformDirection(Fe),St.direction.normalize(),St.skyColor.copy(Je.color).multiplyScalar(Tt),St.groundColor.copy(Je.groundColor).multiplyScalar(Tt),t.hemi[Ae]=St,Ae++}}t.ambient[0]=j,t.ambient[1]=Z,t.ambient[2]=ee;var _t=t.hash;_t.directionalLength===z&&_t.pointLength===he&&_t.spotLength===me&&_t.rectAreaLength===ye&&_t.hemiLength===Ae&&_t.numDirectionalShadows===Le&&_t.numPointShadows===Ge&&_t.numSpotShadows===et||(t.directional.length=z,t.spot.length=me,t.rectArea.length=ye,t.point.length=he,t.hemi.length=Ae,t.directionalShadowMap.length=Le,t.pointShadowMap.length=Ge,t.spotShadowMap.length=et,t.directionalShadowMatrix.length=Le,t.pointShadowMatrix.length=Ge,t.spotShadowMatrix.length=et,_t.directionalLength=z,_t.pointLength=he,_t.spotLength=me,_t.rectAreaLength=ye,_t.hemiLength=Ae,_t.numDirectionalShadows=Le,_t.numPointShadows=Ge,_t.numSpotShadows=et,t.version=Fa++)},state:t}}function id(){var e=new Ah,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(i){e.setup(t,n,i)},pushLight:function(i){t.push(i)},pushShadow:function(i){n.push(i)}}}function Xo(e){It.call(this),this.type="MeshDepthMaterial",this.depthPacking=oo,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(e)}function rl(e){It.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Re,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(e)}((Xo.prototype=Object.create(It.prototype)).constructor=Xo).prototype.isMeshDepthMaterial=!0,Xo.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},((rl.prototype=Object.create(It.prototype)).constructor=rl).prototype.isMeshDistanceMaterial=!0,rl.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};var ad=`uniform sampler2D shadow_pass;
|
|
uniform vec2 resolution;
|
|
uniform float radius;
|
|
#include <packing>
|
|
void main() {
|
|
float mean = 0.0;
|
|
float squared_mean = 0.0;
|
|
float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );
|
|
for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {
|
|
#ifdef HORIZONAL_PASS
|
|
vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );
|
|
mean += distribution.x;
|
|
squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
|
|
#else
|
|
float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );
|
|
mean += depth;
|
|
squared_mean += depth * depth;
|
|
#endif
|
|
}
|
|
mean = mean * HALF_SAMPLE_RATE;
|
|
squared_mean = squared_mean * HALF_SAMPLE_RATE;
|
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
}`,od=`void main() {
|
|
gl_Position = vec4( position, 1.0 );
|
|
}`;function Oh(e,t,n){var i=new Qs,l=new zt,d=new zt,m=new Jr,x=[],L=[],j={},Z={0:M,1:A,2:N},ee=new Ya({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new zt},radius:{value:4}},vertexShader:od,fragmentShader:ad}),ie=ee.clone();ie.defines.HORIZONAL_PASS=1;var z=new Cn;z.setAttribute("position",new Qt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var he=new Ti(z,ee),me=this;function ye(Fe,at){var Je=t.update(he);ee.uniforms.shadow_pass.value=Fe.map.texture,ee.uniforms.resolution.value=Fe.mapSize,ee.uniforms.radius.value=Fe.radius,e.setRenderTarget(Fe.mapPass),e.clear(),e.renderBufferDirect(at,null,Je,ee,he,null),ie.uniforms.shadow_pass.value=Fe.mapPass.texture,ie.uniforms.resolution.value=Fe.mapSize,ie.uniforms.radius.value=Fe.radius,e.setRenderTarget(Fe.map),e.clear(),e.renderBufferDirect(at,null,Je,ie,he,null)}function Ae(Fe,at,Je){var xt=Fe<<0|at<<1|Je<<2,Tt=x[xt];return Tt===void 0&&(Tt=new Xo({depthPacking:Ei,morphTargets:Fe,skinning:at}),x[xt]=Tt),Tt}function Le(Fe,at,Je){var xt=Fe<<0|at<<1|Je<<2,Tt=L[xt];return Tt===void 0&&(Tt=new rl({morphTargets:Fe,skinning:at}),L[xt]=Tt),Tt}function Ge(Fe,at,Je,xt,Tt,Et){var At=Fe.geometry,Gt=null,Yt=Ae,St=Fe.customDepthMaterial;if(Je.isPointLight===!0&&(Yt=Le,St=Fe.customDistanceMaterial),St===void 0){var _t=!1;at.morphTargets===!0&&(At.isBufferGeometry===!0?_t=At.morphAttributes&&At.morphAttributes.position&&0<At.morphAttributes.position.length:At.isGeometry===!0&&(_t=At.morphTargets&&0<At.morphTargets.length));var hn=!1;Fe.isSkinnedMesh===!0&&(at.skinning===!0?hn=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",Fe)),Gt=Yt(_t,hn,Fe.isInstancedMesh===!0)}else Gt=St;if(e.localClippingEnabled&&at.clipShadows===!0&&at.clippingPlanes.length!==0){var bn=Gt.uuid,Kn=at.uuid,qn=j[bn];qn===void 0&&(qn={},j[bn]=qn);var Bn=qn[Kn];Bn===void 0&&(Bn=Gt.clone(),qn[Kn]=Bn),Gt=Bn}return Gt.visible=at.visible,Gt.wireframe=at.wireframe,Gt.side=Et===g?at.shadowSide!==null?at.shadowSide:at.side:at.shadowSide!==null?at.shadowSide:Z[at.side],Gt.clipShadows=at.clipShadows,Gt.clippingPlanes=at.clippingPlanes,Gt.clipIntersection=at.clipIntersection,Gt.wireframeLinewidth=at.wireframeLinewidth,Gt.linewidth=at.linewidth,Je.isPointLight===!0&&Gt.isMeshDistanceMaterial===!0&&(Gt.referencePosition.setFromMatrixPosition(Je.matrixWorld),Gt.nearDistance=xt,Gt.farDistance=Tt),Gt}function et(Fe,at,Je,xt,Tt){if(Fe.visible!==!1){if(Fe.layers.test(at.layers)&&(Fe.isMesh||Fe.isLine||Fe.isPoints)&&(Fe.castShadow||Fe.receiveShadow&&Tt===g)&&(!Fe.frustumCulled||i.intersectsObject(Fe))){Fe.modelViewMatrix.multiplyMatrices(Je.matrixWorldInverse,Fe.matrixWorld);var Et=t.update(Fe),At=Fe.material;if(Array.isArray(At))for(var Gt=Et.groups,Yt=0,St=Gt.length;Yt<St;Yt++){var _t=Gt[Yt],hn=At[_t.materialIndex];if(hn&&hn.visible){var bn=Ge(Fe,hn,xt,Je.near,Je.far,Tt);e.renderBufferDirect(Je,null,Et,bn,Fe,_t)}}else At.visible&&(bn=Ge(Fe,At,xt,Je.near,Je.far,Tt),e.renderBufferDirect(Je,null,Et,bn,Fe,null))}for(var Kn=Fe.children,qn=0,Bn=Kn.length;qn<Bn;qn++)et(Kn[qn],at,Je,xt,Tt)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=V,this.render=function(Fe,at,Je){if(me.enabled!==!1&&(me.autoUpdate!==!1||me.needsUpdate!==!1)&&Fe.length!==0){var xt=e.getRenderTarget(),Tt=e.getActiveCubeFace(),Et=e.getActiveMipmapLevel(),At=e.state;At.setBlending(T),At.buffers.color.setClear(1,1,1,1),At.buffers.depth.setTest(!0),At.setScissorTest(!1);for(var Gt=0,Yt=Fe.length;Gt<Yt;Gt++){var St=Fe[Gt],_t=St.shadow;if(_t!==void 0){l.copy(_t.mapSize);var hn=_t.getFrameExtents();if(l.multiply(hn),d.copy(_t.mapSize),(l.x>n||l.y>n)&&(console.warn("THREE.WebGLShadowMap:",St,"has shadow exceeding max texture size, reducing"),l.x>n&&(d.x=Math.floor(n/hn.x),l.x=d.x*hn.x,_t.mapSize.x=d.x),l.y>n&&(d.y=Math.floor(n/hn.y),l.y=d.y*hn.y,_t.mapSize.y=d.y)),_t.map===null&&!_t.isPointLightShadow&&this.type===g){var bn={minFilter:xn,magFilter:xn,format:Gr};_t.map=new Zi(l.x,l.y,bn),_t.map.texture.name=St.name+".shadowMap",_t.mapPass=new Zi(l.x,l.y,bn),_t.camera.updateProjectionMatrix()}_t.map===null&&(bn={minFilter:dt,magFilter:dt,format:Gr},_t.map=new Zi(l.x,l.y,bn),_t.map.texture.name=St.name+".shadowMap",_t.camera.updateProjectionMatrix()),e.setRenderTarget(_t.map),e.clear();for(var Kn=_t.getViewportCount(),qn=0;qn<Kn;qn++){var Bn=_t.getViewport(qn);m.set(d.x*Bn.x,d.y*Bn.y,d.x*Bn.z,d.y*Bn.w),At.viewport(m),_t.updateMatrices(St,qn),i=_t.getFrustum(),et(at,Je,_t.camera,St,this.type)}_t.isPointLightShadow||this.type!==g||ye(_t,Je)}else console.warn("THREE.WebGLShadowMap:",St,"has no shadow.")}me.needsUpdate=!1,e.setRenderTarget(xt,Tt,Et)}}}function Ph(e,t,n){var i=n.isWebGL2,l=new function(){var pt=!1,Mn=new Jr,_n=null,ir=new Jr(0,0,0,0);return{setMask:function(cn){_n===cn||pt||(e.colorMask(cn,cn,cn,cn),_n=cn)},setLocked:function(cn){pt=cn},setClear:function(cn,wr,Or,vi,go){go===!0&&(cn*=vi,wr*=vi,Or*=vi),Mn.set(cn,wr,Or,vi),ir.equals(Mn)===!1&&(e.clearColor(cn,wr,Or,vi),ir.copy(Mn))},reset:function(){pt=!1,_n=null,ir.set(-1,0,0,0)}}},d=new function(){var pt=!1,Mn=null,_n=null,ir=null;return{setTest:function(cn){(cn?Sn:Ne)(2929)},setMask:function(cn){Mn===cn||pt||(e.depthMask(cn),Mn=cn)},setFunc:function(cn){if(_n!==cn){if(cn)switch(cn){case Be:e.depthFunc(512);break;case q:e.depthFunc(519);break;case ge:e.depthFunc(513);break;case oe:e.depthFunc(515);break;case le:e.depthFunc(514);break;case Pe:e.depthFunc(518);break;case Ye:e.depthFunc(516);break;case ze:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);_n=cn}},setLocked:function(cn){pt=cn},setClear:function(cn){ir!==cn&&(e.clearDepth(cn),ir=cn)},reset:function(){pt=!1,ir=_n=Mn=null}}},m=new function(){var pt=!1,Mn=null,_n=null,ir=null,cn=null,wr=null,Or=null,vi=null,go=null;return{setTest:function(Vr){pt||(Vr?Sn:Ne)(2960)},setMask:function(Vr){Mn===Vr||pt||(e.stencilMask(Vr),Mn=Vr)},setFunc:function(Vr,Pi,Ir){_n===Vr&&ir===Pi&&cn===Ir||(e.stencilFunc(Vr,Pi,Ir),_n=Vr,ir=Pi,cn=Ir)},setOp:function(Vr,Pi,Ir){wr===Vr&&Or===Pi&&vi===Ir||(e.stencilOp(Vr,Pi,Ir),wr=Vr,Or=Pi,vi=Ir)},setLocked:function(Vr){pt=Vr},setClear:function(Vr){go!==Vr&&(e.clearStencil(Vr),go=Vr)},reset:function(){pt=!1,go=vi=Or=wr=cn=ir=_n=Mn=null}}},x=e.getParameter(34921),L=new Uint8Array(x),j=new Uint8Array(x),Z=new Uint8Array(x),ee={},ie=null,z=null,he=null,me=null,ye=null,Ae=null,Le=null,Ge=null,et=null,Fe=!1,at=null,Je=null,xt=null,Tt=null,Et=null,At=e.getParameter(35661),Gt=!1,Yt=0,St=e.getParameter(7938);St.indexOf("WebGL")!==-1?(Yt=parseFloat(/^WebGL\ ([0-9])/.exec(St)[1]),Gt=1<=Yt):St.indexOf("OpenGL ES")!==-1&&(Yt=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(St)[1]),Gt=2<=Yt);var _t=null,hn={},bn=new Jr,Kn=new Jr;function qn(pt,Mn,_n){var ir=new Uint8Array(4),cn=e.createTexture();e.bindTexture(pt,cn),e.texParameteri(pt,10241,9728),e.texParameteri(pt,10240,9728);for(var wr=0;wr<_n;wr++)e.texImage2D(Mn+wr,0,6408,1,1,0,6408,5121,ir);return cn}var Bn={};function ur(pt,Mn){L[pt]=1,j[pt]===0&&(e.enableVertexAttribArray(pt),j[pt]=1),Z[pt]!==Mn&&((i?e:t.get("ANGLE_instanced_arrays"))[i?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](pt,Mn),Z[pt]=Mn)}function Sn(pt){ee[pt]!==!0&&(e.enable(pt),ee[pt]=!0)}function Ne(pt){ee[pt]!==!1&&(e.disable(pt),ee[pt]=!1)}Bn[3553]=qn(3553,3553,1),Bn[34067]=qn(34067,34069,6),l.setClear(0,0,0,1),d.setClear(1),m.setClear(0),Sn(2929),d.setFunc(oe),Dn(!1),Dt(D),Sn(2884),rr(T);var nt={};if(nt[C]=32774,nt[B]=32778,nt[R]=32779,i)nt[u]=32775,nt[c]=32776;else{var qt=t.get("EXT_blend_minmax");qt!==null&&(nt[u]=qt.MIN_EXT,nt[c]=qt.MAX_EXT)}var Ht={};function rr(pt,Mn,_n,ir,cn,wr,Or,vi){if(pt!==T){if(z||(Sn(3042),z=!0),pt===G)cn=cn||Mn,wr=wr||_n,Or=Or||ir,Mn===me&&cn===Le||(e.blendEquationSeparate(nt[Mn],nt[cn]),me=Mn,Le=cn),_n===ye&&ir===Ae&&wr===Ge&&Or===et||(e.blendFuncSeparate(Ht[_n],Ht[ir],Ht[wr],Ht[Or]),ye=_n,Ae=ir,Ge=wr,et=Or),he=pt,Fe=null;else if(pt!==he||vi!==Fe){if(me===C&&Le===C||(e.blendEquation(32774),Le=me=C),vi)switch(pt){case _:e.blendFuncSeparate(1,771,1,771);break;case Y:e.blendFunc(1,1);break;case k:e.blendFuncSeparate(0,0,769,771);break;case S:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",pt)}else switch(pt){case _:e.blendFuncSeparate(770,771,1,771);break;case Y:e.blendFunc(770,1);break;case k:e.blendFunc(0,769);break;case S:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",pt)}et=Ge=Ae=ye=null,he=pt,Fe=vi}}else z&&(Ne(3042),z=!1)}function Dn(pt){at!==pt&&(pt?e.frontFace(2304):e.frontFace(2305),at=pt)}function Dt(pt){pt!==b?(Sn(2884),pt!==Je&&(pt===D?e.cullFace(1029):pt===U?e.cullFace(1028):e.cullFace(1032))):Ne(2884),Je=pt}function An(pt,Mn,_n){pt?(Sn(32823),Tt===Mn&&Et===_n||(e.polygonOffset(Mn,_n),Tt=Mn,Et=_n)):Ne(32823)}function hr(pt){pt===void 0&&(pt=33984+At-1),_t!==pt&&(e.activeTexture(pt),_t=pt)}return Ht[f]=0,Ht[O]=1,Ht[W]=768,Ht[J]=770,Ht[ve]=776,Ht[be]=774,Ht[ne]=772,Ht[X]=769,Ht[te]=771,Ht[je]=775,Ht[ue]=773,{buffers:{color:l,depth:d,stencil:m},initAttributes:function(){for(var pt=0,Mn=L.length;pt<Mn;pt++)L[pt]=0},enableAttribute:function(pt){ur(pt,0)},enableAttributeAndDivisor:ur,disableUnusedAttributes:function(){for(var pt=0,Mn=j.length;pt!==Mn;++pt)j[pt]!==L[pt]&&(e.disableVertexAttribArray(pt),j[pt]=0)},enable:Sn,disable:Ne,useProgram:function(pt){return ie!==pt&&(e.useProgram(pt),ie=pt,!0)},setBlending:rr,setMaterial:function(pt,Mn){(pt.side===N?Ne:Sn)(2884);var _n=pt.side===M;Mn&&(_n=!_n),Dn(_n),pt.blending===_&&pt.transparent===!1?rr(T):rr(pt.blending,pt.blendEquation,pt.blendSrc,pt.blendDst,pt.blendEquationAlpha,pt.blendSrcAlpha,pt.blendDstAlpha,pt.premultipliedAlpha),d.setFunc(pt.depthFunc),d.setTest(pt.depthTest),d.setMask(pt.depthWrite),l.setMask(pt.colorWrite);var ir=pt.stencilWrite;m.setTest(ir),ir&&(m.setMask(pt.stencilWriteMask),m.setFunc(pt.stencilFunc,pt.stencilRef,pt.stencilFuncMask),m.setOp(pt.stencilFail,pt.stencilZFail,pt.stencilZPass)),An(pt.polygonOffset,pt.polygonOffsetFactor,pt.polygonOffsetUnits)},setFlipSided:Dn,setCullFace:Dt,setLineWidth:function(pt){pt!==xt&&(Gt&&e.lineWidth(pt),xt=pt)},setPolygonOffset:An,setScissorTest:function(pt){(pt?Sn:Ne)(3089)},activeTexture:hr,bindTexture:function(pt,Mn){_t===null&&hr();var _n=hn[_t];_n===void 0&&(_n={type:void 0,texture:void 0},hn[_t]=_n),_n.type===pt&&_n.texture===Mn||(e.bindTexture(pt,Mn||Bn[pt]),_n.type=pt,_n.texture=Mn)},unbindTexture:function(){var pt=hn[_t];pt!==void 0&&pt.type!==void 0&&(e.bindTexture(pt.type,null),pt.type=void 0,pt.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(pt){console.error("THREE.WebGLState:",pt)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(pt){console.error("THREE.WebGLState:",pt)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(pt){console.error("THREE.WebGLState:",pt)}},scissor:function(pt){bn.equals(pt)===!1&&(e.scissor(pt.x,pt.y,pt.z,pt.w),bn.copy(pt))},viewport:function(pt){Kn.equals(pt)===!1&&(e.viewport(pt.x,pt.y,pt.z,pt.w),Kn.copy(pt))},reset:function(){for(var pt=0;pt<j.length;pt++)j[pt]===1&&(e.disableVertexAttribArray(pt),j[pt]=0);ee={},hn={},Je=at=he=ie=_t=null,l.reset(),d.reset(),m.reset()}}}function sd(e,t,n,i,l,d,m){var x,L=l.isWebGL2,j=l.maxTextures,Z=l.maxCubemapSize,ee=l.maxTextureSize,ie=l.maxSamples,z=new WeakMap,he=!1;try{he=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(Ne){}function me(Ne,nt){return he?new OffscreenCanvas(Ne,nt):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function ye(Ne,nt,qt,Ht){var rr=1;if((Ne.width>Ht||Ne.height>Ht)&&(rr=Ht/Math.max(Ne.width,Ne.height)),rr<1||nt===!0){if(typeof HTMLImageElement!="undefined"&&Ne instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&Ne instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&Ne instanceof ImageBitmap){var Dn=nt?yr.floorPowerOfTwo:Math.floor,Dt=Dn(rr*Ne.width),An=Dn(rr*Ne.height);x===void 0&&(x=me(Dt,An));var hr=qt?me(Dt,An):x;return hr.width=Dt,hr.height=An,hr.getContext("2d").drawImage(Ne,0,0,Dt,An),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ne.width+"x"+Ne.height+") to ("+Dt+"x"+An+")."),hr}return"data"in Ne&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ne.width+"x"+Ne.height+")."),Ne}return Ne}function Ae(Ne){return yr.isPowerOfTwo(Ne.width)&&yr.isPowerOfTwo(Ne.height)}function Le(Ne,nt){return Ne.generateMipmaps&&nt&&Ne.minFilter!==dt&&Ne.minFilter!==xn}function Ge(Ne,nt,qt,Ht){e.generateMipmap(Ne),i.get(nt).__maxMipLevel=Math.log(Math.max(qt,Ht))*Math.LOG2E}function et(Ne,nt,qt){if(L===!1)return nt;if(Ne!==null){if(e[Ne]!==void 0)return e[Ne];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Ne+"'")}var Ht=nt;return nt===6403&&(qt===5126&&(Ht=33326),qt===5131&&(Ht=33325),qt===5121&&(Ht=33321)),nt===6407&&(qt===5126&&(Ht=34837),qt===5131&&(Ht=34843),qt===5121&&(Ht=32849)),nt===6408&&(qt===5126&&(Ht=34836),qt===5131&&(Ht=34842),qt===5121&&(Ht=32856)),Ht===33325||Ht===33326||Ht===34842||Ht===34836?t.get("EXT_color_buffer_float"):Ht!==34843&&Ht!==34837||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),Ht}function Fe(Ne){return Ne===dt||Ne===lt||Ne===Xt?9728:9729}function at(Ne){var nt=Ne.target;nt.removeEventListener("dispose",at),function(qt){var Ht=i.get(qt);Ht.__webglInit!==void 0&&(e.deleteTexture(Ht.__webglTexture),i.remove(qt))}(nt),nt.isVideoTexture&&z.delete(nt),m.memory.textures--}function Je(Ne){var nt=Ne.target;nt.removeEventListener("dispose",Je),function(qt){var Ht=i.get(qt),rr=i.get(qt.texture);if(qt){if(rr.__webglTexture!==void 0&&e.deleteTexture(rr.__webglTexture),qt.depthTexture&&qt.depthTexture.dispose(),qt.isWebGLCubeRenderTarget)for(var Dn=0;Dn<6;Dn++)e.deleteFramebuffer(Ht.__webglFramebuffer[Dn]),Ht.__webglDepthbuffer&&e.deleteRenderbuffer(Ht.__webglDepthbuffer[Dn]);else e.deleteFramebuffer(Ht.__webglFramebuffer),Ht.__webglDepthbuffer&&e.deleteRenderbuffer(Ht.__webglDepthbuffer);if(qt.isWebGLMultiviewRenderTarget){e.deleteTexture(Ht.__webglColorTexture),e.deleteTexture(Ht.__webglDepthStencilTexture),m.memory.textures-=2,Dn=0;for(var Dt=Ht.__webglViewFramebuffers.length;Dn<Dt;Dn++)e.deleteFramebuffer(Ht.__webglViewFramebuffers[Dn])}i.remove(qt.texture),i.remove(qt)}}(nt),m.memory.textures--}var xt=0;function Tt(Ne,nt){var qt,Ht,rr=i.get(Ne);if(Ne.isVideoTexture&&(qt=Ne,Ht=m.render.frame,z.get(qt)!==Ht&&(z.set(qt,Ht),qt.update())),0<Ne.version&&rr.__version!==Ne.version){var Dn=Ne.image;if(Dn===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(Dn.complete!==!1)return void hn(rr,Ne,nt);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+nt),n.bindTexture(3553,rr.__webglTexture)}function Et(Ne,nt){if(Ne.image.length===6){var qt=i.get(Ne);if(0<Ne.version&&qt.__version!==Ne.version){_t(qt,Ne),n.activeTexture(33984+nt),n.bindTexture(34067,qt.__webglTexture),e.pixelStorei(37440,Ne.flipY);for(var Ht=Ne&&(Ne.isCompressedTexture||Ne.image[0].isCompressedTexture),rr=Ne.image[0]&&Ne.image[0].isDataTexture,Dn=[],Dt=0;Dt<6;Dt++)Dn[Dt]=Ht||rr?rr?Ne.image[Dt].image:Ne.image[Dt]:ye(Ne.image[Dt],!1,!0,Z);var An,hr=Dn[0],pt=Ae(hr)||L,Mn=d.convert(Ne.format),_n=d.convert(Ne.type),ir=et(Ne.internalFormat,Mn,_n);if(St(34067,Ne,pt),Ht){for(Dt=0;Dt<6;Dt++){An=Dn[Dt].mipmaps;for(var cn=0;cn<An.length;cn++){var wr=An[cn];Ne.format!==Gr&&Ne.format!==ti?Mn!==null?n.compressedTexImage2D(34069+Dt,cn,ir,wr.width,wr.height,0,wr.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+Dt,cn,ir,wr.width,wr.height,0,Mn,_n,wr.data)}}qt.__maxMipLevel=An.length-1}else{for(An=Ne.mipmaps,Dt=0;Dt<6;Dt++)if(rr)for(n.texImage2D(34069+Dt,0,ir,Dn[Dt].width,Dn[Dt].height,0,Mn,_n,Dn[Dt].data),cn=0;cn<An.length;cn++){var Or=(wr=An[cn]).image[Dt].image;n.texImage2D(34069+Dt,cn+1,ir,Or.width,Or.height,0,Mn,_n,Or.data)}else for(n.texImage2D(34069+Dt,0,ir,Mn,_n,Dn[Dt]),cn=0;cn<An.length;cn++)wr=An[cn],n.texImage2D(34069+Dt,cn+1,ir,Mn,_n,wr.image[Dt]);qt.__maxMipLevel=An.length}Le(Ne,pt)&&Ge(34067,Ne,hr.width,hr.height),qt.__version=Ne.version,Ne.onUpdate&&Ne.onUpdate(Ne)}else n.activeTexture(33984+nt),n.bindTexture(34067,qt.__webglTexture)}}function At(Ne,nt){n.activeTexture(33984+nt),n.bindTexture(34067,i.get(Ne).__webglTexture)}var Gt={};Gt[Zt]=10497,Gt[On]=33071,Gt[Xn]=33648;var Yt={};function St(Ne,nt,qt){qt?(e.texParameteri(Ne,10242,Gt[nt.wrapS]),e.texParameteri(Ne,10243,Gt[nt.wrapT]),Ne!==32879&&Ne!==35866||e.texParameteri(Ne,32882,Gt[nt.wrapR]),e.texParameteri(Ne,10240,Yt[nt.magFilter]),e.texParameteri(Ne,10241,Yt[nt.minFilter])):(e.texParameteri(Ne,10242,33071),e.texParameteri(Ne,10243,33071),Ne!==32879&&Ne!==35866||e.texParameteri(Ne,32882,33071),nt.wrapS===On&&nt.wrapT===On||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(Ne,10240,Fe(nt.magFilter)),e.texParameteri(Ne,10241,Fe(nt.minFilter)),nt.minFilter!==dt&&nt.minFilter!==xn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var Ht=t.get("EXT_texture_filter_anisotropic");if(Ht){if(nt.type===Mt&&t.get("OES_texture_float_linear")===null||nt.type===rn&&(L||t.get("OES_texture_half_float_linear"))===null)return;(1<nt.anisotropy||i.get(nt).__currentAnisotropy)&&(e.texParameterf(Ne,Ht.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(nt.anisotropy,l.getMaxAnisotropy())),i.get(nt).__currentAnisotropy=nt.anisotropy)}}function _t(Ne,nt){Ne.__webglInit===void 0&&(Ne.__webglInit=!0,nt.addEventListener("dispose",at),Ne.__webglTexture=e.createTexture(),m.memory.textures++)}function hn(Ne,nt,qt){var Ht=3553;nt.isDataTexture2DArray&&(Ht=35866),nt.isDataTexture3D&&(Ht=32879),_t(Ne,nt),n.activeTexture(33984+qt),n.bindTexture(Ht,Ne.__webglTexture),e.pixelStorei(37440,nt.flipY),e.pixelStorei(37441,nt.premultiplyAlpha),e.pixelStorei(3317,nt.unpackAlignment);var rr,Dn=(rr=nt,!L&&(rr.wrapS!==On||rr.wrapT!==On||rr.minFilter!==dt&&rr.minFilter!==xn)&&Ae(nt.image)===!1),Dt=ye(nt.image,Dn,!1,ee),An=Ae(Dt)||L,hr=d.convert(nt.format),pt=d.convert(nt.type),Mn=et(nt.internalFormat,hr,pt);St(Ht,nt,An);var _n,ir=nt.mipmaps;if(nt.isDepthTexture){if(Mn=6402,nt.type===Mt){if(L===!1)throw new Error("Float Depth Texture only supported in WebGL2.0");Mn=36012}else L&&(Mn=33189);nt.format===or&&Mn===6402&&nt.type!==We&&nt.type!==Ie&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),nt.type=We,pt=d.convert(nt.type)),nt.format===ni&&(Mn=34041,nt.type!==Mr&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),nt.type=Mr,pt=d.convert(nt.type))),n.texImage2D(3553,0,Mn,Dt.width,Dt.height,0,hr,pt,null)}else if(nt.isDataTexture)if(0<ir.length&&An){for(var cn=0,wr=ir.length;cn<wr;cn++)_n=ir[cn],n.texImage2D(3553,cn,Mn,_n.width,_n.height,0,hr,pt,_n.data);nt.generateMipmaps=!1,Ne.__maxMipLevel=ir.length-1}else n.texImage2D(3553,0,Mn,Dt.width,Dt.height,0,hr,pt,Dt.data),Ne.__maxMipLevel=0;else if(nt.isCompressedTexture){for(cn=0,wr=ir.length;cn<wr;cn++)_n=ir[cn],nt.format!==Gr&&nt.format!==ti?hr!==null?n.compressedTexImage2D(3553,cn,Mn,_n.width,_n.height,0,_n.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,cn,Mn,_n.width,_n.height,0,hr,pt,_n.data);Ne.__maxMipLevel=ir.length-1}else if(nt.isDataTexture2DArray)n.texImage3D(35866,0,Mn,Dt.width,Dt.height,Dt.depth,0,hr,pt,Dt.data),Ne.__maxMipLevel=0;else if(nt.isDataTexture3D)n.texImage3D(32879,0,Mn,Dt.width,Dt.height,Dt.depth,0,hr,pt,Dt.data),Ne.__maxMipLevel=0;else if(0<ir.length&&An){for(cn=0,wr=ir.length;cn<wr;cn++)_n=ir[cn],n.texImage2D(3553,cn,Mn,hr,pt,_n);nt.generateMipmaps=!1,Ne.__maxMipLevel=ir.length-1}else n.texImage2D(3553,0,Mn,hr,pt,Dt),Ne.__maxMipLevel=0;Le(nt,An)&&Ge(Ht,nt,Dt.width,Dt.height),Ne.__version=nt.version,nt.onUpdate&&nt.onUpdate(nt)}function bn(Ne,nt,qt,Ht){var rr=d.convert(nt.texture.format),Dn=d.convert(nt.texture.type),Dt=et(nt.texture.internalFormat,rr,Dn);n.texImage2D(Ht,0,Dt,nt.width,nt.height,0,rr,Dn,null),e.bindFramebuffer(36160,Ne),e.framebufferTexture2D(36160,qt,Ht,i.get(nt.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function Kn(Ne,nt,qt){if(e.bindRenderbuffer(36161,Ne),nt.depthBuffer&&!nt.stencilBuffer){if(qt){var Ht=Bn(nt);e.renderbufferStorageMultisample(36161,Ht,33189,nt.width,nt.height)}else e.renderbufferStorage(36161,33189,nt.width,nt.height);e.framebufferRenderbuffer(36160,36096,36161,Ne)}else if(nt.depthBuffer&&nt.stencilBuffer)qt?(Ht=Bn(nt),e.renderbufferStorageMultisample(36161,Ht,35056,nt.width,nt.height)):e.renderbufferStorage(36161,34041,nt.width,nt.height),e.framebufferRenderbuffer(36160,33306,36161,Ne);else{var rr=d.convert(nt.texture.format),Dn=d.convert(nt.texture.type),Dt=et(nt.texture.internalFormat,rr,Dn);qt?(Ht=Bn(nt),e.renderbufferStorageMultisample(36161,Ht,Dt,nt.width,nt.height)):e.renderbufferStorage(36161,Dt,nt.width,nt.height)}e.bindRenderbuffer(36161,null)}function qn(Ne){var nt=i.get(Ne),qt=Ne.isWebGLCubeRenderTarget===!0;if(Ne.depthTexture){if(qt)throw new Error("target.depthTexture not supported in Cube render targets");(function(rr,Dn){if(Dn&&Dn.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,rr),!Dn.depthTexture||!Dn.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(Dn.depthTexture).__webglTexture&&Dn.depthTexture.image.width===Dn.width&&Dn.depthTexture.image.height===Dn.height||(Dn.depthTexture.image.width=Dn.width,Dn.depthTexture.image.height=Dn.height,Dn.depthTexture.needsUpdate=!0),Tt(Dn.depthTexture,0);var Dt=i.get(Dn.depthTexture).__webglTexture;if(Dn.depthTexture.format===or)e.framebufferTexture2D(36160,36096,3553,Dt,0);else{if(Dn.depthTexture.format!==ni)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,Dt,0)}})(nt.__webglFramebuffer,Ne)}else if(qt){nt.__webglDepthbuffer=[];for(var Ht=0;Ht<6;Ht++)e.bindFramebuffer(36160,nt.__webglFramebuffer[Ht]),nt.__webglDepthbuffer[Ht]=e.createRenderbuffer(),Kn(nt.__webglDepthbuffer[Ht],Ne)}else e.bindFramebuffer(36160,nt.__webglFramebuffer),nt.__webglDepthbuffer=e.createRenderbuffer(),Kn(nt.__webglDepthbuffer,Ne);e.bindFramebuffer(36160,null)}function Bn(Ne){return L&&Ne.isWebGLMultisampleRenderTarget?Math.min(ie,Ne.samples):0}Yt[dt]=9728,Yt[lt]=9984,Yt[Xt]=9986,Yt[xn]=9729,Yt[$t]=9985;var ur=!(Yt[Yn]=9987),Sn=!1;this.allocateTextureUnit=function(){var Ne=xt;return j<=Ne&&console.warn("THREE.WebGLTextures: Trying to use "+Ne+" texture units while this GPU supports only "+j),xt+=1,Ne},this.resetTextureUnits=function(){xt=0},this.setTexture2D=Tt,this.setTexture2DArray=function(Ne,nt){var qt=i.get(Ne);0<Ne.version&&qt.__version!==Ne.version?hn(qt,Ne,nt):(n.activeTexture(33984+nt),n.bindTexture(35866,qt.__webglTexture))},this.setTexture3D=function(Ne,nt){var qt=i.get(Ne);0<Ne.version&&qt.__version!==Ne.version?hn(qt,Ne,nt):(n.activeTexture(33984+nt),n.bindTexture(32879,qt.__webglTexture))},this.setTextureCube=Et,this.setTextureCubeDynamic=At,this.setupRenderTarget=function(Ne){var nt=i.get(Ne),qt=i.get(Ne.texture);Ne.addEventListener("dispose",Je),qt.__webglTexture=e.createTexture(),m.memory.textures++;var Ht=Ne.isWebGLCubeRenderTarget===!0,rr=Ne.isWebGLMultisampleRenderTarget===!0,Dn=Ne.isWebGLMultiviewRenderTarget===!0,Dt=Ae(Ne)||L;if(Ht){nt.__webglFramebuffer=[];for(var An=0;An<6;An++)nt.__webglFramebuffer[An]=e.createFramebuffer()}else if(nt.__webglFramebuffer=e.createFramebuffer(),rr)if(L){nt.__webglMultisampledFramebuffer=e.createFramebuffer(),nt.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,nt.__webglColorRenderbuffer);var hr=d.convert(Ne.texture.format),pt=d.convert(Ne.texture.type),Mn=et(Ne.texture.internalFormat,hr,pt),_n=Bn(Ne);e.renderbufferStorageMultisample(36161,_n,Mn,Ne.width,Ne.height),e.bindFramebuffer(36160,nt.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,nt.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),Ne.depthBuffer&&(nt.__webglDepthRenderbuffer=e.createRenderbuffer(),Kn(nt.__webglDepthRenderbuffer,Ne,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(Dn){var ir=Ne.width,cn=Ne.height,wr=Ne.numViews;e.bindFramebuffer(36160,nt.__webglFramebuffer);var Or=t.get("OVR_multiview2");m.memory.textures+=2;var vi=e.createTexture();e.bindTexture(35866,vi),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,32856,ir,cn,wr,0,6408,5121,null),Or.framebufferTextureMultiviewOVR(36160,36064,vi,0,0,wr);var go=e.createTexture();e.bindTexture(35866,go),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,35056,ir,cn,wr,0,34041,34042,null),Or.framebufferTextureMultiviewOVR(36160,33306,go,0,0,wr);var Vr=new Array(wr);for(An=0;An<wr;++An)Vr[An]=e.createFramebuffer(),e.bindFramebuffer(36160,Vr[An]),e.framebufferTextureLayer(36160,36064,vi,0,An);nt.__webglColorTexture=vi,nt.__webglDepthStencilTexture=go,nt.__webglViewFramebuffers=Vr,e.bindFramebuffer(36160,null),e.bindTexture(35866,null)}if(Ht){for(n.bindTexture(34067,qt.__webglTexture),St(34067,Ne.texture,Dt),An=0;An<6;An++)bn(nt.__webglFramebuffer[An],Ne,36064,34069+An);Le(Ne.texture,Dt)&&Ge(34067,Ne.texture,Ne.width,Ne.height),n.bindTexture(34067,null)}else Dn||(n.bindTexture(3553,qt.__webglTexture),St(3553,Ne.texture,Dt),bn(nt.__webglFramebuffer,Ne,36064,3553),Le(Ne.texture,Dt)&&Ge(3553,Ne.texture,Ne.width,Ne.height),n.bindTexture(3553,null));Ne.depthBuffer&&qn(Ne)},this.updateRenderTargetMipmap=function(Ne){var nt=Ne.texture;if(Le(nt,Ae(Ne)||L)){var qt=Ne.isWebGLCubeRenderTarget?34067:3553,Ht=i.get(nt).__webglTexture;n.bindTexture(qt,Ht),Ge(qt,nt,Ne.width,Ne.height),n.bindTexture(qt,null)}},this.updateMultisampleRenderTarget=function(Ne){if(Ne.isWebGLMultisampleRenderTarget)if(L){var nt=i.get(Ne);e.bindFramebuffer(36008,nt.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,nt.__webglFramebuffer);var qt=Ne.width,Ht=Ne.height,rr=16384;Ne.depthBuffer&&(rr|=256),Ne.stencilBuffer&&(rr|=1024),e.blitFramebuffer(0,0,qt,Ht,0,0,qt,Ht,rr,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(Ne,nt){Ne&&Ne.isWebGLRenderTarget&&(ur===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),ur=!0),Ne=Ne.texture),Tt(Ne,nt)},this.safeSetTextureCube=function(Ne,nt){Ne&&Ne.isWebGLCubeRenderTarget&&(Sn===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Sn=!0),Ne=Ne.texture),(Ne&&Ne.isCubeTexture||Array.isArray(Ne.image)&&Ne.image.length===6?Et:At)(Ne,nt)}}function Nl(e,t,n){var i=n.isWebGL2;return{convert:function(l){var d;if(l===kr)return 5121;if(l===tn)return 32819;if(l===En)return 32820;if(l===br)return 33635;if(l===Br)return 5120;if(l===$e)return 5122;if(l===We)return 5123;if(l===ut)return 5124;if(l===Ie)return 5125;if(l===Mt)return 5126;if(l===rn)return i?5131:(d=t.get("OES_texture_half_float"))!==null?d.HALF_FLOAT_OES:null;if(l===Tr)return 6406;if(l===ti)return 6407;if(l===Gr)return 6408;if(l===ba)return 6409;if(l===Di)return 6410;if(l===or)return 6402;if(l===ni)return 34041;if(l===H)return 6403;if(l===Nr)return 36244;if(l===Ri)return 33319;if(l===Zn)return 33320;if(l===Xi)return 36248;if(l===xo)return 36249;if(l===Bs||l===ts||l===ms||l===no){if((d=t.get("WEBGL_compressed_texture_s3tc"))===null)return null;if(l===Bs)return d.COMPRESSED_RGB_S3TC_DXT1_EXT;if(l===ts)return d.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(l===ms)return d.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(l===no)return d.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(l===ns||l===la||l===Fo||l===Aa){if((d=t.get("WEBGL_compressed_texture_pvrtc"))===null)return null;if(l===ns)return d.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(l===la)return d.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(l===Fo)return d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(l===Aa)return d.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return l===gs?(d=t.get("WEBGL_compressed_texture_etc1"))!==null?d.COMPRESSED_RGB_ETC1_WEBGL:null:l===Gs||l===ro||l===ys||l===Oa||l===vs||l===io||l===ao||l===qr||l===Dr||l===rs||l===xs||l===is||l===Bo||l===Yi?(d=t.get("WEBGL_compressed_texture_astc"))!==null?l:null:l===Mr?i?34042:(d=t.get("WEBGL_depth_texture"))!==null?d.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function fc(e,t,n,i){Zi.call(this,e,t,i),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}function mc(e){Ni.call(this),this.cameras=e||[]}function il(){Pt.call(this),this.type="Group"}function gc(e,t){var n=this,i=null,l=null,d="local-floor",m=null,x=[],L=new Map,j=new Ni;j.layers.enable(1),j.viewport=new Jr;var Z=new Ni;Z.layers.enable(2),Z.viewport=new Jr;var ee=new mc([j,Z]);ee.layers.enable(1),ee.layers.enable(2);var ie=null,z=null;function he(Je){var xt=L.get(Je.inputSource);xt&&(xt.targetRay&&xt.targetRay.dispatchEvent({type:Je.type}),xt.grip&&xt.grip.dispatchEvent({type:Je.type}))}function me(){L.forEach(function(Je,xt){Je.targetRay&&(Je.targetRay.dispatchEvent({type:"disconnected",data:xt}),Je.targetRay.visible=!1),Je.grip&&(Je.grip.dispatchEvent({type:"disconnected",data:xt}),Je.grip.visible=!1)}),L.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),at.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function ye(Je){l=Je,at.setContext(i),at.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function Ae(Je){for(var xt=i.inputSources,Tt=0;Tt<x.length;Tt++)L.set(xt[Tt],x[Tt]);for(Tt=0;Tt<Je.removed.length;Tt++){var Et=Je.removed[Tt];(At=L.get(Et))&&(At.targetRay&&At.targetRay.dispatchEvent({type:"disconnected",data:Et}),At.grip&&At.grip.dispatchEvent({type:"disconnected",data:Et}),L.delete(Et))}for(Tt=0;Tt<Je.added.length;Tt++){var At;Et=Je.added[Tt],(At=L.get(Et))&&(At.targetRay&&At.targetRay.dispatchEvent({type:"connected",data:Et}),At.grip&&At.grip.dispatchEvent({type:"connected",data:Et}))}}this.enabled=!1,this.isPresenting=!1,this.getController=function(Je){var xt=x[Je];return xt===void 0&&(xt={},x[Je]=xt),xt.targetRay===void 0&&(xt.targetRay=new il,xt.targetRay.matrixAutoUpdate=!1,xt.targetRay.visible=!1),xt.targetRay},this.getControllerGrip=function(Je){var xt=x[Je];return xt===void 0&&(xt={},x[Je]=xt),xt.grip===void 0&&(xt.grip=new il,xt.grip.matrixAutoUpdate=!1,xt.grip.visible=!1),xt.grip},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(Je){d=Je},this.getReferenceSpace=function(){return l},this.getSession=function(){return i},this.setSession=function(Je){if((i=Je)!==null){i.addEventListener("select",he),i.addEventListener("selectstart",he),i.addEventListener("selectend",he),i.addEventListener("squeeze",he),i.addEventListener("squeezestart",he),i.addEventListener("squeezeend",he),i.addEventListener("end",me);var xt=t.getContextAttributes(),Tt={antialias:xt.antialias,alpha:xt.alpha,depth:xt.depth,stencil:xt.stencil},Et=new XRWebGLLayer(i,t,Tt);i.updateRenderState({baseLayer:Et}),i.requestReferenceSpace(d).then(ye),i.addEventListener("inputsourceschange",Ae)}};var Le=new Re,Ge=new Re;function et(Je,xt){xt===null?Je.matrixWorld.copy(Je.matrix):Je.matrixWorld.multiplyMatrices(xt.matrixWorld,Je.matrix),Je.matrixWorldInverse.getInverse(Je.matrixWorld)}this.getCamera=function(Je){ee.near=Z.near=j.near=Je.near,ee.far=Z.far=j.far=Je.far,ie===ee.near&&z===ee.far||(i.updateRenderState({depthNear:ee.near,depthFar:ee.far}),ie=ee.near,z=ee.far);var xt=Je.parent,Tt=ee.cameras;et(ee,xt);for(var Et=0;Et<Tt.length;Et++)et(Tt[Et],xt);Je.matrixWorld.copy(ee.matrixWorld);for(var At=Je.children,Gt=(Et=0,At.length);Et<Gt;Et++)At[Et].updateMatrixWorld(!0);return function(Yt,St,_t){Le.setFromMatrixPosition(St.matrixWorld),Ge.setFromMatrixPosition(_t.matrixWorld);var hn=Le.distanceTo(Ge),bn=St.projectionMatrix.elements,Kn=_t.projectionMatrix.elements,qn=bn[14]/(bn[10]-1),Bn=bn[14]/(bn[10]+1),ur=(bn[9]+1)/bn[5],Sn=(bn[9]-1)/bn[5],Ne=(bn[8]-1)/bn[0],nt=(Kn[8]+1)/Kn[0],qt=qn*Ne,Ht=qn*nt,rr=hn/(nt-Ne),Dn=rr*-Ne;St.matrixWorld.decompose(Yt.position,Yt.quaternion,Yt.scale),Yt.translateX(Dn),Yt.translateZ(rr),Yt.matrixWorld.compose(Yt.position,Yt.quaternion,Yt.scale),Yt.matrixWorldInverse.getInverse(Yt.matrixWorld);var Dt=qn+rr,An=Bn+rr,hr=qt-Dn,pt=hn-Dn+Ht,Mn=ur*Bn/An*Dt,_n=Sn*Bn/An*Dt;Yt.projectionMatrix.makePerspective(hr,pt,Mn,_n,Dt,An)}(ee,j,Z),ee};var Fe=null,at=new uh;at.setAnimationLoop(function(Je,xt){if((m=xt.getViewerPose(l))!==null){var Tt=m.views,Et=i.renderState.baseLayer;e.setFramebuffer(Et.framebuffer);for(var At=0;At<Tt.length;At++){var Gt=Tt[At],Yt=Et.getViewport(Gt),St=ee.cameras[At];St.matrix.fromArray(Gt.transform.matrix),St.projectionMatrix.fromArray(Gt.projectionMatrix),St.viewport.set(Yt.x,Yt.y,Yt.width,Yt.height),At===0&&ee.matrix.copy(St.matrix)}}var _t=i.inputSources;for(At=0;At<x.length;At++){var hn=x[At],bn=_t[At],Kn=null,qn=null;bn&&(hn.targetRay&&(Kn=xt.getPose(bn.targetRaySpace,l))!==null&&(hn.targetRay.matrix.fromArray(Kn.transform.matrix),hn.targetRay.matrix.decompose(hn.targetRay.position,hn.targetRay.rotation,hn.targetRay.scale)),hn.grip&&bn.gripSpace&&(qn=xt.getPose(bn.gripSpace,l))!==null&&(hn.grip.matrix.fromArray(qn.transform.matrix),hn.grip.matrix.decompose(hn.grip.position,hn.grip.rotation,hn.grip.scale))),hn.targetRay&&(hn.targetRay.visible=Kn!==null),hn.grip&&(hn.grip.visible=qn!==null)}Fe&&Fe(Je,xt)}),this.setAnimationLoop=function(Je){Fe=Je},this.dispose=function(){}}function Du(e){var t=(e=e||{}).canvas!==void 0?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=e.context!==void 0?e.context:null,i=e.alpha!==void 0&&e.alpha,l=e.depth===void 0||e.depth,d=e.stencil===void 0||e.stencil,m=e.antialias!==void 0&&e.antialias,x=e.premultipliedAlpha===void 0||e.premultipliedAlpha,L=e.preserveDrawingBuffer!==void 0&&e.preserveDrawingBuffer,j=e.powerPreference!==void 0?e.powerPreference:"default",Z=e.failIfMajorPerformanceCaveat!==void 0&&e.failIfMajorPerformanceCaveat,ee=null,ie=null;this.domElement=t,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=Ke,this.physicallyCorrectLights=!1,this.toneMapping=st,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var z,he,me,ye,Ae,Le,Ge,et,Fe,at,Je,xt,Tt,Et,At,Gt,Yt,St,_t=this,hn=!1,bn=null,Kn=0,qn=0,Bn=null,ur=null,Sn=-1,Ne={geometry:null,program:null,wireframe:!1},nt=null,qt=null,Ht=new Jr,rr=new Jr,Dn=null,Dt=t.width,An=t.height,hr=1,pt=null,Mn=null,_n=new Jr(0,0,Dt,An),ir=new Jr(0,0,Dt,An),cn=!1,wr=new Qs,Or=new function(){var Ee=this,Ze=null,qe=0,ht=!1,bt=!1,pn=new ia,fn=new Ai,ln={value:null,needsUpdate:!1};function yn(){ln.value!==Ze&&(ln.value=Ze,ln.needsUpdate=0<qe),Ee.numPlanes=qe,Ee.numIntersection=0}function Bt(en,Fn,Un,un){var sn=en!==null?en.length:0,$n=null;if(sn!==0){if($n=ln.value,un!==!0||$n===null){var ar=Un+4*sn,mr=Fn.matrixWorldInverse;fn.getNormalMatrix(mr),($n===null||$n.length<ar)&&($n=new Float32Array(ar));for(var ai=0,Fr=Un;ai!==sn;++ai,Fr+=4)pn.copy(en[ai]).applyMatrix4(mr,fn),pn.normal.toArray($n,Fr),$n[Fr+3]=pn.constant}ln.value=$n,ln.needsUpdate=!0}return Ee.numPlanes=sn,$n}this.uniform=ln,this.numPlanes=0,this.numIntersection=0,this.init=function(en,Fn,Un){var un=en.length!==0||Fn||qe!==0||ht;return ht=Fn,Ze=Bt(en,Un,0),qe=en.length,un},this.beginShadows=function(){bt=!0,Bt(null)},this.endShadows=function(){bt=!1,yn()},this.setState=function(en,Fn,Un,un,sn,$n){if(!ht||en===null||en.length===0||bt&&!Un)bt?Bt(null):yn();else{var ar=bt?0:qe,mr=4*ar,ai=sn.clippingState||null;ln.value=ai,ai=Bt(en,un,mr,$n);for(var Fr=0;Fr!==mr;++Fr)ai[Fr]=Ze[Fr];sn.clippingState=ai,this.numIntersection=Fn?this.numPlanes:0,this.numPlanes+=ar}}},vi=!1,go=!1,Vr=new fr,Pi=new Re;function Ir(){return Bn===null?hr:1}try{var si={alpha:i,depth:l,stencil:d,antialias:m,premultipliedAlpha:x,preserveDrawingBuffer:L,powerPreference:j,failIfMajorPerformanceCaveat:Z,xrCompatible:!0};t.addEventListener("webglcontextlost",yo,!1),t.addEventListener("webglcontextrestored",fs,!1);var xi="webgl";if(e.webgl2===!0&&(xi="webgl2"),(z=n||t.getContext(xi,si)||t.getContext("experimental-webgl",si))===null)throw t.getContext("webgl")!==null?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");e.retver=xi,z.getShaderPrecisionFormat===void 0&&(z.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Ee){throw console.error("THREE.WebGLRenderer: "+Ee.message),Ee}function sa(){he=new function(Ee){var Ze={};return{get:function(qe){if(Ze[qe]!==void 0)return Ze[qe];var ht;switch(qe){case"WEBGL_depth_texture":ht=Ee.getExtension("WEBGL_depth_texture")||Ee.getExtension("MOZ_WEBGL_depth_texture")||Ee.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":ht=Ee.getExtension("EXT_texture_filter_anisotropic")||Ee.getExtension("MOZ_EXT_texture_filter_anisotropic")||Ee.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":ht=Ee.getExtension("WEBGL_compressed_texture_s3tc")||Ee.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||Ee.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":ht=Ee.getExtension("WEBGL_compressed_texture_pvrtc")||Ee.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:ht=Ee.getExtension(qe)}return ht===null&&console.warn("THREE.WebGLRenderer: "+qe+" extension not supported."),Ze[qe]=ht}}}(z),(me=new function(Ee,Ze,qe){var ht;function bt(Fr){if(Fr==="highp"){if(0<Ee.getShaderPrecisionFormat(35633,36338).precision&&0<Ee.getShaderPrecisionFormat(35632,36338).precision)return"highp";Fr="mediump"}return Fr==="mediump"&&0<Ee.getShaderPrecisionFormat(35633,36337).precision&&0<Ee.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var pn=typeof WebGL2RenderingContext!="undefined"&&Ee instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&Ee instanceof WebGL2ComputeRenderingContext,fn=qe.precision!==void 0?qe.precision:"highp",ln=bt(fn);ln!==fn&&(console.warn("THREE.WebGLRenderer:",fn,"not supported, using",ln,"instead."),fn=ln);var yn=qe.logarithmicDepthBuffer===!0,Bt=Ee.getParameter(34930),en=Ee.getParameter(35660),Fn=Ee.getParameter(3379),Un=Ee.getParameter(34076),un=Ee.getParameter(34921),sn=Ee.getParameter(36347),$n=Ee.getParameter(36348),ar=Ee.getParameter(36349),mr=0<en,ai=pn||!!Ze.get("OES_texture_float");return{isWebGL2:pn,getMaxAnisotropy:function(){if(ht!==void 0)return ht;var Fr=Ze.get("EXT_texture_filter_anisotropic");return ht=Fr!==null?Ee.getParameter(Fr.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:bt,precision:fn,logarithmicDepthBuffer:yn,maxTextures:Bt,maxVertexTextures:en,maxTextureSize:Fn,maxCubemapSize:Un,maxAttributes:un,maxVertexUniforms:sn,maxVaryings:$n,maxFragmentUniforms:ar,vertexTextures:mr,floatFragmentTextures:ai,floatVertexTextures:mr&&ai,maxSamples:pn?Ee.getParameter(36183):0}}(z,he,e)).isWebGL2===!1&&(he.get("WEBGL_depth_texture"),he.get("OES_texture_float"),he.get("OES_texture_half_float"),he.get("OES_texture_half_float_linear"),he.get("OES_standard_derivatives"),he.get("OES_element_index_uint"),he.get("ANGLE_instanced_arrays")),he.get("OES_texture_float_linear"),St=new Nl(0,he,me),(ye=new Ph(z,he,me)).scissor(rr.copy(ir).multiplyScalar(hr).floor()),ye.viewport(Ht.copy(_n).multiplyScalar(hr).floor()),Ae=new function(Ee){var Ze={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:Ze,programs:null,autoReset:!0,reset:function(){Ze.frame++,Ze.calls=0,Ze.triangles=0,Ze.points=0,Ze.lines=0},update:function(qe,ht,bt){switch(bt=bt||1,Ze.calls++,ht){case 4:Ze.triangles+=bt*(qe/3);break;case 1:Ze.lines+=bt*(qe/2);break;case 3:Ze.lines+=bt*(qe-1);break;case 2:Ze.lines+=bt*qe;break;case 0:Ze.points+=bt*qe;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",ht)}}}},Le=new function(){var Ee=new WeakMap;return{get:function(Ze){var qe=Ee.get(Ze);return qe===void 0&&(qe={},Ee.set(Ze,qe)),qe},remove:function(Ze){Ee.delete(Ze)},update:function(Ze,qe,ht){Ee.get(Ze)[qe]=ht},dispose:function(){Ee=new WeakMap}}},Ge=new sd(z,he,ye,Le,me,St,Ae),et=new function(Ee,Ze){var qe=Ze.isWebGL2,ht=new WeakMap;return{get:function(bt){return bt.isInterleavedBufferAttribute&&(bt=bt.data),ht.get(bt)},remove:function(bt){bt.isInterleavedBufferAttribute&&(bt=bt.data);var pn=ht.get(bt);pn&&(Ee.deleteBuffer(pn.buffer),ht.delete(bt))},update:function(bt,pn){bt.isInterleavedBufferAttribute&&(bt=bt.data);var fn,ln,yn,Bt,en,Fn=ht.get(bt);Fn===void 0?ht.set(bt,function(Un,un){var sn=Un.array,$n=Un.usage,ar=Ee.createBuffer();Ee.bindBuffer(un,ar),Ee.bufferData(un,sn,$n),Un.onUploadCallback();var mr=5126;return sn instanceof Float32Array?mr=5126:sn instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):sn instanceof Uint16Array?mr=5123:sn instanceof Int16Array?mr=5122:sn instanceof Uint32Array?mr=5125:sn instanceof Int32Array?mr=5124:sn instanceof Int8Array?mr=5120:sn instanceof Uint8Array&&(mr=5121),{buffer:ar,type:mr,bytesPerElement:sn.BYTES_PER_ELEMENT,version:Un.version}}(bt,pn)):Fn.version<bt.version&&(fn=Fn.buffer,yn=pn,Bt=(ln=bt).array,en=ln.updateRange,Ee.bindBuffer(yn,fn),en.count===-1?Ee.bufferSubData(yn,0,Bt):(qe?Ee.bufferSubData(yn,en.offset*Bt.BYTES_PER_ELEMENT,Bt,en.offset,en.count):Ee.bufferSubData(yn,en.offset*Bt.BYTES_PER_ELEMENT,Bt.subarray(en.offset,en.offset+en.count)),en.count=-1),Fn.version=bt.version)}}}(z,me),Fe=new function(Ee,Ze,qe){var ht=new WeakMap,bt=new WeakMap;function pn(ln){var yn=ln.target,Bt=ht.get(yn);for(var en in Bt.index!==null&&Ze.remove(Bt.index),Bt.attributes)Ze.remove(Bt.attributes[en]);yn.removeEventListener("dispose",pn),ht.delete(yn);var Fn=bt.get(Bt);Fn&&(Ze.remove(Fn),bt.delete(Bt)),qe.memory.geometries--}function fn(ln){var yn=[],Bt=ln.index,en=ln.attributes.position,Fn=0;if(Bt!==null){var Un=Bt.array;Fn=Bt.version;for(var un=0,sn=Un.length;un<sn;un+=3){var $n=Un[un+0],ar=Un[un+1],mr=Un[un+2];yn.push($n,ar,ar,mr,mr,$n)}}else for(Un=en.array,Fn=en.version,un=0,sn=Un.length/3-1;un<sn;un+=3)$n=un+0,ar=un+1,mr=un+2,yn.push($n,ar,ar,mr,mr,$n);var ai=new(65535<$i(yn)?_i:pi)(yn,1);ai.version=Fn,Ze.update(ai,34963);var Fr=bt.get(ln);Fr&&Ze.remove(Fr),bt.set(ln,ai)}return{get:function(ln,yn){var Bt=ht.get(yn);return Bt||(yn.addEventListener("dispose",pn),yn.isBufferGeometry?Bt=yn:yn.isGeometry&&(yn._bufferGeometry===void 0&&(yn._bufferGeometry=new Cn().setFromObject(ln)),Bt=yn._bufferGeometry),ht.set(yn,Bt),qe.memory.geometries++,Bt)},update:function(ln){var yn=ln.index,Bt=ln.attributes;for(var en in yn!==null&&Ze.update(yn,34963),Bt)Ze.update(Bt[en],34962);var Fn=ln.morphAttributes;for(var en in Fn)for(var Un=Fn[en],un=0,sn=Un.length;un<sn;un++)Ze.update(Un[un],34962)},getWireframeAttribute:function(ln){var yn=bt.get(ln);if(yn){var Bt=ln.index;Bt!==null&&yn.version<Bt.version&&fn(ln)}else fn(ln);return bt.get(ln)}}}(0,et,Ae),at=new function(Ee,Ze,qe,ht){var bt={};return{update:function(pn){var fn=ht.render.frame,ln=pn.geometry,yn=Ze.get(pn,ln);return bt[yn.id]!==fn&&(ln.isGeometry&&yn.updateFromObject(pn),Ze.update(yn),bt[yn.id]=fn),pn.isInstancedMesh&&qe.update(pn.instanceMatrix,34962),yn},dispose:function(){bt={}}}}(0,Fe,et,Ae),At=new function(Ee){var Ze={},qe=new Float32Array(8);return{update:function(ht,bt,pn,fn){var ln=ht.morphTargetInfluences,yn=ln===void 0?0:ln.length,Bt=Ze[bt.id];if(Bt===void 0){Bt=[];for(var en=0;en<yn;en++)Bt[en]=[en,0];Ze[bt.id]=Bt}var Fn=pn.morphTargets&&bt.morphAttributes.position,Un=pn.morphNormals&&bt.morphAttributes.normal;for(en=0;en<yn;en++)(sn=Bt[en])[1]!==0&&(Fn&&bt.deleteAttribute("morphTarget"+en),Un&&bt.deleteAttribute("morphNormal"+en));for(en=0;en<yn;en++)(sn=Bt[en])[0]=en,sn[1]=ln[en];Bt.sort(hc);var un=0;for(en=0;en<8;en++){var sn;if(sn=Bt[en]){var $n=sn[0],ar=sn[1];if(ar){Fn&&bt.setAttribute("morphTarget"+en,Fn[$n]),Un&&bt.setAttribute("morphNormal"+en,Un[$n]),un+=qe[en]=ar;continue}}qe[en]=0}var mr=bt.morphTargetsRelative?1:1-un;fn.getUniforms().setValue(Ee,"morphTargetBaseInfluence",mr),fn.getUniforms().setValue(Ee,"morphTargetInfluences",qe)}}}(z),Je=new nd(_t,he,me),xt=new function(){var Ee=new WeakMap;function Ze(qe){var ht=qe.target;ht.removeEventListener("dispose",Ze),Ee.delete(ht)}return{get:function(qe,ht){var bt,pn=Ee.get(qe);return pn===void 0?(bt=new qo,Ee.set(qe,new WeakMap),Ee.get(qe).set(ht,bt),qe.addEventListener("dispose",Ze)):(bt=pn.get(ht))===void 0&&(bt=new qo,pn.set(ht,bt)),bt},dispose:function(){Ee=new WeakMap}}},Tt=new function(){var Ee=new WeakMap;function Ze(qe){var ht=qe.target;ht.removeEventListener("dispose",Ze),Ee.delete(ht)}return{get:function(qe,ht){var bt;return Ee.has(qe)===!1?(bt=new id,Ee.set(qe,new WeakMap),Ee.get(qe).set(ht,bt),qe.addEventListener("dispose",Ze)):Ee.get(qe).has(ht)===!1?(bt=new id,Ee.get(qe).set(ht,bt)):bt=Ee.get(qe).get(ht),bt},dispose:function(){Ee=new WeakMap}}},Et=new Lr(_t,ye,at,x),Gt=new function(Ee,Ze,qe,ht){var bt,pn=ht.isWebGL2;this.setMode=function(fn){bt=fn},this.render=function(fn,ln){Ee.drawArrays(bt,fn,ln),qe.update(ln,bt)},this.renderInstances=function(fn,ln,yn,Bt){if(Bt!==0){var en,Fn;if(pn)en=Ee,Fn="drawArraysInstanced";else if(Fn="drawArraysInstancedANGLE",(en=Ze.get("ANGLE_instanced_arrays"))===null)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");en[Fn](bt,ln,yn,Bt),qe.update(yn,bt,Bt)}}}(z,he,Ae,me),Yt=new function(Ee,Ze,qe,ht){var bt,pn,fn,ln=ht.isWebGL2;this.setMode=function(yn){bt=yn},this.setIndex=function(yn){pn=yn.type,fn=yn.bytesPerElement},this.render=function(yn,Bt){Ee.drawElements(bt,Bt,pn,yn*fn),qe.update(Bt,bt)},this.renderInstances=function(yn,Bt,en,Fn){if(Fn!==0){var Un,un;if(ln)Un=Ee,un="drawElementsInstanced";else if(un="drawElementsInstancedANGLE",(Un=Ze.get("ANGLE_instanced_arrays"))===null)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");Un[un](bt,en,pn,Bt*fn,Fn),qe.update(en,bt,Fn)}}}(z,he,Ae,me),Ae.programs=Je.programs,_t.capabilities=me,_t.extensions=he,_t.properties=Le,_t.renderLists=xt,_t.state=ye,_t.info=Ae}sa();var Qr=new gc(_t,z);this.xr=Qr;var ta=new function(Ee,Ze){var qe,ht,bt,pn,fn,ln,yn,Bt=Ee.extensions,en=Ee.properties,Fn=0;function Un(un){return un.isArrayCamera?un.cameras:(fn[0]=un,fn)}this.isAvailable=function(){if(yn===void 0){var un=Bt.get("OVR_multiview2");if(yn=un!==null&&Ze.getContextAttributes().antialias===!1){Fn=Ze.getParameter(un.MAX_VIEWS_OVR),qe=new fc(0,0,2),ln=new zt,pn=[],bt=[],fn=[];for(var sn=0;sn<Fn;sn++)pn[sn]=new fr,bt[sn]=new Ai}}return yn},this.attachCamera=function(un){(function(sn){if(sn.isArrayCamera===void 0)return!0;var $n=sn.cameras;if($n.length>Fn)return!1;for(var ar=1,mr=$n.length;ar<mr;ar++)if($n[0].viewport.z!==$n[ar].viewport.z||$n[0].viewport.w!==$n[ar].viewport.w)return!1;return!0})(un)!==!1&&(ht=Ee.getRenderTarget(),function(sn){if(ht?ln.set(ht.width,ht.height):Ee.getDrawingBufferSize(ln),sn.isArrayCamera){var $n=sn.cameras[0].viewport;qe.setSize($n.z,$n.w),qe.setNumViews(sn.cameras.length)}else qe.setSize(ln.x,ln.y),qe.setNumViews(2)}(un),Ee.setRenderTarget(qe))},this.detachCamera=function(un){qe===Ee.getRenderTarget()&&(Ee.setRenderTarget(ht),function(sn){var $n=qe,ar=$n.numViews,mr=en.get($n).__webglViewFramebuffers,ai=$n.width,Fr=$n.height;if(sn.isArrayCamera)for(var Ia=0;Ia<ar;Ia++){var Qo=sn.cameras[Ia].viewport,es=Qo.x,_l=Qo.y,vo=es+Qo.z,Bi=_l+Qo.w;Ze.bindFramebuffer(36008,mr[Ia]),Ze.blitFramebuffer(0,0,ai,Fr,es,_l,vo,Bi,16384,9728)}else Ze.bindFramebuffer(36008,mr[0]),Ze.blitFramebuffer(0,0,ai,Fr,0,0,ln.x,ln.y,16384,9728)}(un))},this.updateCameraProjectionMatricesUniform=function(un,sn){for(var $n=Un(un),ar=0;ar<$n.length;ar++)pn[ar].copy($n[ar].projectionMatrix);sn.setValue(Ze,"projectionMatrices",pn)},this.updateCameraViewMatricesUniform=function(un,sn){for(var $n=Un(un),ar=0;ar<$n.length;ar++)pn[ar].copy($n[ar].matrixWorldInverse);sn.setValue(Ze,"viewMatrices",pn)},this.updateObjectMatricesUniforms=function(un,sn,$n){for(var ar=Un(sn),mr=0;mr<ar.length;mr++)pn[mr].multiplyMatrices(ar[mr].matrixWorldInverse,un.matrixWorld),bt[mr].getNormalMatrix(pn[mr]);$n.setValue(Ze,"modelViewMatrices",pn),$n.setValue(Ze,"normalMatrices",bt)}}(_t,z),to=new Oh(_t,at,me.maxTextureSize);function yo(Ee){Ee.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),hn=!0}function fs(){console.log("THREE.WebGLRenderer: Context Restored."),hn=!1,sa()}function Fs(Ee){var Ze,qe=Ee.target;qe.removeEventListener("dispose",Fs),rh(Ze=qe),Le.remove(Ze)}function rh(Ee){var Ze=Le.get(Ee).program;(Ee.program=void 0)!==Ze&&Je.releaseProgram(Ze)}this.shadowMap=to,this.getContext=function(){return z},this.getContextAttributes=function(){return z.getContextAttributes()},this.forceContextLoss=function(){var Ee=he.get("WEBGL_lose_context");Ee&&Ee.loseContext()},this.forceContextRestore=function(){var Ee=he.get("WEBGL_lose_context");Ee&&Ee.restoreContext()},this.getPixelRatio=function(){return hr},this.setPixelRatio=function(Ee){Ee!==void 0&&(hr=Ee,this.setSize(Dt,An,!1))},this.getSize=function(Ee){return Ee===void 0&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),Ee=new zt),Ee.set(Dt,An)},this.setSize=function(Ee,Ze,qe){Qr.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(Dt=Ee,An=Ze,t.width=Math.floor(Ee*hr),t.height=Math.floor(Ze*hr),qe!==!1&&(t.style.width=Ee+"px",t.style.height=Ze+"px"),this.setViewport(0,0,Ee,Ze))},this.getDrawingBufferSize=function(Ee){return Ee===void 0&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),Ee=new zt),Ee.set(Dt*hr,An*hr).floor()},this.setDrawingBufferSize=function(Ee,Ze,qe){Dt=Ee,An=Ze,hr=qe,t.width=Math.floor(Ee*qe),t.height=Math.floor(Ze*qe),this.setViewport(0,0,Ee,Ze)},this.getCurrentViewport=function(Ee){return Ee===void 0&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),Ee=new Jr),Ee.copy(Ht)},this.getViewport=function(Ee){return Ee.copy(_n)},this.setViewport=function(Ee,Ze,qe,ht){Ee.isVector4?_n.set(Ee.x,Ee.y,Ee.z,Ee.w):_n.set(Ee,Ze,qe,ht),ye.viewport(Ht.copy(_n).multiplyScalar(hr).floor())},this.getScissor=function(Ee){return Ee.copy(ir)},this.setScissor=function(Ee,Ze,qe,ht){Ee.isVector4?ir.set(Ee.x,Ee.y,Ee.z,Ee.w):ir.set(Ee,Ze,qe,ht),ye.scissor(rr.copy(ir).multiplyScalar(hr).floor())},this.getScissorTest=function(){return cn},this.setScissorTest=function(Ee){ye.setScissorTest(cn=Ee)},this.setOpaqueSort=function(Ee){pt=Ee},this.setTransparentSort=function(Ee){Mn=Ee},this.getClearColor=function(){return Et.getClearColor()},this.setClearColor=function(){Et.setClearColor.apply(Et,arguments)},this.getClearAlpha=function(){return Et.getClearAlpha()},this.setClearAlpha=function(){Et.setClearAlpha.apply(Et,arguments)},this.clear=function(Ee,Ze,qe){var ht=0;Ee!==void 0&&!Ee||(ht|=16384),Ze!==void 0&&!Ze||(ht|=256),qe!==void 0&&!qe||(ht|=1024),z.clear(ht)},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(){t.removeEventListener("webglcontextlost",yo,!1),t.removeEventListener("webglcontextrestored",fs,!1),xt.dispose(),Tt.dispose(),Le.dispose(),at.dispose(),Qr.dispose(),ru.stop()},this.renderBufferImmediate=function(Ee,Ze){ye.initAttributes();var qe=Le.get(Ee);Ee.hasPositions&&!qe.position&&(qe.position=z.createBuffer()),Ee.hasNormals&&!qe.normal&&(qe.normal=z.createBuffer()),Ee.hasUvs&&!qe.uv&&(qe.uv=z.createBuffer()),Ee.hasColors&&!qe.color&&(qe.color=z.createBuffer());var ht=Ze.getAttributes();Ee.hasPositions&&(z.bindBuffer(34962,qe.position),z.bufferData(34962,Ee.positionArray,35048),ye.enableAttribute(ht.position),z.vertexAttribPointer(ht.position,3,5126,!1,0,0)),Ee.hasNormals&&(z.bindBuffer(34962,qe.normal),z.bufferData(34962,Ee.normalArray,35048),ye.enableAttribute(ht.normal),z.vertexAttribPointer(ht.normal,3,5126,!1,0,0)),Ee.hasUvs&&(z.bindBuffer(34962,qe.uv),z.bufferData(34962,Ee.uvArray,35048),ye.enableAttribute(ht.uv),z.vertexAttribPointer(ht.uv,2,5126,!1,0,0)),Ee.hasColors&&(z.bindBuffer(34962,qe.color),z.bufferData(34962,Ee.colorArray,35048),ye.enableAttribute(ht.color),z.vertexAttribPointer(ht.color,3,5126,!1,0,0)),ye.disableUnusedAttributes(),z.drawArrays(4,0,Ee.count),Ee.count=0};var jp=new Hn;this.renderBufferDirect=function(Ee,Ze,qe,ht,bt,pn){Ze===null&&(Ze=jp);var fn=bt.isMesh&&bt.matrixWorld.determinant()<0,ln=Gh(Ee,Ze,ht,bt);ye.setMaterial(ht,fn);var yn=!1;Ne.geometry===qe.id&&Ne.program===ln.id&&Ne.wireframe===(ht.wireframe===!0)||(Ne.geometry=qe.id,Ne.program=ln.id,Ne.wireframe=ht.wireframe===!0,yn=!0),(ht.morphTargets||ht.morphNormals)&&(At.update(bt,qe,ht,ln),yn=!0);var Bt=qe.index,en=qe.attributes.position;if(Bt===null){if(en===void 0||en.count===0)return}else if(Bt.count===0)return;var Fn,Un=1;ht.wireframe===!0&&(Bt=Fe.getWireframeAttribute(qe),Un=2);var un=Gt;Bt!==null&&((Fn=et.get(Bt))?(un=Yt).setIndex(Fn):(console.log("mx attribute == null"),Bt=null)),yn&&(function(_l,vo,Bi,ei){if(me.isWebGL2!==!1||!_l.isInstancedMesh&&!vo.isInstancedBufferGeometry||he.get("ANGLE_instanced_arrays")!==null){ye.initAttributes();var Hd=vo.attributes,No=ei.getAttributes(),Wd=Bi.defaultAttributeValues;for(var So in No){var qi=No[So];if(0<=qi){var Vo=Hd[So];if(Vo!==void 0){var dn=Vo.normalized,Wt=Vo.itemSize;if((lu=et.get(Vo))===void 0)continue;var wa=lu.buffer,su=lu.type,Tf=lu.bytesPerElement;if(Vo.isInterleavedBufferAttribute){var ah=Vo.data,Bf=ah.stride,Gf=Vo.offset;ah&&ah.isInstancedInterleavedBuffer?(ye.enableAttributeAndDivisor(qi,ah.meshPerAttribute),vo.maxInstancedCount===void 0&&(vo.maxInstancedCount=ah.meshPerAttribute*ah.count)):ye.enableAttribute(qi),z.bindBuffer(34962,wa),z.vertexAttribPointer(qi,Wt,su,dn,Bf*Tf,Gf*Tf)}else Vo.isInstancedBufferAttribute?(ye.enableAttributeAndDivisor(qi,Vo.meshPerAttribute),vo.maxInstancedCount===void 0&&(vo.maxInstancedCount=Vo.meshPerAttribute*Vo.count)):ye.enableAttribute(qi),z.bindBuffer(34962,wa),z.vertexAttribPointer(qi,Wt,su,dn,0,0)}else if(So==="instanceMatrix"){var lu;if((lu=et.get(_l.instanceMatrix))===void 0)continue;wa=lu.buffer,su=lu.type,ye.enableAttributeAndDivisor(qi+0,1),ye.enableAttributeAndDivisor(qi+1,1),ye.enableAttributeAndDivisor(qi+2,1),ye.enableAttributeAndDivisor(qi+3,1),z.bindBuffer(34962,wa),z.vertexAttribPointer(qi+0,4,su,!1,64,0),z.vertexAttribPointer(qi+1,4,su,!1,64,16),z.vertexAttribPointer(qi+2,4,su,!1,64,32),z.vertexAttribPointer(qi+3,4,su,!1,64,48)}else if(Wd!==void 0){var oh=Wd[So];if(oh!==void 0)switch(oh.length){case 2:z.vertexAttrib2fv(qi,oh);break;case 3:z.vertexAttrib3fv(qi,oh);break;case 4:z.vertexAttrib4fv(qi,oh);break;default:z.vertexAttrib1fv(qi,oh)}}}}ye.disableUnusedAttributes()}}(bt,qe,ht,ln),Bt!==null&&z.bindBuffer(34963,Fn.buffer));var sn=Bt!==null?Bt.count:en.count,$n=qe.drawRange.start*Un,ar=qe.drawRange.count*Un,mr=pn!==null?pn.start*Un:0,ai=pn!==null?pn.count*Un:1/0,Fr=Math.max($n,mr),Ia=Math.min(sn,$n+ar,mr+ai)-1,Qo=Math.max(0,Ia-Fr+1);if(Qo!==0){if(bt.isMesh)ht.wireframe===!0?(ye.setLineWidth(ht.wireframeLinewidth*Ir()),un.setMode(1)):un.setMode(4);else if(bt.isLine){var es=ht.linewidth;es===void 0&&(es=1),ye.setLineWidth(es*Ir()),bt.isLineSegments?un.setMode(1):bt.isLineLoop?un.setMode(2):un.setMode(3)}else bt.isPoints?un.setMode(0):bt.isSprite&&un.setMode(4);bt.isInstancedMesh?un.renderInstances(qe,Fr,Qo,bt.count):qe.isInstancedBufferGeometry?un.renderInstances(qe,Fr,Qo,qe.maxInstancedCount):un.render(Fr,Qo)}},this.compile=function(Ee,Ze){(ie=Tt.get(Ee,Ze)).init(),Ee.traverse(function(ht){ht.isLight&&(ie.pushLight(ht),ht.castShadow&&ie.pushShadow(ht))}),ie.setupLights(Ze);var qe={};Ee.traverse(function(ht){if(ht.material)if(Array.isArray(ht.material))for(var bt=0;bt<ht.material.length;bt++)ht.material[bt].uuid in qe==0&&(ou(ht.material[bt],Ee,ht),qe[ht.material[bt].uuid]=!0);else ht.material.uuid in qe==0&&(ou(ht.material,Ee,ht),qe[ht.material.uuid]=!0)})};var ih=null,ru=new uh;function iu(Ee,Ze,qe,ht){for(var bt=0,pn=Ee.length;bt<pn;bt++){var fn=Ee[bt],ln=fn.object,yn=fn.geometry,Bt=ht===void 0?fn.material:ht,en=fn.group;if(qe.isArrayCamera)if(qt=qe,Qr.enabled&&ta.isAvailable())au(ln,Ze,qe,yn,Bt,en);else for(var Fn=qe.cameras,Un=0,un=Fn.length;Un<un;Un++){var sn=Fn[Un];ln.layers.test(sn.layers)&&(ye.viewport(Ht.copy(sn.viewport)),ie.setupLights(sn),au(ln,Ze,sn,yn,Bt,en))}else qt=null,au(ln,Ze,qe,yn,Bt,en)}}function au(Ee,Ze,qe,ht,bt,pn){if(Ee.onBeforeRender(_t,Ze,qe,ht,bt,pn),ie=Tt.get(Ze,qt||qe),Ee.modelViewMatrix.multiplyMatrices(qe.matrixWorldInverse,Ee.matrixWorld),Ee.normalMatrix.getNormalMatrix(Ee.modelViewMatrix),Ee.isImmediateRenderObject){var fn=Gh(qe,Ze,bt,Ee);ye.setMaterial(bt),Ne.geometry=null,Ne.program=null,Ne.wireframe=!1,ln=fn,Ee.render(function(yn){_t.renderBufferImmediate(yn,ln)})}else _t.renderBufferDirect(qe,Ze,ht,bt,Ee,pn);var ln;Ee.onAfterRender(_t,Ze,qe,ht,bt,pn),ie=Tt.get(Ze,qt||qe)}function ou(Ee,Ze,qe){var ht=Le.get(Ee),bt=ie.state.lights,pn=ie.state.shadowsArray,fn=bt.state.version,ln=Je.getParameters(Ee,bt.state,pn,Ze,Or.numPlanes,Or.numIntersection,qe),yn=Je.getProgramCacheKey(ln),Bt=ht.program,en=!0;if(Bt===void 0)Ee.addEventListener("dispose",Fs);else if(Bt.cacheKey!==yn)rh(Ee);else if(ht.lightsStateVersion!==fn)ht.lightsStateVersion=fn,en=!1;else{if(ln.shaderID!==void 0)return;en=!1}en&&(Bt=Je.acquireProgram(ln,yn),ht.program=Bt,ht.uniforms=ln.uniforms,ht.environment=Ee.isMeshStandardMaterial?Ze.environment:null,ht.outputEncoding=_t.outputEncoding,Ee.program=Bt);var Fn=Bt.getAttributes();if(Ee.morphTargets)for(var Un=Ee.numSupportedMorphTargets=0;Un<_t.maxMorphTargets;Un++)0<=Fn["morphTarget"+Un]&&Ee.numSupportedMorphTargets++;if(Ee.morphNormals)for(Un=Ee.numSupportedMorphNormals=0;Un<_t.maxMorphNormals;Un++)0<=Fn["morphNormal"+Un]&&Ee.numSupportedMorphNormals++;var un,sn=ht.uniforms;(Ee.isShaderMaterial||Ee.isRawShaderMaterial)&&Ee.clipping!==!0||(ht.numClippingPlanes=Or.numPlanes,ht.numIntersection=Or.numIntersection,sn.clippingPlanes=Or.uniform),ht.fog=Ze.fog,ht.needsLights=(un=Ee).isMeshLambertMaterial||un.isMeshToonMaterial||un.isMeshPhongMaterial||un.isMeshStandardMaterial||un.isShadowMaterial||un.isShaderMaterial&&un.lights===!0,ht.lightsStateVersion=fn,ht.needsLights&&(sn.ambientLightColor.value=bt.state.ambient,sn.lightProbe.value=bt.state.probe,sn.directionalLights.value=bt.state.directional,sn.spotLights.value=bt.state.spot,sn.rectAreaLights.value=bt.state.rectArea,sn.pointLights.value=bt.state.point,sn.hemisphereLights.value=bt.state.hemi,sn.directionalShadowMap.value=bt.state.directionalShadowMap,sn.directionalShadowMatrix.value=bt.state.directionalShadowMatrix,sn.spotShadowMap.value=bt.state.spotShadowMap,sn.spotShadowMatrix.value=bt.state.spotShadowMatrix,sn.pointShadowMap.value=bt.state.pointShadowMap,sn.pointShadowMatrix.value=bt.state.pointShadowMatrix);var $n=ht.program.getUniforms(),ar=us.seqWithValue($n.seq,sn);ht.uniformsList=ar}function Gh(Ee,Ze,qe,ht){Ge.resetTextureUnits();var bt=Ze.fog,pn=qe.isMeshStandardMaterial?Ze.environment:null,fn=Le.get(qe),ln=ie.state.lights;if(vi&&(go||Ee!==nt)){var yn=Ee===nt&&qe.id===Sn;Or.setState(qe.clippingPlanes,qe.clipIntersection,qe.clipShadows,Ee,fn,yn)}qe.version===fn.__version?(fn.program===void 0||qe.fog&&fn.fog!==bt||fn.environment!==pn||fn.needsLights&&fn.lightsStateVersion!==ln.state.version||fn.numClippingPlanes!==void 0&&(fn.numClippingPlanes!==Or.numPlanes||fn.numIntersection!==Or.numIntersection)||fn.outputEncoding!==_t.outputEncoding)&&ou(qe,Ze,ht):(Le.update(qe,"uniforms",qe.uniforms),ou(qe,Ze,ht),fn.__version=qe.version);var Bt,en,Fn,Un,un,sn,$n,ar,mr,ai,Fr,Ia,Qo=!1,es=!1,_l=!1,vo=fn.program,Bi=vo.getUniforms(),ei=fn.uniforms;if(ye.useProgram(vo.program)&&(_l=es=Qo=!0),qe.id!==Sn&&(Sn=qe.id,es=!0),Qo||nt!==Ee){if(0<vo.numMultiviewViews?ta.updateCameraProjectionMatricesUniform(Ee,Bi):Bi.setValue(z,"projectionMatrix",Ee.projectionMatrix),me.logarithmicDepthBuffer&&Bi.setValue(z,"logDepthBufFC",2/(Math.log(Ee.far+1)/Math.LN2)),nt!==Ee&&(nt=Ee,_l=es=!0),qe.isShaderMaterial||qe.isMeshPhongMaterial||qe.isMeshToonMaterial||qe.isMeshStandardMaterial||qe.envMap){var Hd=Bi.map.cameraPosition;Hd!==void 0&&Hd.setValue(z,Pi.setFromMatrixPosition(Ee.matrixWorld))}(qe.isMeshPhongMaterial||qe.isMeshToonMaterial||qe.isMeshLambertMaterial||qe.isMeshBasicMaterial||qe.isMeshStandardMaterial||qe.isShaderMaterial)&&Bi.setValue(z,"isOrthographic",Ee.isOrthographicCamera===!0),(qe.isMeshPhongMaterial||qe.isMeshToonMaterial||qe.isMeshLambertMaterial||qe.isMeshBasicMaterial||qe.isMeshStandardMaterial||qe.isShaderMaterial||qe.skinning)&&(0<vo.numMultiviewViews?ta.updateCameraViewMatricesUniform(Ee,Bi):Bi.setValue(z,"viewMatrix",Ee.matrixWorldInverse))}if(qe.skinning){Bi.setOptional(z,ht,"bindMatrix"),Bi.setOptional(z,ht,"bindMatrixInverse");var No=ht.skeleton;if(No){var Wd=No.bones;if(me.floatVertexTextures){if(No.boneTexture===void 0){var So=Math.sqrt(4*Wd.length);So=yr.ceilPowerOfTwo(So),So=Math.max(So,4);var qi=new Float32Array(So*So*4);qi.set(No.boneMatrices);var Vo=new Rl(qi,So,So,Gr,Mt);No.boneMatrices=qi,No.boneTexture=Vo,No.boneTextureSize=So}Bi.setValue(z,"boneTexture",No.boneTexture,Ge),Bi.setValue(z,"boneTextureSize",No.boneTextureSize)}else Bi.setOptional(z,No,"boneMatrices")}}return!es&&fn.receiveShadow===ht.receiveShadow||(fn.receiveShadow=ht.receiveShadow,Bi.setValue(z,"receiveShadow",ht.receiveShadow)),es&&(Bi.setValue(z,"toneMappingExposure",_t.toneMappingExposure),Bi.setValue(z,"toneMappingWhitePoint",_t.toneMappingWhitePoint),fn.needsLights&&(Ia=_l,(Fr=ei).ambientLightColor.needsUpdate=Ia,Fr.lightProbe.needsUpdate=Ia,Fr.directionalLights.needsUpdate=Ia,Fr.pointLights.needsUpdate=Ia,Fr.spotLights.needsUpdate=Ia,Fr.rectAreaLights.needsUpdate=Ia,Fr.hemisphereLights.needsUpdate=Ia),bt&&qe.fog&&(ai=bt,(mr=ei).fogColor.value.copy(ai.color),ai.isFog?(mr.fogNear.value=ai.near,mr.fogFar.value=ai.far):ai.isFogExp2&&(mr.fogDensity.value=ai.density)),qe.isMeshBasicMaterial?Co(ei,qe):qe.isMeshLambertMaterial?(Co(ei,qe),$n=ei,(ar=qe).emissiveMap&&($n.emissiveMap.value=ar.emissiveMap)):qe.isMeshToonMaterial?(Co(ei,qe),function(dn,Wt){dn.specular.value.copy(Wt.specular),dn.shininess.value=Math.max(Wt.shininess,1e-4),Wt.gradientMap&&(dn.gradientMap.value=Wt.gradientMap),Wt.emissiveMap&&(dn.emissiveMap.value=Wt.emissiveMap),Wt.bumpMap&&(dn.bumpMap.value=Wt.bumpMap,dn.bumpScale.value=Wt.bumpScale,Wt.side===M&&(dn.bumpScale.value*=-1)),Wt.normalMap&&(dn.normalMap.value=Wt.normalMap,dn.normalScale.value.copy(Wt.normalScale),Wt.side===M&&dn.normalScale.value.negate()),Wt.displacementMap&&(dn.displacementMap.value=Wt.displacementMap,dn.displacementScale.value=Wt.displacementScale,dn.displacementBias.value=Wt.displacementBias)}(ei,qe)):qe.isMeshPhongMaterial?(Co(ei,qe),function(dn,Wt){dn.specular.value.copy(Wt.specular),dn.shininess.value=Math.max(Wt.shininess,1e-4),Wt.emissiveMap&&(dn.emissiveMap.value=Wt.emissiveMap),Wt.bumpMap&&(dn.bumpMap.value=Wt.bumpMap,dn.bumpScale.value=Wt.bumpScale,Wt.side===M&&(dn.bumpScale.value*=-1)),Wt.normalMap&&(dn.normalMap.value=Wt.normalMap,dn.normalScale.value.copy(Wt.normalScale),Wt.side===M&&dn.normalScale.value.negate()),Wt.displacementMap&&(dn.displacementMap.value=Wt.displacementMap,dn.displacementScale.value=Wt.displacementScale,dn.displacementBias.value=Wt.displacementBias)}(ei,qe)):qe.isMeshStandardMaterial?(Co(ei,qe,pn),(qe.isMeshPhysicalMaterial?function(dn,Wt,wa){_f(dn,Wt,wa),dn.reflectivity.value=Wt.reflectivity,dn.clearcoat.value=Wt.clearcoat,dn.clearcoatRoughness.value=Wt.clearcoatRoughness,Wt.sheen&&dn.sheen.value.copy(Wt.sheen),Wt.clearcoatNormalMap&&(dn.clearcoatNormalScale.value.copy(Wt.clearcoatNormalScale),dn.clearcoatNormalMap.value=Wt.clearcoatNormalMap,Wt.side===M&&dn.clearcoatNormalScale.value.negate()),dn.transparency.value=Wt.transparency}:_f)(ei,qe,pn)):qe.isMeshMatcapMaterial?(Co(ei,qe),function(dn,Wt){Wt.matcap&&(dn.matcap.value=Wt.matcap),Wt.bumpMap&&(dn.bumpMap.value=Wt.bumpMap,dn.bumpScale.value=Wt.bumpScale,Wt.side===M&&(dn.bumpScale.value*=-1)),Wt.normalMap&&(dn.normalMap.value=Wt.normalMap,dn.normalScale.value.copy(Wt.normalScale),Wt.side===M&&dn.normalScale.value.negate()),Wt.displacementMap&&(dn.displacementMap.value=Wt.displacementMap,dn.displacementScale.value=Wt.displacementScale,dn.displacementBias.value=Wt.displacementBias)}(ei,qe)):qe.isMeshDepthMaterial?(Co(ei,qe),un=ei,(sn=qe).displacementMap&&(un.displacementMap.value=sn.displacementMap,un.displacementScale.value=sn.displacementScale,un.displacementBias.value=sn.displacementBias)):qe.isMeshDistanceMaterial?(Co(ei,qe),function(dn,Wt){Wt.displacementMap&&(dn.displacementMap.value=Wt.displacementMap,dn.displacementScale.value=Wt.displacementScale,dn.displacementBias.value=Wt.displacementBias),dn.referencePosition.value.copy(Wt.referencePosition),dn.nearDistance.value=Wt.nearDistance,dn.farDistance.value=Wt.farDistance}(ei,qe)):qe.isMeshNormalMaterial?(Co(ei,qe),function(dn,Wt){Wt.bumpMap&&(dn.bumpMap.value=Wt.bumpMap,dn.bumpScale.value=Wt.bumpScale,Wt.side===M&&(dn.bumpScale.value*=-1)),Wt.normalMap&&(dn.normalMap.value=Wt.normalMap,dn.normalScale.value.copy(Wt.normalScale),Wt.side===M&&dn.normalScale.value.negate()),Wt.displacementMap&&(dn.displacementMap.value=Wt.displacementMap,dn.displacementScale.value=Wt.displacementScale,dn.displacementBias.value=Wt.displacementBias)}(ei,qe)):qe.isLineBasicMaterial?(Un=qe,(Fn=ei).diffuse.value.copy(Un.color),Fn.opacity.value=Un.opacity,qe.isLineDashedMaterial&&(en=qe,(Bt=ei).dashSize.value=en.dashSize,Bt.totalSize.value=en.dashSize+en.gapSize,Bt.scale.value=en.scale)):qe.isPointsMaterial?function(dn,Wt){var wa;dn.diffuse.value.copy(Wt.color),dn.opacity.value=Wt.opacity,dn.size.value=Wt.size*hr,dn.scale.value=.5*An,Wt.map&&(dn.map.value=Wt.map),Wt.alphaMap&&(dn.alphaMap.value=Wt.alphaMap),Wt.map?wa=Wt.map:Wt.alphaMap&&(wa=Wt.alphaMap),wa!==void 0&&(wa.matrixAutoUpdate===!0&&wa.updateMatrix(),dn.uvTransform.value.copy(wa.matrix))}(ei,qe):qe.isSpriteMaterial?function(dn,Wt){var wa;dn.diffuse.value.copy(Wt.color),dn.opacity.value=Wt.opacity,dn.rotation.value=Wt.rotation,Wt.map&&(dn.map.value=Wt.map),Wt.alphaMap&&(dn.alphaMap.value=Wt.alphaMap),Wt.map?wa=Wt.map:Wt.alphaMap&&(wa=Wt.alphaMap),wa!==void 0&&(wa.matrixAutoUpdate===!0&&wa.updateMatrix(),dn.uvTransform.value.copy(wa.matrix))}(ei,qe):qe.isShadowMaterial&&(ei.color.value.copy(qe.color),ei.opacity.value=qe.opacity),ei.ltc_1!==void 0&&(ei.ltc_1.value=wn.LTC_1),ei.ltc_2!==void 0&&(ei.ltc_2.value=wn.LTC_2),us.upload(z,fn.uniformsList,ei,Ge),qe.isShaderMaterial&&(qe.uniformsNeedUpdate=!1)),qe.isShaderMaterial&&qe.uniformsNeedUpdate===!0&&(us.upload(z,fn.uniformsList,ei,Ge),qe.uniformsNeedUpdate=!1),qe.isSpriteMaterial&&Bi.setValue(z,"center",ht.center),0<vo.numMultiviewViews?ta.updateObjectMatricesUniforms(ht,Ee,Bi):(Bi.setValue(z,"modelViewMatrix",ht.modelViewMatrix),Bi.setValue(z,"normalMatrix",ht.normalMatrix)),Bi.setValue(z,"modelMatrix",ht.matrixWorld),vo}function Co(Ee,Ze,qe){Ee.opacity.value=Ze.opacity,Ze.color&&Ee.diffuse.value.copy(Ze.color),Ze.emissive&&Ee.emissive.value.copy(Ze.emissive).multiplyScalar(Ze.emissiveIntensity),Ze.map&&(Ee.map.value=Ze.map),Ze.alphaMap&&(Ee.alphaMap.value=Ze.alphaMap),Ze.specularMap&&(Ee.specularMap.value=Ze.specularMap);var ht,bt,pn=Ze.envMap||qe;pn&&(Ee.envMap.value=pn,Ee.flipEnvMap.value=pn.isCubeTexture?-1:1,Ee.reflectivity.value=Ze.reflectivity,Ee.refractionRatio.value=Ze.refractionRatio,Ee.maxMipLevel.value=Le.get(pn).__maxMipLevel),Ze.lightMap&&(Ee.lightMap.value=Ze.lightMap,Ee.lightMapIntensity.value=Ze.lightMapIntensity),Ze.aoMap&&(Ee.aoMap.value=Ze.aoMap,Ee.aoMapIntensity.value=Ze.aoMapIntensity),Ze.map?ht=Ze.map:Ze.specularMap?ht=Ze.specularMap:Ze.displacementMap?ht=Ze.displacementMap:Ze.normalMap?ht=Ze.normalMap:Ze.bumpMap?ht=Ze.bumpMap:Ze.roughnessMap?ht=Ze.roughnessMap:Ze.metalnessMap?ht=Ze.metalnessMap:Ze.alphaMap?ht=Ze.alphaMap:Ze.emissiveMap&&(ht=Ze.emissiveMap),ht!==void 0&&(ht.isWebGLRenderTarget&&(ht=ht.texture),ht.matrixAutoUpdate===!0&&ht.updateMatrix(),Ee.uvTransform.value.copy(ht.matrix)),Ze.aoMap?bt=Ze.aoMap:Ze.lightMap&&(bt=Ze.lightMap),bt!==void 0&&(bt.isWebGLRenderTarget&&(bt=bt.texture),bt.matrixAutoUpdate===!0&&bt.updateMatrix(),Ee.uv2Transform.value.copy(bt.matrix))}function _f(Ee,Ze,qe){Ee.roughness.value=Ze.roughness,Ee.metalness.value=Ze.metalness,Ze.roughnessMap&&(Ee.roughnessMap.value=Ze.roughnessMap),Ze.metalnessMap&&(Ee.metalnessMap.value=Ze.metalnessMap),Ze.emissiveMap&&(Ee.emissiveMap.value=Ze.emissiveMap),Ze.bumpMap&&(Ee.bumpMap.value=Ze.bumpMap,Ee.bumpScale.value=Ze.bumpScale,Ze.side===M&&(Ee.bumpScale.value*=-1)),Ze.normalMap&&(Ee.normalMap.value=Ze.normalMap,Ee.normalScale.value.copy(Ze.normalScale),Ze.side===M&&Ee.normalScale.value.negate()),Ze.displacementMap&&(Ee.displacementMap.value=Ze.displacementMap,Ee.displacementScale.value=Ze.displacementScale,Ee.displacementBias.value=Ze.displacementBias),(Ze.envMap||qe)&&(Ee.envMapIntensity.value=Ze.envMapIntensity)}ru.setAnimationLoop(function(Ee){Qr.isPresenting||ih&&ih(Ee)}),typeof window!="undefined"&&ru.setContext(window),this.setAnimationLoop=function(Ee){ih=Ee,Qr.setAnimationLoop(Ee),ru.start()},this.render=function(Ee,Ze){var qe,ht;if(arguments[2]!==void 0&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),qe=arguments[2]),arguments[3]!==void 0&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),ht=arguments[3]),Ze&&Ze.isCamera){if(!hn){Ne.geometry=null,Ne.program=null,Ne.wireframe=!1,Sn=-1,!(nt=null)===Ee.autoUpdate&&Ee.updateMatrixWorld(),Ze.parent===null&&Ze.updateMatrixWorld(),Qr.enabled&&Qr.isPresenting&&(Ze=Qr.getCamera(Ze)),(ie=Tt.get(Ee,Ze)).init(),Ee.onBeforeRender(_t,Ee,Ze,qe||Bn),Vr.multiplyMatrices(Ze.projectionMatrix,Ze.matrixWorldInverse),wr.setFromProjectionMatrix(Vr),go=this.localClippingEnabled,vi=Or.init(this.clippingPlanes,go,Ze),(ee=xt.get(Ee,Ze)).init(),function yn(Bt,en,Fn,Un){if(Bt.visible!==!1){if(Bt.layers.test(en.layers)){if(Bt.isGroup)Fn=Bt.renderOrder;else if(Bt.isLOD)Bt.autoUpdate===!0&&Bt.update(en);else if(Bt.isLight)ie.pushLight(Bt),Bt.castShadow&&ie.pushShadow(Bt);else if(Bt.isSprite){if(!Bt.frustumCulled||wr.intersectsSprite(Bt)){Un&&Pi.setFromMatrixPosition(Bt.matrixWorld).applyMatrix4(Vr);var un=at.update(Bt);(sn=Bt.material).visible&&ee.push(Bt,un,sn,Fn,Pi.z,null)}}else if(Bt.isImmediateRenderObject)Un&&Pi.setFromMatrixPosition(Bt.matrixWorld).applyMatrix4(Vr),ee.push(Bt,null,Bt.material,Fn,Pi.z,null);else if((Bt.isMesh||Bt.isLine||Bt.isPoints)&&(Bt.isSkinnedMesh&&Bt.skeleton.frame!==Ae.render.frame&&(Bt.skeleton.update(),Bt.skeleton.frame=Ae.render.frame),!Bt.frustumCulled||wr.intersectsObject(Bt))){Un&&Pi.setFromMatrixPosition(Bt.matrixWorld).applyMatrix4(Vr),un=at.update(Bt);var sn=Bt.material;if(Array.isArray(sn))for(var $n=un.groups,ar=0,mr=$n.length;ar<mr;ar++){var ai=$n[ar],Fr=sn[ai.materialIndex];Fr&&Fr.visible&&ee.push(Bt,un,Fr,Fn,Pi.z,ai)}else sn.visible&&ee.push(Bt,un,sn,Fn,Pi.z,null)}}var Ia=Bt.children;for(ar=0,mr=Ia.length;ar<mr;ar++)yn(Ia[ar],en,Fn,Un)}}(Ee,Ze,0,_t.sortObjects),_t.sortObjects===!0&&ee.sort(pt,Mn),vi&&Or.beginShadows();var bt=ie.state.shadowsArray;to.render(bt,Ee,Ze),ie.setupLights(Ze),vi&&Or.endShadows(),this.info.autoReset&&this.info.reset(),qe!==void 0&&this.setRenderTarget(qe),Qr.enabled&&ta.isAvailable()&&ta.attachCamera(Ze),Et.render(ee,Ee,Ze,ht);var pn=ee.opaque,fn=ee.transparent;if(Ee.overrideMaterial){var ln=Ee.overrideMaterial;pn.length&&iu(pn,Ee,Ze,ln),fn.length&&iu(fn,Ee,Ze,ln)}else pn.length&&iu(pn,Ee,Ze),fn.length&&iu(fn,Ee,Ze);Ee.onAfterRender(_t,Ee,Ze),Bn!==null&&(Ge.updateRenderTargetMipmap(Bn),Ge.updateMultisampleRenderTarget(Bn)),ye.buffers.depth.setTest(!0),ye.buffers.depth.setMask(!0),ye.buffers.color.setMask(!0),ye.setPolygonOffset(!1),Qr.enabled&&ta.isAvailable()&&ta.detachCamera(Ze),ie=ee=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.mxRenderObject=function(Ee,Ze,qe,ht,bt){au(Ee,Ze,qe,at.update(Ee),ht,bt)},this.setFramebuffer=function(Ee){bn!==Ee&&Bn===null&&z.bindFramebuffer(36160,Ee),bn=Ee},this.getActiveCubeFace=function(){return Kn},this.getActiveMipmapLevel=function(){return qn},this.getRenderTarget=function(){return Bn},this.setRenderTarget=function(Ee,Ze,qe){Kn=Ze,qn=qe,(Bn=Ee)&&Le.get(Ee).__webglFramebuffer===void 0&&Ge.setupRenderTarget(Ee);var ht=bn,bt=!1;if(Ee){var pn=Le.get(Ee).__webglFramebuffer;Ee.isWebGLCubeRenderTarget?(ht=pn[Ze||0],bt=!0):ht=Ee.isWebGLMultisampleRenderTarget?Le.get(Ee).__webglMultisampledFramebuffer:pn,Ht.copy(Ee.viewport),rr.copy(Ee.scissor),Dn=Ee.scissorTest}else Ht.copy(_n).multiplyScalar(hr).floor(),rr.copy(ir).multiplyScalar(hr).floor(),Dn=cn;if(ur!==ht&&(z.bindFramebuffer(36160,ht),ur=ht),ye.viewport(Ht),ye.scissor(rr),ye.setScissorTest(Dn),bt){var fn=Le.get(Ee.texture);z.framebufferTexture2D(36160,36064,34069+(Ze||0),fn.__webglTexture,qe||0)}},this.readRenderTargetPixels=function(Ee,Ze,qe,ht,bt,pn,fn){if(Ee&&Ee.isWebGLRenderTarget){var ln=Le.get(Ee).__webglFramebuffer;if(Ee.isWebGLCubeRenderTarget&&fn!==void 0&&(ln=ln[fn]),ln){var yn=!1;ln!==ur&&(z.bindFramebuffer(36160,ln),yn=!0);try{var Bt=Ee.texture,en=Bt.format,Fn=Bt.type;if(en!==Gr&&St.convert(en)!==z.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(Fn===kr||St.convert(Fn)===z.getParameter(35738)||Fn===Mt&&(me.isWebGL2||he.get("OES_texture_float")||he.get("WEBGL_color_buffer_float"))||Fn===rn&&(me.isWebGL2?he.get("EXT_color_buffer_float"):he.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");z.checkFramebufferStatus(36160)===36053?0<=Ze&&Ze<=Ee.width-ht&&0<=qe&&qe<=Ee.height-bt&&z.readPixels(Ze,qe,ht,bt,St.convert(en),St.convert(Fn),pn):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{yn&&z.bindFramebuffer(36160,ur)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(Ee,Ze,qe){qe===void 0&&(qe=0);var ht=Math.pow(2,-qe),bt=Math.floor(Ze.image.width*ht),pn=Math.floor(Ze.image.height*ht),fn=St.convert(Ze.format);Ge.setTexture2D(Ze,0),z.copyTexImage2D(3553,qe,fn,Ee.x,Ee.y,bt,pn,0),ye.unbindTexture()},this.copyTextureToTexture=function(Ee,Ze,qe,ht){var bt=Ze.image.width,pn=Ze.image.height,fn=St.convert(qe.format),ln=St.convert(qe.type);Ge.setTexture2D(qe,0),Ze.isDataTexture?z.texSubImage2D(3553,ht||0,Ee.x,Ee.y,bt,pn,fn,ln,Ze.image.data):z.texSubImage2D(3553,ht||0,Ee.x,Ee.y,fn,ln,Ze.image),ye.unbindTexture()},this.initTexture=function(Ee){Ge.setTexture2D(Ee,0),ye.unbindTexture()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function po(e,t){this.name="",this.color=new Qe(e),this.density=t!==void 0?t:25e-5}function Yo(e,t,n){this.name="",this.color=new Qe(e),this.near=t!==void 0?t:1,this.far=n!==void 0?n:1e3}function Zo(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Wr,this.updateRange={offset:0,count:-1},this.version=0}fc.prototype=Object.assign(Object.create(Zi.prototype),{constructor:fc,isWebGLMultiviewRenderTarget:!0,copy:function(e){return Zi.prototype.copy.call(this,e),this.numViews=e.numViews,this},setNumViews:function(e){return this.numViews!==e&&(this.numViews=e,this.dispose()),this}}),mc.prototype=Object.assign(Object.create(Ni.prototype),{constructor:mc,isArrayCamera:!0}),il.prototype=Object.assign(Object.create(Pt.prototype),{constructor:il,isGroup:!0}),Object.assign(gc.prototype,ka.prototype),Object.assign(po.prototype,{isFogExp2:!0,clone:function(){return new po(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Yo.prototype,{isFog:!0,clone:function(){return new Yo(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Zo.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),Object.assign(Zo.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var i=0,l=this.stride;i<l;i++)this.array[e+i]=t.array[n+i];return this},set:function(e,t){return t===void 0&&(t=0),this.array.set(e,t),this},clone:function(){return new this.constructor().copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}});var Vl,al=new Re;function yc(e,t,n,i){this.data=e,this.itemSize=t,this.offset=n,this.normalized=i===!0}function ol(e){It.call(this),this.type="SpriteMaterial",this.color=new Qe(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Object.defineProperties(yc.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(yc.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)al.x=this.getX(t),al.y=this.getY(t),al.z=this.getZ(t),al.applyMatrix4(e),this.setXYZ(t,al.x,al.y,al.z);return this},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this},setXYZW:function(e,t,n,i,l){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=l,this}}),((ol.prototype=Object.create(It.prototype)).constructor=ol).prototype.isSpriteMaterial=!0,ol.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var Fl=new Re,sl=new Re,ll=new Re,Bl=new zt,vc=new zt,ld=new fr,Ba=new Re,xc=new Re,wc=new Re,cd=new zt,bc=new zt,ud=new zt;function Mc(e){if(Pt.call(this),this.type="Sprite",Vl===void 0){Vl=new Cn;var t=new Zo(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Vl.setIndex([0,1,2,0,2,3]),Vl.setAttribute("position",new yc(t,3,0,!1)),Vl.setAttribute("uv",new yc(t,2,3,!1))}this.geometry=Vl,this.material=e!==void 0?e:new ol,this.center=new zt(.5,.5)}function Eu(e,t,n,i,l,d){Bl.subVectors(e,n).addScalar(.5).multiply(i),l!==void 0?(vc.x=d*Bl.x-l*Bl.y,vc.y=l*Bl.x+d*Bl.y):vc.copy(Bl),e.copy(t),e.x+=vc.x,e.y+=vc.y,e.applyMatrix4(ld)}Mc.prototype=Object.assign(Object.create(Pt.prototype),{constructor:Mc,isSprite:!0,raycast:function(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),sl.setFromMatrixScale(this.matrixWorld),ld.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ll.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&sl.multiplyScalar(-ll.z);var n,i,l=this.material.rotation;l!==0&&(i=Math.cos(l),n=Math.sin(l));var d=this.center;Eu(Ba.set(-.5,-.5,0),ll,d,sl,n,i),Eu(xc.set(.5,-.5,0),ll,d,sl,n,i),Eu(wc.set(.5,.5,0),ll,d,sl,n,i),cd.set(0,0),bc.set(1,0),ud.set(1,1);var m=e.ray.intersectTriangle(Ba,xc,wc,!1,Fl);if(m!==null||(Eu(xc.set(-.5,.5,0),ll,d,sl,n,i),bc.set(0,1),(m=e.ray.intersectTriangle(Ba,wc,xc,!1,Fl))!==null)){var x=e.ray.origin.distanceTo(Fl);x<e.near||x>e.far||t.push({distance:x,point:Fl.clone(),uv:ki.getUV(Fl,Ba,xc,wc,cd,bc,ud,new zt),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return Pt.prototype.copy.call(this,e),e.center!==void 0&&this.center.copy(e.center),this}});var Gl=new Re,Rh=new Re;function _c(){Pt.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Tc(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Ti.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new fr,this.bindMatrixInverse=new fr}_c.prototype=Object.assign(Object.create(Pt.prototype),{constructor:_c,isLOD:!0,copy:function(e){Pt.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,i=t.length;n<i;n++){var l=t[n];this.addLevel(l.object.clone(),l.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){t===void 0&&(t=0),t=Math.abs(t);for(var n=this.levels,i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this},getObjectForDistance:function(e){var t=this.levels;if(0<t.length){for(var n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){if(0<this.levels.length){Gl.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(Gl);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(1<t.length){Gl.setFromMatrixPosition(e.matrixWorld),Rh.setFromMatrixPosition(this.matrixWorld);var n=Gl.distanceTo(Rh);t[0].object.visible=!0;for(var i=1,l=t.length;i<l&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(;i<l;i++)t[i].object.visible=!1}},toJSON:function(e){var t=Pt.prototype.toJSON.call(this,e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,i=0,l=n.length;i<l;i++){var d=n[i];t.object.levels.push({object:d.object.uuid,distance:d.distance})}return t}}),Tc.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Tc,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new Jr,t=this.geometry.attributes.skinWeight,n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var l=1/e.manhattanLength();l!=1/0?e.multiplyScalar(l):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){Ti.prototype.updateMatrixWorld.call(this,e),this.bindMode==="attached"?this.bindMatrixInverse.getInverse(this.matrixWorld):this.bindMode==="detached"?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 hd=new fr,Yd=new fr;function Au(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,t===void 0)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new fr)}}function Lh(){Pt.call(this),this.type="Bone"}Object.assign(Au.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new fr;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,l=0,d=e.length;l<d;l++){var m=e[l]?e[l].matrixWorld:Yd;hd.multiplyMatrices(m,t[l]),hd.toArray(n,16*l)}i!==void 0&&(i.needsUpdate=!0)},clone:function(){return new Au(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var i=this.bones[t];if(i.name===e)return i}}}),Lh.prototype=Object.assign(Object.create(Pt.prototype),{constructor:Lh,isBone:!0});var Ih=new fr,Cc=new fr,zl=[],Sc=new Ti;function Ou(e,t,n){Ti.call(this,e,t),this.instanceMatrix=new Qt(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function Vi(e){It.call(this),this.type="LineBasicMaterial",this.color=new Qe(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}Ou.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Ou,isInstancedMesh:!0,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,i=this.count;if(Sc.geometry=this.geometry,Sc.material=this.material,Sc.material!==void 0)for(var l=0;l<i;l++)this.getMatrixAt(l,Ih),Cc.multiplyMatrices(n,Ih),Sc.matrixWorld=Cc,Sc.raycast(e,zl),0<zl.length&&(zl[0].instanceId=l,zl[0].object=this,t.push(zl[0]),zl.length=0)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),((Vi.prototype=Object.create(It.prototype)).constructor=Vi).prototype.isLineBasicMaterial=!0,Vi.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this};var kh=new Re,jh=new Re,dd=new fr,Pu=new Pr,Ru=new Zr;function La(e,t,n){n===1&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Pt.call(this),this.type="Line",this.geometry=e!==void 0?e:new Cn,this.material=t!==void 0?t:new Vi}La.prototype=Object.assign(Object.create(Pt.prototype),{constructor:La,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(e.index===null){for(var t=e.attributes.position,n=[0],i=1,l=t.count;i<l;i++)kh.fromBufferAttribute(t,i-1),jh.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=kh.distanceTo(jh);e.setAttribute("lineDistance",new an(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var d=e.vertices;for((n=e.lineDistances)[0]=0,i=1,l=d.length;i<l;i++)n[i]=n[i-1],n[i]+=d[i-1].distanceTo(d[i])}return this},raycast:function(e,t){var n=e.linePrecision,i=this.geometry,l=this.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ru.copy(i.boundingSphere),Ru.applyMatrix4(l),Ru.radius+=n,e.ray.intersectsSphere(Ru)!==!1){dd.getInverse(l),Pu.copy(e.ray).applyMatrix4(dd);var d=n/((this.scale.x+this.scale.y+this.scale.z)/3),m=d*d,x=new Re,L=new Re,j=new Re,Z=new Re,ee=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var ie=i.index,z=i.attributes.position.array;if(ie!==null)for(var he=ie.array,me=0,ye=he.length-1;me<ye;me+=ee){var Ae=he[me],Le=he[me+1];x.fromArray(z,3*Ae),L.fromArray(z,3*Le),m<Pu.distanceSqToSegment(x,L,Z,j)||(Z.applyMatrix4(this.matrixWorld),(Fe=e.ray.origin.distanceTo(Z))<e.near||Fe>e.far||t.push({distance:Fe,point:j.clone().applyMatrix4(this.matrixWorld),index:me,face:null,faceIndex:null,object:this}))}else for(me=0,ye=z.length/3-1;me<ye;me+=ee)x.fromArray(z,3*me),L.fromArray(z,3*me+3),m<Pu.distanceSqToSegment(x,L,Z,j)||(Z.applyMatrix4(this.matrixWorld),(Fe=e.ray.origin.distanceTo(Z))<e.near||Fe>e.far||t.push({distance:Fe,point:j.clone().applyMatrix4(this.matrixWorld),index:me,face:null,faceIndex:null,object:this}))}else if(i.isGeometry){var Ge=i.vertices,et=Ge.length;for(me=0;me<et-1;me+=ee){var Fe;m<Pu.distanceSqToSegment(Ge[me],Ge[me+1],Z,j)||(Z.applyMatrix4(this.matrixWorld),(Fe=e.ray.origin.distanceTo(Z))<e.near||Fe>e.far||t.push({distance:Fe,point:j.clone().applyMatrix4(this.matrixWorld),index:me,face:null,faceIndex:null,object:this}))}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Lu=new Re,Iu=new Re;function fi(e,t){La.call(this,e,t),this.type="LineSegments"}function Dc(e,t){La.call(this,e,t),this.type="LineLoop"}function Ko(e){It.call(this),this.type="PointsMaterial",this.color=new Qe(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}fi.prototype=Object.assign(Object.create(La.prototype),{constructor:fi,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(e.index===null){for(var t=e.attributes.position,n=[],i=0,l=t.count;i<l;i+=2)Lu.fromBufferAttribute(t,i),Iu.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Lu.distanceTo(Iu);e.setAttribute("lineDistance",new an(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var d=e.vertices;for(n=e.lineDistances,i=0,l=d.length;i<l;i+=2)Lu.copy(d[i]),Iu.copy(d[i+1]),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Lu.distanceTo(Iu)}return this}}),Dc.prototype=Object.assign(Object.create(La.prototype),{constructor:Dc,isLineLoop:!0}),((Ko.prototype=Object.create(It.prototype)).constructor=Ko).prototype.isPointsMaterial=!0,Ko.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var ku=new fr,ju=new Pr,Ec=new Zr,Nu=new Re;function Ul(e,t){Pt.call(this),this.type="Points",this.geometry=e!==void 0?e:new Cn,this.material=t!==void 0?t:new Ko,this.updateMorphTargets()}function Hl(e,t,n,i,l,d,m){var x=ju.distanceSqToPoint(e);if(x<n){var L=new Re;ju.closestPointToPoint(e,L),L.applyMatrix4(i);var j=l.ray.origin.distanceTo(L);if(j<l.near||j>l.far)return;d.push({distance:j,distanceToRay:Math.sqrt(x),point:L,index:t,face:null,object:m})}}function Wl(e,t,n,i,l,d,m,x,L){Xr.call(this,e,t,n,i,l,d,m,x,L),this.format=m!==void 0?m:ti,this.minFilter=d!==void 0?d:xn,this.magFilter=l!==void 0?l:xn,this.generateMipmaps=!1}function Vu(e,t,n,i,l,d,m,x,L,j,Z,ee){Xr.call(this,null,d,m,x,L,j,i,l,Z,ee),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Ac(e,t,n,i,l,d,m,x,L){Xr.call(this,e,t,n,i,l,d,m,x,L),this.needsUpdate=!0}function Fu(e,t,n,i,l,d,m,x,L,j){if((j=j!==void 0?j:or)!==or&&j!==ni)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&j===or&&(n=We),n===void 0&&j===ni&&(n=Mr),Xr.call(this,null,i,l,d,m,x,j,n,L),this.image={width:e,height:t},this.magFilter=m!==void 0?m:dt,this.minFilter=x!==void 0?x:dt,this.flipY=!1,this.generateMipmaps=!1}function Oc(e){Cn.call(this),this.type="WireframeGeometry";var t,n,i,l,d,m,x,L,j,Z,ee=[],ie=[0,0],z={},he=["a","b","c"];if(e&&e.isGeometry){var me=e.faces;for(t=0,i=me.length;t<i;t++){var ye=me[t];for(n=0;n<3;n++)x=ye[he[n]],L=ye[he[(n+1)%3]],ie[0]=Math.min(x,L),ie[1]=Math.max(x,L),z[j=ie[0]+","+ie[1]]===void 0&&(z[j]={index1:ie[0],index2:ie[1]})}for(j in z)m=z[j],Z=e.vertices[m.index1],ee.push(Z.x,Z.y,Z.z),Z=e.vertices[m.index2],ee.push(Z.x,Z.y,Z.z)}else if(e&&e.isBufferGeometry){var Ae,Le,Ge,et,Fe,at;if(Z=new Re,e.index!==null){for(Ae=e.attributes.position,Le=e.index,(Ge=e.groups).length===0&&(Ge=[{start:0,count:Le.count,materialIndex:0}]),l=0,d=Ge.length;l<d;++l)for(i=(t=(et=Ge[l]).start)+et.count;t<i;t+=3)for(n=0;n<3;n++)x=Le.getX(t+n),L=Le.getX(t+(n+1)%3),ie[0]=Math.min(x,L),ie[1]=Math.max(x,L),z[j=ie[0]+","+ie[1]]===void 0&&(z[j]={index1:ie[0],index2:ie[1]});for(j in z)m=z[j],Z.fromBufferAttribute(Ae,m.index1),ee.push(Z.x,Z.y,Z.z),Z.fromBufferAttribute(Ae,m.index2),ee.push(Z.x,Z.y,Z.z)}else for(t=0,i=(Ae=e.attributes.position).count/3;t<i;t++)for(n=0;n<3;n++)Fe=3*t+n,Z.fromBufferAttribute(Ae,Fe),ee.push(Z.x,Z.y,Z.z),at=3*t+(n+1)%3,Z.fromBufferAttribute(Ae,at),ee.push(Z.x,Z.y,Z.z)}this.setAttribute("position",new an(ee,3))}function $a(e,t,n){lr.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new Pc(e,t,n)),this.mergeVertices()}function Pc(e,t,n){Cn.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var i,l,d=[],m=[],x=[],L=[],j=new Re,Z=new Re,ee=new Re,ie=new Re,z=new Re;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var he=t+1;for(i=0;i<=n;i++){var me=i/n;for(l=0;l<=t;l++){var ye=l/t;e(ye,me,Z),m.push(Z.x,Z.y,Z.z),0<=ye-1e-5?(e(ye-1e-5,me,ee),ie.subVectors(Z,ee)):(e(1e-5+ye,me,ee),ie.subVectors(ee,Z)),0<=me-1e-5?(e(ye,me-1e-5,ee),z.subVectors(Z,ee)):(e(ye,1e-5+me,ee),z.subVectors(ee,Z)),j.crossVectors(ie,z).normalize(),x.push(j.x,j.y,j.z),L.push(ye,me)}}for(i=0;i<n;i++)for(l=0;l<t;l++){var Ae=i*he+l,Le=i*he+l+1,Ge=(i+1)*he+l+1,et=(i+1)*he+l;d.push(Ae,Le,et),d.push(Le,Ge,et)}this.setIndex(d),this.setAttribute("position",new an(m,3)),this.setAttribute("normal",new an(x,3)),this.setAttribute("uv",new an(L,2))}function Bu(e,t,n,i){lr.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},this.fromBufferGeometry(new aa(e,t,n,i)),this.mergeVertices()}function aa(e,t,n,i){Cn.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},n=n||1;var l=[],d=[];function m(ee,ie,z,he){var me,ye,Ae=Math.pow(2,he),Le=[];for(me=0;me<=Ae;me++){Le[me]=[];var Ge=ee.clone().lerp(z,me/Ae),et=ie.clone().lerp(z,me/Ae),Fe=Ae-me;for(ye=0;ye<=Fe;ye++)Le[me][ye]=ye===0&&me===Ae?Ge:Ge.clone().lerp(et,ye/Fe)}for(me=0;me<Ae;me++)for(ye=0;ye<2*(Ae-me)-1;ye++){var at=Math.floor(ye/2);ye%2==0?(x(Le[me][at+1]),x(Le[me+1][at]),x(Le[me][at])):(x(Le[me][at+1]),x(Le[me+1][at+1]),x(Le[me+1][at]))}}function x(ee){l.push(ee.x,ee.y,ee.z)}function L(ee,ie){var z=3*ee;ie.x=e[0+z],ie.y=e[1+z],ie.z=e[2+z]}function j(ee,ie,z,he){he<0&&ee.x===1&&(d[ie]=ee.x-1),z.x===0&&z.z===0&&(d[ie]=he/2/Math.PI+.5)}function Z(ee){return Math.atan2(ee.z,-ee.x)}(function(ee){for(var ie=new Re,z=new Re,he=new Re,me=0;me<t.length;me+=3)L(t[me+0],ie),L(t[me+1],z),L(t[me+2],he),m(ie,z,he,ee)})(i=i||0),function(ee){for(var ie=new Re,z=0;z<l.length;z+=3)ie.x=l[z+0],ie.y=l[z+1],ie.z=l[z+2],ie.normalize().multiplyScalar(ee),l[z+0]=ie.x,l[z+1]=ie.y,l[z+2]=ie.z}(n),function(){for(var ee=new Re,ie=0;ie<l.length;ie+=3){ee.x=l[ie+0],ee.y=l[ie+1],ee.z=l[ie+2];var z=Z(ee)/2/Math.PI+.5,he=(me=ee,Math.atan2(-me.y,Math.sqrt(me.x*me.x+me.z*me.z))/Math.PI+.5);d.push(z,1-he)}var me;(function(){for(var ye=new Re,Ae=new Re,Le=new Re,Ge=new Re,et=new zt,Fe=new zt,at=new zt,Je=0,xt=0;Je<l.length;Je+=9,xt+=6){ye.set(l[Je+0],l[Je+1],l[Je+2]),Ae.set(l[Je+3],l[Je+4],l[Je+5]),Le.set(l[Je+6],l[Je+7],l[Je+8]),et.set(d[xt+0],d[xt+1]),Fe.set(d[xt+2],d[xt+3]),at.set(d[xt+4],d[xt+5]),Ge.copy(ye).add(Ae).add(Le).divideScalar(3);var Tt=Z(Ge);j(et,xt+0,ye,Tt),j(Fe,xt+2,Ae,Tt),j(at,xt+4,Le,Tt)}})(),function(){for(var ye=0;ye<d.length;ye+=6){var Ae=d[ye+0],Le=d[ye+2],Ge=d[ye+4],et=Math.max(Ae,Le,Ge),Fe=Math.min(Ae,Le,Ge);.9<et&&Fe<.1&&(Ae<.2&&(d[ye+0]+=1),Le<.2&&(d[ye+2]+=1),Ge<.2&&(d[ye+4]+=1))}}()}(),this.setAttribute("position",new an(l,3)),this.setAttribute("normal",new an(l.slice(),3)),this.setAttribute("uv",new an(d,2)),i===0?this.computeVertexNormals():this.normalizeNormals()}function gr(e,t){lr.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Rc(e,t)),this.mergeVertices()}function Rc(e,t){aa.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],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ea(e,t){lr.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new mi(e,t)),this.mergeVertices()}function mi(e,t){aa.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],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Io(e,t){lr.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Lc(e,t)),this.mergeVertices()}function Lc(e,t){var n=(1+Math.sqrt(5))/2;aa.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],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Jl(e,t){lr.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new fo(e,t)),this.mergeVertices()}function fo(e,t){var n=(1+Math.sqrt(5))/2,i=1/n;aa.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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[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],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ic(e,t,n,i,l,d){lr.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:l},d!==void 0&&console.warn("THREE.TubeGeometry: taper has been removed.");var m=new Ps(e,t,n,i,l);this.tangents=m.tangents,this.normals=m.normals,this.binormals=m.binormals,this.fromBufferGeometry(m),this.mergeVertices()}function Ps(e,t,n,i,l){Cn.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:l},t=t||64,n=n||1,i=i||8,l=l||!1;var d=e.computeFrenetFrames(t,l);this.tangents=d.tangents,this.normals=d.normals,this.binormals=d.binormals;var m,x,L=new Re,j=new Re,Z=new zt,ee=new Re,ie=[],z=[],he=[],me=[];function ye(Ae){ee=e.getPointAt(Ae/t,ee);var Le=d.normals[Ae],Ge=d.binormals[Ae];for(x=0;x<=i;x++){var et=x/i*Math.PI*2,Fe=Math.sin(et),at=-Math.cos(et);j.x=at*Le.x+Fe*Ge.x,j.y=at*Le.y+Fe*Ge.y,j.z=at*Le.z+Fe*Ge.z,j.normalize(),z.push(j.x,j.y,j.z),L.x=ee.x+n*j.x,L.y=ee.y+n*j.y,L.z=ee.z+n*j.z,ie.push(L.x,L.y,L.z)}}(function(){for(m=0;m<t;m++)ye(m);ye(l===!1?t:0),function(){for(m=0;m<=t;m++)for(x=0;x<=i;x++)Z.x=m/t,Z.y=x/i,he.push(Z.x,Z.y)}(),function(){for(x=1;x<=t;x++)for(m=1;m<=i;m++){var Ae=(i+1)*(x-1)+(m-1),Le=(i+1)*x+(m-1),Ge=(i+1)*x+m,et=(i+1)*(x-1)+m;me.push(Ae,Le,et),me.push(Le,Ge,et)}}()})(),this.setIndex(me),this.setAttribute("position",new an(ie,3)),this.setAttribute("normal",new an(z,3)),this.setAttribute("uv",new an(he,2))}function gi(e,t,n,i,l,d,m){lr.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:l,q:d},m!==void 0&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new yi(e,t,n,i,l,d)),this.mergeVertices()}function yi(e,t,n,i,l,d){Cn.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:l,q:d},e=e||1,t=t||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,l=l||2,d=d||3;var m,x,L=[],j=[],Z=[],ee=[],ie=new Re,z=new Re,he=new Re,me=new Re,ye=new Re,Ae=new Re,Le=new Re;for(m=0;m<=n;++m){var Ge=m/n*l*Math.PI*2;for(At(Ge,l,d,e,he),At(.01+Ge,l,d,e,me),Ae.subVectors(me,he),Le.addVectors(me,he),ye.crossVectors(Ae,Le),Le.crossVectors(ye,Ae),ye.normalize(),Le.normalize(),x=0;x<=i;++x){var et=x/i*Math.PI*2,Fe=-t*Math.cos(et),at=t*Math.sin(et);ie.x=he.x+(Fe*Le.x+at*ye.x),ie.y=he.y+(Fe*Le.y+at*ye.y),ie.z=he.z+(Fe*Le.z+at*ye.z),j.push(ie.x,ie.y,ie.z),z.subVectors(ie,he).normalize(),Z.push(z.x,z.y,z.z),ee.push(m/n),ee.push(x/i)}}for(x=1;x<=n;x++)for(m=1;m<=i;m++){var Je=(i+1)*(x-1)+(m-1),xt=(i+1)*x+(m-1),Tt=(i+1)*x+m,Et=(i+1)*(x-1)+m;L.push(Je,xt,Et),L.push(xt,Tt,Et)}function At(Gt,Yt,St,_t,hn){var bn=Math.cos(Gt),Kn=Math.sin(Gt),qn=St/Yt*Gt,Bn=Math.cos(qn);hn.x=_t*(2+Bn)*.5*bn,hn.y=_t*(2+Bn)*Kn*.5,hn.z=_t*Math.sin(qn)*.5}this.setIndex(L),this.setAttribute("position",new an(j,3)),this.setAttribute("normal",new an(Z,3)),this.setAttribute("uv",new an(ee,2))}function kc(e,t,n,i,l){lr.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:l},this.fromBufferGeometry(new ql(e,t,n,i,l)),this.mergeVertices()}function ql(e,t,n,i,l){Cn.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:l},e=e||1,t=t||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,l=l||2*Math.PI;var d,m,x=[],L=[],j=[],Z=[],ee=new Re,ie=new Re,z=new Re;for(d=0;d<=n;d++)for(m=0;m<=i;m++){var he=m/i*l,me=d/n*Math.PI*2;ie.x=(e+t*Math.cos(me))*Math.cos(he),ie.y=(e+t*Math.cos(me))*Math.sin(he),ie.z=t*Math.sin(me),L.push(ie.x,ie.y,ie.z),ee.x=e*Math.cos(he),ee.y=e*Math.sin(he),z.subVectors(ie,ee).normalize(),j.push(z.x,z.y,z.z),Z.push(m/i),Z.push(d/n)}for(d=1;d<=n;d++)for(m=1;m<=i;m++){var ye=(i+1)*d+m-1,Ae=(i+1)*(d-1)+m-1,Le=(i+1)*(d-1)+m,Ge=(i+1)*d+m;x.push(ye,Ae,Ge),x.push(Ae,Le,Ge)}this.setIndex(x),this.setAttribute("position",new an(L,3)),this.setAttribute("normal",new an(j,3)),this.setAttribute("uv",new an(Z,2))}function Xl(e,t,n,i,l){var d,m;if(l===0<function(x,L,j,Z){for(var ee=0,ie=L,z=j-Z;ie<j;ie+=Z)ee+=(x[z]-x[ie])*(x[ie+1]+x[z+1]),z=ie;return ee}(e,t,n,i))for(d=t;d<n;d+=i)m=Nc(d,e[d],e[d+1],m);else for(d=n-i;t<=d;d-=i)m=Nc(d,e[d],e[d+1],m);return m&&Rs(m,m.next)&&(Vc(m),m=m.next),m}function cl(e,t){if(!e)return e;t=t||e;var n,i=e;do if(n=!1,i.steiner||!Rs(i,i.next)&&oi(i.prev,i,i.next)!==0)i=i.next;else{if(Vc(i),(i=t=i.prev)===i.next)break;n=!0}while(n||i!==t);return t}function Yl(e,t,n,i,l,d,m){if(e){!m&&d&&function(Z,ee,ie,z){for(var he=Z;he.z===null&&(he.z=ko(he.x,he.y,ee,ie,z)),he.prevZ=he.prev,he.nextZ=he.next,(he=he.next)!==Z;);he.prevZ.nextZ=null,he.prevZ=null,function(me){var ye,Ae,Le,Ge,et,Fe,at,Je,xt=1;do{for(Ae=me,et=me=null,Fe=0;Ae;){for(Fe++,Le=Ae,ye=at=0;ye<xt&&(at++,Le=Le.nextZ);ye++);for(Je=xt;0<at||0<Je&&Le;)at!==0&&(Je===0||!Le||Ae.z<=Le.z)?(Ae=(Ge=Ae).nextZ,at--):(Le=(Ge=Le).nextZ,Je--),et?et.nextZ=Ge:me=Ge,Ge.prevZ=et,et=Ge;Ae=Le}et.nextZ=null,xt*=2}while(1<Fe)}(he)}(e,i,l,d);for(var x,L,j=e;e.prev!==e.next;)if(x=e.prev,L=e.next,d?mo(e,i,l,d):Gu(e))t.push(x.i/n),t.push(e.i/n),t.push(L.i/n),Vc(e),e=L.next,j=L.next;else if((e=L)===j){m?m===1?Yl(e=Zl(e,t,n),t,n,i,l,d,2):m===2&&Zd(e,t,n,i,l,d):Yl(cl(e),t,n,i,l,d,1);break}}}function Gu(e){var t=e.prev,n=e,i=e.next;if(!(0<=oi(t,n,i))){for(var l=e.next.next;l!==e.prev;){if(ul(t.x,t.y,n.x,n.y,i.x,i.y,l.x,l.y)&&0<=oi(l.prev,l,l.next))return;l=l.next}return 1}}function mo(e,t,n,i){var l=e.prev,d=e,m=e.next;if(!(0<=oi(l,d,m))){for(var x=l.x<d.x?l.x<m.x?l.x:m.x:d.x<m.x?d.x:m.x,L=l.y<d.y?l.y<m.y?l.y:m.y:d.y<m.y?d.y:m.y,j=l.x>d.x?l.x>m.x?l.x:m.x:d.x>m.x?d.x:m.x,Z=l.y>d.y?l.y>m.y?l.y:m.y:d.y>m.y?d.y:m.y,ee=ko(x,L,t,n,i),ie=ko(j,Z,t,n,i),z=e.prevZ,he=e.nextZ;z&&z.z>=ee&&he&&he.z<=ie;){if(z!==e.prev&&z!==e.next&&ul(l.x,l.y,d.x,d.y,m.x,m.y,z.x,z.y)&&0<=oi(z.prev,z,z.next)||(z=z.prevZ,he!==e.prev&&he!==e.next&&ul(l.x,l.y,d.x,d.y,m.x,m.y,he.x,he.y)&&0<=oi(he.prev,he,he.next)))return;he=he.nextZ}for(;z&&z.z>=ee;){if(z!==e.prev&&z!==e.next&&ul(l.x,l.y,d.x,d.y,m.x,m.y,z.x,z.y)&&0<=oi(z.prev,z,z.next))return;z=z.prevZ}for(;he&&he.z<=ie;){if(he!==e.prev&&he!==e.next&&ul(l.x,l.y,d.x,d.y,m.x,m.y,he.x,he.y)&&0<=oi(he.prev,he,he.next))return;he=he.nextZ}return 1}}function Zl(e,t,n){var i=e;do{var l=i.prev,d=i.next.next;!Rs(l,d)&&$r(l,i,i.next,d)&&jc(l,d)&&jc(d,l)&&(t.push(l.i/n),t.push(i.i/n),t.push(d.i/n),Vc(i),Vc(i.next),i=e=d),i=i.next}while(i!==e);return i}function Zd(e,t,n,i,l,d){var m,x,L=e;do{for(var j=L.next.next;j!==L.prev;){if(L.i!==j.i&&(x=j,(m=L).next.i!==x.i&&m.prev.i!==x.i&&!function(ee,ie){var z=ee;do{if(z.i!==ee.i&&z.next.i!==ee.i&&z.i!==ie.i&&z.next.i!==ie.i&&$r(z,z.next,ee,ie))return 1;z=z.next}while(z!==ee)}(m,x)&&jc(m,x)&&jc(x,m)&&function(ee,ie){for(var z=ee,he=!1,me=(ee.x+ie.x)/2,ye=(ee.y+ie.y)/2;z.y>ye!=z.next.y>ye&&z.next.y!==z.y&&me<(z.next.x-z.x)*(ye-z.y)/(z.next.y-z.y)+z.x&&(he=!he),(z=z.next)!==ee;);return he}(m,x))){var Z=Nh(L,j);return L=cl(L,L.next),Z=cl(Z,Z.next),Yl(L,t,n,i,l,d),void Yl(Z,t,n,i,l,d)}j=j.next}L=L.next}while(L!==e)}function Kd(e,t){return e.x-t.x}function pd(e,t){if(t=function(i,l){var d,m=l,x=i.x,L=i.y,j=-1/0;do{if(L<=m.y&&L>=m.next.y&&m.next.y!==m.y){var Z=m.x+(L-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(Z<=x&&j<Z){if((j=Z)===x){if(L===m.y)return m;if(L===m.next.y)return m.next}d=m.x<m.next.x?m:m.next}}m=m.next}while(m!==l);if(!d)return null;if(x===j)return d.prev;var ee,ie=d,z=d.x,he=d.y,me=1/0;for(m=d.next;m!==ie;)x>=m.x&&m.x>=z&&x!==m.x&&ul(L<he?x:j,L,z,he,L<he?j:x,L,m.x,m.y)&&((ee=Math.abs(L-m.y)/(x-m.x))<me||ee===me&&m.x>d.x)&&jc(m,i)&&(d=m,me=ee),m=m.next;return d}(e,t)){var n=Nh(t,e);cl(n,n.next)}}function ko(e,t,n,i,l){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*l)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*l)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Sr(e){for(var t=e,n=e;(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),(t=t.next)!==e;);return n}function ul(e,t,n,i,l,d,m,x){return 0<=(l-m)*(t-x)-(e-m)*(d-x)&&0<=(e-m)*(i-x)-(n-m)*(t-x)&&0<=(n-m)*(d-x)-(l-m)*(i-x)}function oi(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Rs(e,t){return e.x===t.x&&e.y===t.y}function $r(e,t,n,i){return Rs(e,n)&&Rs(t,i)||Rs(e,i)&&Rs(n,t)||0<oi(e,t,n)!=0<oi(e,t,i)&&0<oi(n,i,e)!=0<oi(n,i,t)}function jc(e,t){return oi(e.prev,e,e.next)<0?0<=oi(e,t,e.next)&&0<=oi(e,e.prev,t):oi(e,t,e.prev)<0||oi(e,e.next,t)<0}function Nh(e,t){var n=new Vh(e.i,e.x,e.y),i=new Vh(t.i,t.x,t.y),l=e.next,d=t.prev;return(e.next=t).prev=e,(n.next=l).prev=n,(i.next=n).prev=i,(d.next=i).prev=d,i}function Nc(e,t,n,i){var l=new Vh(e,t,n);return i?(l.next=i.next,(l.prev=i).next.prev=l,i.next=l):(l.prev=l).next=l,l}function Vc(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Vh(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ul.prototype=Object.assign(Object.create(Pt.prototype),{constructor:Ul,isPoints:!0,raycast:function(e,t){var n=this.geometry,i=this.matrixWorld,l=e.params.Points.threshold;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ec.copy(n.boundingSphere),Ec.applyMatrix4(i),Ec.radius+=l,e.ray.intersectsSphere(Ec)!==!1){ku.getInverse(i),ju.copy(e.ray).applyMatrix4(ku);var d=l/((this.scale.x+this.scale.y+this.scale.z)/3),m=d*d;if(n.isBufferGeometry){var x=n.index,L=n.attributes.position.array;if(x!==null)for(var j=x.array,Z=0,ee=j.length;Z<ee;Z++){var ie=j[Z];Nu.fromArray(L,3*ie),Hl(Nu,ie,m,i,e,t,this)}else{Z=0;for(var z=L.length/3;Z<z;Z++)Nu.fromArray(L,3*Z),Hl(Nu,Z,m,i,e,t,this)}}else{var he=n.vertices;for(Z=0,z=he.length;Z<z;Z++)Hl(he[Z],Z,m,i,e,t,this)}}},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var l=i.morphAttributes,d=Object.keys(l);if(0<d.length){var m=l[d[0]];if(m!==void 0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=m.length;e<t;e++)n=m[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var x=i.morphTargets;x!==void 0&&0<x.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)}}),Wl.prototype=Object.assign(Object.create(Xr.prototype),{constructor:Wl,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((Vu.prototype=Object.create(Xr.prototype)).constructor=Vu).prototype.isCompressedTexture=!0,((Ac.prototype=Object.create(Xr.prototype)).constructor=Ac).prototype.isCanvasTexture=!0,((Fu.prototype=Object.create(Xr.prototype)).constructor=Fu).prototype.isDepthTexture=!0,(Oc.prototype=Object.create(Cn.prototype)).constructor=Oc,($a.prototype=Object.create(lr.prototype)).constructor=$a,(Pc.prototype=Object.create(Cn.prototype)).constructor=Pc,(Bu.prototype=Object.create(lr.prototype)).constructor=Bu,(aa.prototype=Object.create(Cn.prototype)).constructor=aa,(gr.prototype=Object.create(lr.prototype)).constructor=gr,(Rc.prototype=Object.create(aa.prototype)).constructor=Rc,(Ea.prototype=Object.create(lr.prototype)).constructor=Ea,(mi.prototype=Object.create(aa.prototype)).constructor=mi,(Io.prototype=Object.create(lr.prototype)).constructor=Io,(Lc.prototype=Object.create(aa.prototype)).constructor=Lc,(Jl.prototype=Object.create(lr.prototype)).constructor=Jl,(fo.prototype=Object.create(aa.prototype)).constructor=fo,(Ic.prototype=Object.create(lr.prototype)).constructor=Ic,((Ps.prototype=Object.create(Cn.prototype)).constructor=Ps).prototype.toJSON=function(){var e=Cn.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},(gi.prototype=Object.create(lr.prototype)).constructor=gi,(yi.prototype=Object.create(Cn.prototype)).constructor=yi,(kc.prototype=Object.create(lr.prototype)).constructor=kc,(ql.prototype=Object.create(Cn.prototype)).constructor=ql;var hs={area:function(e){for(var t=e.length,n=0,i=t-1,l=0;l<t;i=l++)n+=e[i].x*e[l].y-e[l].x*e[i].y;return .5*n},isClockWise:function(e){return hs.area(e)<0},triangulateShape:function(e,t){var n=[],i=[],l=[];fd(e),zu(n,e);var d=e.length;t.forEach(fd);for(var m=0;m<t.length;m++)i.push(d),d+=t[m].length,zu(n,t[m]);var x=function(L,j,Z){Z=Z||2;var ee,ie,z,he,me,ye,Ae,Le=j&&j.length,Ge=Le?j[0]*Z:L.length,et=Xl(L,0,Ge,Z,!0),Fe=[];if(!et||et.next===et.prev)return Fe;if(Le&&(et=function(Je,xt,Tt,Et){var At,Gt,Yt,St=[];for(At=0,Gt=xt.length;At<Gt;At++)(Yt=Xl(Je,xt[At]*Et,At<Gt-1?xt[At+1]*Et:Je.length,Et,!1))===Yt.next&&(Yt.steiner=!0),St.push(Sr(Yt));for(St.sort(Kd),At=0;At<St.length;At++)pd(St[At],Tt),Tt=cl(Tt,Tt.next);return Tt}(L,j,et,Z)),L.length>80*Z){ee=z=L[0],ie=he=L[1];for(var at=Z;at<Ge;at+=Z)(me=L[at])<ee&&(ee=me),(ye=L[at+1])<ie&&(ie=ye),z<me&&(z=me),he<ye&&(he=ye);Ae=(Ae=Math.max(z-ee,he-ie))!==0?1/Ae:0}return Yl(et,Fe,Z,ee,ie,Ae),Fe}(n,i);for(m=0;m<x.length;m+=3)l.push(x.slice(m,m+3));return l}};function fd(e){var t=e.length;2<t&&e[t-1].equals(e[0])&&e.pop()}function zu(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function hl(e,t){lr.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Ls(e,t)),this.mergeVertices()}function Ls(e,t){Cn.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t};for(var n=this,i=[],l=[],d=0,m=(e=Array.isArray(e)?e:[e]).length;d<m;d++)x(e[d]);function x(L){var j=[],Z=t.curveSegments!==void 0?t.curveSegments:12,ee=t.steps!==void 0?t.steps:1,ie=t.depth!==void 0?t.depth:100,z=t.bevelEnabled===void 0||t.bevelEnabled,he=t.bevelThickness!==void 0?t.bevelThickness:6,me=t.bevelSize!==void 0?t.bevelSize:he-2,ye=t.bevelOffset!==void 0?t.bevelOffset:0,Ae=t.bevelSegments!==void 0?t.bevelSegments:3,Le=t.extrudePath,Ge=t.UVGenerator!==void 0?t.UVGenerator:$d;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),ie=t.amount);var et,Fe,at,Je,xt,Tt,Et,At,Gt=!1;Le&&(et=Le.getSpacedPoints(ee),z=!(Gt=!0),Fe=Le.computeFrenetFrames(ee,!1),at=new Re,Je=new Re,xt=new Re),z||(ye=me=he=Ae=0);var Yt=L.extractPoints(Z),St=Yt.shape,_t=Yt.holes;if(!hs.isClockWise(St))for(St=St.reverse(),Et=0,At=_t.length;Et<At;Et++)Tt=_t[Et],hs.isClockWise(Tt)&&(_t[Et]=Tt.reverse());var hn=hs.triangulateShape(St,_t),bn=St;for(Et=0,At=_t.length;Et<At;Et++)Tt=_t[Et],St=St.concat(Tt);function Kn(Ir,si,xi){return si||console.error("THREE.ExtrudeGeometry: vec does not exist"),si.clone().multiplyScalar(xi).add(Ir)}var qn,Bn,ur,Sn,Ne,nt,qt=St.length,Ht=hn.length;function rr(Ir,si,xi){var sa,Qr,ta,to=Ir.x-si.x,yo=Ir.y-si.y,fs=xi.x-Ir.x,Fs=xi.y-Ir.y,rh=to*to+yo*yo,jp=to*Fs-yo*fs;if(Math.abs(jp)>Number.EPSILON){var ih=Math.sqrt(rh),ru=Math.sqrt(fs*fs+Fs*Fs),iu=si.x-yo/ih,au=si.y+to/ih,ou=((xi.x-Fs/ru-iu)*Fs-(xi.y+fs/ru-au)*fs)/(to*Fs-yo*fs),Gh=(sa=iu+to*ou-Ir.x)*sa+(Qr=au+yo*ou-Ir.y)*Qr;if(Gh<=2)return new zt(sa,Qr);ta=Math.sqrt(Gh/2)}else{var Co=!1;to>Number.EPSILON?fs>Number.EPSILON&&(Co=!0):to<-Number.EPSILON?fs<-Number.EPSILON&&(Co=!0):Math.sign(yo)===Math.sign(Fs)&&(Co=!0),ta=Co?(sa=-yo,Qr=to,Math.sqrt(rh)):(sa=to,Qr=yo,Math.sqrt(rh/2))}return new zt(sa/ta,Qr/ta)}for(var Dn=[],Dt=0,An=bn.length,hr=An-1,pt=Dt+1;Dt<An;Dt++,hr++,pt++)hr===An&&(hr=0),pt===An&&(pt=0),Dn[Dt]=rr(bn[Dt],bn[hr],bn[pt]);var Mn,_n,ir=[],cn=Dn.concat();for(Et=0,At=_t.length;Et<At;Et++){for(Tt=_t[Et],Mn=[],Dt=0,hr=(An=Tt.length)-1,pt=Dt+1;Dt<An;Dt++,hr++,pt++)hr===An&&(hr=0),pt===An&&(pt=0),Mn[Dt]=rr(Tt[Dt],Tt[hr],Tt[pt]);ir.push(Mn),cn=cn.concat(Mn)}for(qn=0;qn<Ae;qn++){for(ur=qn/Ae,Sn=he*Math.cos(ur*Math.PI/2),Bn=me*Math.sin(ur*Math.PI/2)+ye,Dt=0,An=bn.length;Dt<An;Dt++)Or((Ne=Kn(bn[Dt],Dn[Dt],Bn)).x,Ne.y,-Sn);for(Et=0,At=_t.length;Et<At;Et++)for(Tt=_t[Et],Mn=ir[Et],Dt=0,An=Tt.length;Dt<An;Dt++)Or((Ne=Kn(Tt[Dt],Mn[Dt],Bn)).x,Ne.y,-Sn)}for(Bn=me+ye,Dt=0;Dt<qt;Dt++)Ne=z?Kn(St[Dt],cn[Dt],Bn):St[Dt],Gt?(Je.copy(Fe.normals[0]).multiplyScalar(Ne.x),at.copy(Fe.binormals[0]).multiplyScalar(Ne.y),xt.copy(et[0]).add(Je).add(at),Or(xt.x,xt.y,xt.z)):Or(Ne.x,Ne.y,0);for(_n=1;_n<=ee;_n++)for(Dt=0;Dt<qt;Dt++)Ne=z?Kn(St[Dt],cn[Dt],Bn):St[Dt],Gt?(Je.copy(Fe.normals[_n]).multiplyScalar(Ne.x),at.copy(Fe.binormals[_n]).multiplyScalar(Ne.y),xt.copy(et[_n]).add(Je).add(at),Or(xt.x,xt.y,xt.z)):Or(Ne.x,Ne.y,ie/ee*_n);for(qn=Ae-1;0<=qn;qn--){for(ur=qn/Ae,Sn=he*Math.cos(ur*Math.PI/2),Bn=me*Math.sin(ur*Math.PI/2)+ye,Dt=0,An=bn.length;Dt<An;Dt++)Or((Ne=Kn(bn[Dt],Dn[Dt],Bn)).x,Ne.y,ie+Sn);for(Et=0,At=_t.length;Et<At;Et++)for(Tt=_t[Et],Mn=ir[Et],Dt=0,An=Tt.length;Dt<An;Dt++)Ne=Kn(Tt[Dt],Mn[Dt],Bn),Gt?Or(Ne.x,Ne.y+et[ee-1].y,et[ee-1].x+Sn):Or(Ne.x,Ne.y,ie+Sn)}function wr(Ir,si){var xi,sa;for(Dt=Ir.length;0<=--Dt;){(sa=(xi=Dt)-1)<0&&(sa=Ir.length-1);var Qr=0,ta=ee+2*Ae;for(Qr=0;Qr<ta;Qr++){var to=qt*Qr,yo=qt*(Qr+1);go(si+xi+to,si+sa+to,si+sa+yo,si+xi+yo)}}}function Or(Ir,si,xi){j.push(Ir),j.push(si),j.push(xi)}function vi(Ir,si,xi){Vr(Ir),Vr(si),Vr(xi);var sa=i.length/3,Qr=Ge.generateTopUV(n,i,sa-3,sa-2,sa-1);Pi(Qr[0]),Pi(Qr[1]),Pi(Qr[2])}function go(Ir,si,xi,sa){Vr(Ir),Vr(si),Vr(sa),Vr(si),Vr(xi),Vr(sa);var Qr=i.length/3,ta=Ge.generateSideWallUV(n,i,Qr-6,Qr-3,Qr-2,Qr-1);Pi(ta[0]),Pi(ta[1]),Pi(ta[3]),Pi(ta[1]),Pi(ta[2]),Pi(ta[3])}function Vr(Ir){i.push(j[3*Ir+0]),i.push(j[3*Ir+1]),i.push(j[3*Ir+2])}function Pi(Ir){l.push(Ir.x),l.push(Ir.y)}(function(){var Ir=i.length/3;if(z){var si=0,xi=qt*si;for(Dt=0;Dt<Ht;Dt++)vi((nt=hn[Dt])[2]+xi,nt[1]+xi,nt[0]+xi);for(xi=qt*(si=ee+2*Ae),Dt=0;Dt<Ht;Dt++)vi((nt=hn[Dt])[0]+xi,nt[1]+xi,nt[2]+xi)}else{for(Dt=0;Dt<Ht;Dt++)vi((nt=hn[Dt])[2],nt[1],nt[0]);for(Dt=0;Dt<Ht;Dt++)vi((nt=hn[Dt])[0]+qt*ee,nt[1]+qt*ee,nt[2]+qt*ee)}n.addGroup(Ir,i.length/3-Ir,0)})(),function(){var Ir=i.length/3,si=0;for(wr(bn,si),si+=bn.length,Et=0,At=_t.length;Et<At;Et++)wr(Tt=_t[Et],si),si+=Tt.length;n.addGroup(Ir,i.length/3-Ir,1)}()}this.setAttribute("position",new an(i,3)),this.setAttribute("uv",new an(l,2)),this.computeVertexNormals()}((hl.prototype=Object.create(lr.prototype)).constructor=hl).prototype.toJSON=function(){var e=lr.prototype.toJSON.call(this);return md(this.parameters.shapes,this.parameters.options,e)},((Ls.prototype=Object.create(Cn.prototype)).constructor=Ls).prototype.toJSON=function(){var e=Cn.prototype.toJSON.call(this);return md(this.parameters.shapes,this.parameters.options,e)};var $d={generateTopUV:function(e,t,n,i,l){var d=t[3*n],m=t[3*n+1],x=t[3*i],L=t[3*i+1],j=t[3*l],Z=t[3*l+1];return[new zt(d,m),new zt(x,L),new zt(j,Z)]},generateSideWallUV:function(e,t,n,i,l,d){var m=t[3*n],x=t[3*n+1],L=t[3*n+2],j=t[3*i],Z=t[3*i+1],ee=t[3*i+2],ie=t[3*l],z=t[3*l+1],he=t[3*l+2],me=t[3*d],ye=t[3*d+1],Ae=t[3*d+2];return Math.abs(x-Z)<.01?[new zt(m,1-L),new zt(j,1-ee),new zt(ie,1-he),new zt(me,1-Ae)]:[new zt(x,1-L),new zt(Z,1-ee),new zt(z,1-he),new zt(ye,1-Ae)]}};function md(e,t,n){if(n.shapes=[],Array.isArray(e))for(var i=0,l=e.length;i<l;i++){var d=e[i];n.shapes.push(d.uuid)}else n.shapes.push(e.uuid);return t.extrudePath!==void 0&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function Ji(e,t){lr.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new fa(e,t)),this.mergeVertices()}function fa(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new lr;var i=n.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),Ls.call(this,i,t),this.type="TextBufferGeometry"}function Uu(e,t,n,i,l,d,m){lr.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:l,thetaStart:d,thetaLength:m},this.fromBufferGeometry(new dl(e,t,n,i,l,d,m)),this.mergeVertices()}function dl(e,t,n,i,l,d,m){Cn.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:l,thetaStart:d,thetaLength:m},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),i=i!==void 0?i:0,l=l!==void 0?l:2*Math.PI,d=d!==void 0?d:0,m=m!==void 0?m:Math.PI;var x,L,j=Math.min(d+m,Math.PI),Z=0,ee=[],ie=new Re,z=new Re,he=[],me=[],ye=[],Ae=[];for(L=0;L<=n;L++){var Le=[],Ge=L/n,et=0;for(L==0&&d==0?et=.5/t:L==n&&j==Math.PI&&(et=-.5/t),x=0;x<=t;x++){var Fe=x/t;ie.x=-e*Math.cos(i+Fe*l)*Math.sin(d+Ge*m),ie.y=e*Math.cos(d+Ge*m),ie.z=e*Math.sin(i+Fe*l)*Math.sin(d+Ge*m),me.push(ie.x,ie.y,ie.z),z.copy(ie).normalize(),ye.push(z.x,z.y,z.z),Ae.push(Fe+et,1-Ge),Le.push(Z++)}ee.push(Le)}for(L=0;L<n;L++)for(x=0;x<t;x++){var at=ee[L][x+1],Je=ee[L][x],xt=ee[L+1][x],Tt=ee[L+1][x+1];(L!==0||0<d)&&he.push(at,Je,Tt),(L!==n-1||j<Math.PI)&&he.push(Je,xt,Tt)}this.setIndex(he),this.setAttribute("position",new an(me,3)),this.setAttribute("normal",new an(ye,3)),this.setAttribute("uv",new an(Ae,2))}function Hu(e,t,n,i,l,d){lr.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:l,thetaLength:d},this.fromBufferGeometry(new Fc(e,t,n,i,l,d)),this.mergeVertices()}function Fc(e,t,n,i,l,d){Cn.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:l,thetaLength:d},e=e||.5,t=t||1,l=l!==void 0?l:0,d=d!==void 0?d:2*Math.PI,n=n!==void 0?Math.max(3,n):8;var m,x,L,j=[],Z=[],ee=[],ie=[],z=e,he=(t-e)/(i=i!==void 0?Math.max(1,i):1),me=new Re,ye=new zt;for(x=0;x<=i;x++){for(L=0;L<=n;L++)m=l+L/n*d,me.x=z*Math.cos(m),me.y=z*Math.sin(m),Z.push(me.x,me.y,me.z),ee.push(0,0,1),ye.x=(me.x/t+1)/2,ye.y=(me.y/t+1)/2,ie.push(ye.x,ye.y);z+=he}for(x=0;x<i;x++){var Ae=x*(n+1);for(L=0;L<n;L++){var Le=m=L+Ae,Ge=m+n+1,et=m+n+2,Fe=m+1;j.push(Le,Ge,Fe),j.push(Ge,et,Fe)}}this.setIndex(j),this.setAttribute("position",new an(Z,3)),this.setAttribute("normal",new an(ee,3)),this.setAttribute("uv",new an(ie,2))}function Bc(e,t,n,i){lr.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},this.fromBufferGeometry(new Kl(e,t,n,i)),this.mergeVertices()}function Kl(e,t,n,i){Cn.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t)||12,n=n||0,i=i||2*Math.PI,i=yr.clamp(i,0,2*Math.PI);var l,d,m,x=[],L=[],j=[],Z=1/t,ee=new Re,ie=new zt;for(d=0;d<=t;d++){var z=n+d*Z*i,he=Math.sin(z),me=Math.cos(z);for(m=0;m<=e.length-1;m++)ee.x=e[m].x*he,ee.y=e[m].y,ee.z=e[m].x*me,L.push(ee.x,ee.y,ee.z),ie.x=d/t,ie.y=m/(e.length-1),j.push(ie.x,ie.y)}for(d=0;d<t;d++)for(m=0;m<e.length-1;m++){var ye=l=m+d*e.length,Ae=l+e.length,Le=l+e.length+1,Ge=l+1;x.push(ye,Ae,Ge),x.push(Ae,Le,Ge)}if(this.setIndex(x),this.setAttribute("position",new an(L,3)),this.setAttribute("uv",new an(j,2)),this.computeVertexNormals(),i===2*Math.PI){var et=this.attributes.normal.array,Fe=new Re,at=new Re,Je=new Re;for(l=t*e.length*3,m=d=0;d<e.length;d++,m+=3)Fe.x=et[m+0],Fe.y=et[m+1],Fe.z=et[m+2],at.x=et[l+m+0],at.y=et[l+m+1],at.z=et[l+m+2],Je.addVectors(Fe,at).normalize(),et[m+0]=et[l+m+0]=Je.x,et[m+1]=et[l+m+1]=Je.y,et[m+2]=et[l+m+2]=Je.z}}function $l(e,t){lr.call(this),this.type="ShapeGeometry",typeof t=="object"&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new $o(e,t)),this.mergeVertices()}function $o(e,t){Cn.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],i=[],l=[],d=[],m=0,x=0;if(Array.isArray(e)===!1)j(e);else for(var L=0;L<e.length;L++)j(e[L]),this.addGroup(m,x,L),m+=x,x=0;function j(Z){var ee,ie,z,he=i.length/3,me=Z.extractPoints(t),ye=me.shape,Ae=me.holes;for(hs.isClockWise(ye)===!1&&(ye=ye.reverse()),ee=0,ie=Ae.length;ee<ie;ee++)z=Ae[ee],hs.isClockWise(z)===!0&&(Ae[ee]=z.reverse());var Le=hs.triangulateShape(ye,Ae);for(ee=0,ie=Ae.length;ee<ie;ee++)z=Ae[ee],ye=ye.concat(z);for(ee=0,ie=ye.length;ee<ie;ee++){var Ge=ye[ee];i.push(Ge.x,Ge.y,0),l.push(0,0,1),d.push(Ge.x,Ge.y)}for(ee=0,ie=Le.length;ee<ie;ee++){var et=Le[ee],Fe=et[0]+he,at=et[1]+he,Je=et[2]+he;n.push(Fe,at,Je),x+=3}}this.setIndex(n),this.setAttribute("position",new an(i,3)),this.setAttribute("normal",new an(l,3)),this.setAttribute("uv",new an(d,2))}function gd(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,i=e.length;n<i;n++){var l=e[n];t.shapes.push(l.uuid)}else t.shapes.push(e.uuid);return t}function Ql(e,t){Cn.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1;var n,i,l,d,m=[],x=Math.cos(yr.DEG2RAD*t),L=[0,0],j={},Z=["a","b","c"];e.isBufferGeometry?(d=new lr).fromBufferGeometry(e):d=e.clone(),d.mergeVertices(),d.computeFaceNormals();for(var ee=d.vertices,ie=d.faces,z=0,he=ie.length;z<he;z++)for(var me=ie[z],ye=0;ye<3;ye++)n=me[Z[ye]],i=me[Z[(ye+1)%3]],L[0]=Math.min(n,i),L[1]=Math.max(n,i),j[l=L[0]+","+L[1]]===void 0?j[l]={index1:L[0],index2:L[1],face1:z,face2:void 0}:j[l].face2=z;for(l in j){var Ae=j[l];if(Ae.face2===void 0||ie[Ae.face1].normal.dot(ie[Ae.face2].normal)<=x){var Le=ee[Ae.index1];m.push(Le.x,Le.y,Le.z),Le=ee[Ae.index2],m.push(Le.x,Le.y,Le.z)}}this.setAttribute("position",new an(m,3))}function pl(e,t,n,i,l,d,m,x){lr.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:l,openEnded:d,thetaStart:m,thetaLength:x},this.fromBufferGeometry(new Is(e,t,n,i,l,d,m,x)),this.mergeVertices()}function Is(e,t,n,i,l,d,m,x){Cn.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:l,openEnded:d,thetaStart:m,thetaLength:x};var L=this;e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,l=Math.floor(l)||1,d=d!==void 0&&d,m=m!==void 0?m:0,x=x!==void 0?x:2*Math.PI;var j=[],Z=[],ee=[],ie=[],z=0,he=[],me=n/2,ye=0;function Ae(Le){var Ge,et,Fe,at=new zt,Je=new Re,xt=0,Tt=Le===!0?e:t,Et=Le===!0?1:-1;for(et=z,Ge=1;Ge<=i;Ge++)Z.push(0,me*Et,0),ee.push(0,Et,0),ie.push(.5,.5),z++;for(Fe=z,Ge=0;Ge<=i;Ge++){var At=Ge/i*x+m,Gt=Math.cos(At),Yt=Math.sin(At);Je.x=Tt*Yt,Je.y=me*Et,Je.z=Tt*Gt,Z.push(Je.x,Je.y,Je.z),ee.push(0,Et,0),at.x=.5*Gt+.5,at.y=.5*Yt*Et+.5,ie.push(at.x,at.y),z++}for(Ge=0;Ge<i;Ge++){var St=et+Ge,_t=Fe+Ge;Le===!0?j.push(_t,_t+1,St):j.push(_t+1,_t,St),xt+=3}L.addGroup(ye,xt,Le===!0?1:2),ye+=xt}(function(){var Le,Ge,et=new Re,Fe=new Re,at=0,Je=(t-e)/n;for(Ge=0;Ge<=l;Ge++){var xt=[],Tt=Ge/l,Et=Tt*(t-e)+e;for(Le=0;Le<=i;Le++){var At=Le/i,Gt=At*x+m,Yt=Math.sin(Gt),St=Math.cos(Gt);Fe.x=Et*Yt,Fe.y=-Tt*n+me,Fe.z=Et*St,Z.push(Fe.x,Fe.y,Fe.z),et.set(Yt,Je,St).normalize(),ee.push(et.x,et.y,et.z),ie.push(At,1-Tt),xt.push(z++)}he.push(xt)}for(Le=0;Le<i;Le++)for(Ge=0;Ge<l;Ge++){var _t=he[Ge][Le],hn=he[Ge+1][Le],bn=he[Ge+1][Le+1],Kn=he[Ge][Le+1];j.push(_t,hn,Kn),j.push(hn,bn,Kn),at+=6}L.addGroup(ye,at,0),ye+=at})(),d===!1&&(0<e&&Ae(!0),0<t&&Ae(!1)),this.setIndex(j),this.setAttribute("position",new an(Z,3)),this.setAttribute("normal",new an(ee,3)),this.setAttribute("uv",new an(ie,2))}function Wu(e,t,n,i,l,d,m){pl.call(this,0,e,t,n,i,l,d,m),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:l,thetaStart:d,thetaLength:m}}function Ju(e,t,n,i,l,d,m){Is.call(this,0,e,t,n,i,l,d,m),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:l,thetaStart:d,thetaLength:m}}function qu(e,t,n,i){lr.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new Gc(e,t,n,i)),this.mergeVertices()}function Gc(e,t,n,i){Cn.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},e=e||1,t=t!==void 0?Math.max(3,t):8,n=n!==void 0?n:0,i=i!==void 0?i:2*Math.PI;var l,d,m=[],x=[],L=[],j=[],Z=new Re,ee=new zt;for(x.push(0,0,0),L.push(0,0,1),j.push(.5,.5),d=0,l=3;d<=t;d++,l+=3){var ie=n+d/t*i;Z.x=e*Math.cos(ie),Z.y=e*Math.sin(ie),x.push(Z.x,Z.y,Z.z),L.push(0,0,1),ee.x=(x[l]/e+1)/2,ee.y=(x[l+1]/e+1)/2,j.push(ee.x,ee.y)}for(l=1;l<=t;l++)m.push(l,l+1,0);this.setIndex(m),this.setAttribute("position",new an(x,3)),this.setAttribute("normal",new an(L,3)),this.setAttribute("uv",new an(j,2))}(Ji.prototype=Object.create(lr.prototype)).constructor=Ji,(fa.prototype=Object.create(Ls.prototype)).constructor=fa,(Uu.prototype=Object.create(lr.prototype)).constructor=Uu,(dl.prototype=Object.create(Cn.prototype)).constructor=dl,(Hu.prototype=Object.create(lr.prototype)).constructor=Hu,(Fc.prototype=Object.create(Cn.prototype)).constructor=Fc,(Bc.prototype=Object.create(lr.prototype)).constructor=Bc,(Kl.prototype=Object.create(Cn.prototype)).constructor=Kl,(($l.prototype=Object.create(lr.prototype)).constructor=$l).prototype.toJSON=function(){var e=lr.prototype.toJSON.call(this);return gd(this.parameters.shapes,e)},(($o.prototype=Object.create(Cn.prototype)).constructor=$o).prototype.toJSON=function(){var e=Cn.prototype.toJSON.call(this);return gd(this.parameters.shapes,e)},(Ql.prototype=Object.create(Cn.prototype)).constructor=Ql,(pl.prototype=Object.create(lr.prototype)).constructor=pl,(Is.prototype=Object.create(Cn.prototype)).constructor=Is,(Wu.prototype=Object.create(pl.prototype)).constructor=Wu,(Ju.prototype=Object.create(Is.prototype)).constructor=Ju,(qu.prototype=Object.create(lr.prototype)).constructor=qu,(Gc.prototype=Object.create(Cn.prototype)).constructor=Gc;var Ga=Object.freeze({__proto__:null,WireframeGeometry:Oc,ParametricGeometry:$a,ParametricBufferGeometry:Pc,TetrahedronGeometry:gr,TetrahedronBufferGeometry:Rc,OctahedronGeometry:Ea,OctahedronBufferGeometry:mi,IcosahedronGeometry:Io,IcosahedronBufferGeometry:Lc,DodecahedronGeometry:Jl,DodecahedronBufferGeometry:fo,PolyhedronGeometry:Bu,PolyhedronBufferGeometry:aa,TubeGeometry:Ic,TubeBufferGeometry:Ps,TorusKnotGeometry:gi,TorusKnotBufferGeometry:yi,TorusGeometry:kc,TorusBufferGeometry:ql,TextGeometry:Ji,TextBufferGeometry:fa,SphereGeometry:Uu,SphereBufferGeometry:dl,RingGeometry:Hu,RingBufferGeometry:Fc,PlaneGeometry:Ll,PlaneBufferGeometry:el,LatheGeometry:Bc,LatheBufferGeometry:Kl,ShapeGeometry:$l,ShapeBufferGeometry:$o,ExtrudeGeometry:hl,ExtrudeBufferGeometry:Ls,EdgesGeometry:Ql,ConeGeometry:Wu,ConeBufferGeometry:Ju,CylinderGeometry:pl,CylinderBufferGeometry:Is,CircleGeometry:qu,CircleBufferGeometry:Gc,BoxGeometry:sh,BoxBufferGeometry:cc});function fl(e){It.call(this),this.type="ShadowMaterial",this.color=new Qe(0),this.transparent=!0,this.setValues(e)}function ks(e){Ya.call(this,e),this.type="RawShaderMaterial"}function ds(e){It.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Qe(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 Qe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=wo,this.normalScale=new zt(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(e)}function zc(e){ds.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new zt(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(e)}function js(e){It.call(this),this.type="MeshPhongMaterial",this.color=new Qe(16777215),this.specular=new Qe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Qe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=wo,this.normalScale=new zt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=se,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(e)}function Uc(e){It.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Qe(16777215),this.specular=new Qe(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 Qe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=wo,this.normalScale=new zt(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(e)}function Hc(e){It.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=wo,this.normalScale=new zt(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(e)}function ma(e){It.call(this),this.type="MeshLambertMaterial",this.color=new Qe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Qe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=se,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(e)}function ml(e){It.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Qe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=wo,this.normalScale=new zt(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(e)}function Wc(e){Vi.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}((fl.prototype=Object.create(It.prototype)).constructor=fl).prototype.isShadowMaterial=!0,fl.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.color.copy(e.color),this},((ks.prototype=Object.create(Ya.prototype)).constructor=ks).prototype.isRawShaderMaterial=!0,((ds.prototype=Object.create(It.prototype)).constructor=ds).prototype.isMeshStandardMaterial=!0,ds.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((zc.prototype=Object.create(ds.prototype)).constructor=zc).prototype.isMeshPhysicalMaterial=!0,zc.prototype.copy=function(e){return ds.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearcoat=e.clearcoat,this.clearcoatRoughness=e.clearcoatRoughness,e.sheen?this.sheen=(this.sheen||new Qe).copy(e.sheen):this.sheen=null,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.transparency=e.transparency,this},((js.prototype=Object.create(It.prototype)).constructor=js).prototype.isMeshPhongMaterial=!0,js.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((Uc.prototype=Object.create(It.prototype)).constructor=Uc).prototype.isMeshToonMaterial=!0,Uc.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((Hc.prototype=Object.create(It.prototype)).constructor=Hc).prototype.isMeshNormalMaterial=!0,Hc.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((ma.prototype=Object.create(It.prototype)).constructor=ma).prototype.isMeshLambertMaterial=!0,ma.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((ml.prototype=Object.create(It.prototype)).constructor=ml).prototype.isMeshMatcapMaterial=!0,ml.prototype.copy=function(e){return It.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},((Wc.prototype=Object.create(Vi.prototype)).constructor=Wc).prototype.isLineDashedMaterial=!0,Wc.prototype.copy=function(e){return Vi.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Qd=Object.freeze({__proto__:null,ShadowMaterial:fl,SpriteMaterial:ol,RawShaderMaterial:ks,ShaderMaterial:Ya,PointsMaterial:Ko,MeshPhysicalMaterial:zc,MeshStandardMaterial:ds,MeshPhongMaterial:js,MeshToonMaterial:Uc,MeshNormalMaterial:Hc,MeshLambertMaterial:ma,MeshDepthMaterial:Xo,MeshDistanceMaterial:rl,MeshBasicMaterial:_r,MeshMatcapMaterial:ml,LineDashedMaterial:Wc,LineBasicMaterial:Vi,Material:It}),Oi={arraySlice:function(e,t,n){return Oi.isTypedArray(e)?new e.constructor(e.subarray(t,n!==void 0?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:typeof t.BYTES_PER_ELEMENT=="number"?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),i=0;i!==t;++i)n[i]=i;return n.sort(function(l,d){return e[l]-e[d]}),n},sortedArray:function(e,t,n){for(var i=e.length,l=new e.constructor(i),d=0,m=0;m!==i;++d)for(var x=n[d]*t,L=0;L!==t;++L)l[m++]=e[x+L];return l},flattenJSON:function(e,t,n,i){for(var l=1,d=e[0];d!==void 0&&d[i]===void 0;)d=e[l++];if(d!==void 0){var m=d[i];if(m!==void 0)if(Array.isArray(m))for(;(m=d[i])!==void 0&&(t.push(d.time),n.push.apply(n,m)),(d=e[l++])!==void 0;);else if(m.toArray!==void 0)for(;(m=d[i])!==void 0&&(t.push(d.time),m.toArray(n,n.length)),(d=e[l++])!==void 0;);else for(;(m=d[i])!==void 0&&(t.push(d.time),n.push(m)),(d=e[l++])!==void 0;);}},subclip:function(e,t,n,i,l){l=l||30;var d=e.clone();d.name=t;for(var m=[],x=0;x<d.tracks.length;++x){for(var L=d.tracks[x],j=L.getValueSize(),Z=[],ee=[],ie=0;ie<L.times.length;++ie){var z=L.times[ie]*l;if(!(z<n||i<=z)){Z.push(L.times[ie]);for(var he=0;he<j;++he)ee.push(L.values[ie*j+he])}}Z.length!==0&&(L.times=Oi.convertArray(Z,L.times.constructor),L.values=Oi.convertArray(ee,L.values.constructor),m.push(L))}d.tracks=m;var me=1/0;for(x=0;x<d.tracks.length;++x)me>d.tracks[x].times[0]&&(me=d.tracks[x].times[0]);for(x=0;x<d.tracks.length;++x)d.tracks[x].shift(-1*me);return d.resetDuration(),d}};function za(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Xu(e,t,n,i){za.call(this,e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Jc(e,t,n,i){za.call(this,e,t,n,i)}function Yu(e,t,n,i){za.call(this,e,t,n,i)}function ga(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Oi.convertArray(t,this.TimeBufferType),this.values=Oi.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function Zu(e,t,n){ga.call(this,e,t,n)}function Ku(e,t,n,i){ga.call(this,e,t,n,i)}function Ns(e,t,n,i){ga.call(this,e,t,n,i)}function ec(e,t,n,i){za.call(this,e,t,n,i)}function gl(e,t,n,i){ga.call(this,e,t,n,i)}function $u(e,t,n,i){ga.call(this,e,t,n,i)}function tc(e,t,n,i){ga.call(this,e,t,n,i)}function To(e,t,n){this.name=e,this.tracks=n,this.duration=t!==void 0?t:-1,this.uuid=yr.generateUUID(),this.duration<0&&this.resetDuration()}function ep(e){if(e.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=function(l){switch(l.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ns;case"vector":case"vector2":case"vector3":case"vector4":return tc;case"color":return Ku;case"quaternion":return gl;case"bool":case"boolean":return Zu;case"string":return $u}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+l)}(e.type);if(e.times===void 0){var n=[],i=[];Oi.flattenJSON(e.keys,n,i,"value"),e.times=n,e.values=i}return t.parse!==void 0?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(za.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,i=t[n],l=t[n-1];e:{t:{var d;n:{a:if(!(e<i)){for(var m=n+2;;){if(i===void 0){if(e<l)break a;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,l)}if(n===m)break;if(l=i,e<(i=t[++n]))break t}d=t.length;break n}if(l<=e)break e;var x=t[1];for(e<x&&(n=2,l=x),m=n-2;;){if(l===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===m)break;if(i=l,(l=t[--n-1])<=e)break t}d=n,n=0}for(;n<d;){var L=n+d>>>1;e<t[L]?d=L:n=1+L}if(i=t[n],(l=t[n-1])===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(i===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,l,e)}this._cachedIndex=n,this.intervalChanged_(n,l,i)}return this.interpolate_(n,l,e,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,l=e*i,d=0;d!==i;++d)t[d]=n[l+d];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(za.prototype,{beforeStart_:za.prototype.copySampleValue_,afterEnd_:za.prototype.copySampleValue_}),Xu.prototype=Object.assign(Object.create(za.prototype),{constructor:Xu,DefaultSettings_:{endingStart:Ce,endingEnd:Ce},intervalChanged_:function(e,t,n){var i=this.parameterPositions,l=e-2,d=e+1,m=i[l],x=i[d];if(m===void 0)switch(this.getSettings_().endingStart){case ce:l=e,m=2*t-n;break;case Te:m=t+i[l=i.length-2]-i[l+1];break;default:l=e,m=n}if(x===void 0)switch(this.getSettings_().endingEnd){case ce:d=e,x=2*n-t;break;case Te:x=n+i[d=1]-i[0];break;default:d=e-1,x=t}var L=.5*(n-t),j=this.valueSize;this._weightPrev=L/(t-m),this._weightNext=L/(x-n),this._offsetPrev=l*j,this._offsetNext=d*j},interpolate_:function(e,t,n,i){for(var l=this.resultBuffer,d=this.sampleValues,m=this.valueSize,x=e*m,L=x-m,j=this._offsetPrev,Z=this._offsetNext,ee=this._weightPrev,ie=this._weightNext,z=(n-t)/(i-t),he=z*z,me=he*z,ye=-ee*me+2*ee*he-ee*z,Ae=(1+ee)*me+(-1.5-2*ee)*he+(-.5+ee)*z+1,Le=(-1-ie)*me+(1.5+ie)*he+.5*z,Ge=ie*me-ie*he,et=0;et!==m;++et)l[et]=ye*d[j+et]+Ae*d[L+et]+Le*d[x+et]+Ge*d[Z+et];return l}}),Jc.prototype=Object.assign(Object.create(za.prototype),{constructor:Jc,interpolate_:function(e,t,n,i){for(var l=this.resultBuffer,d=this.sampleValues,m=this.valueSize,x=e*m,L=x-m,j=(n-t)/(i-t),Z=1-j,ee=0;ee!==m;++ee)l[ee]=d[L+ee]*Z+d[x+ee]*j;return l}}),Yu.prototype=Object.assign(Object.create(za.prototype),{constructor:Yu,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(ga,{toJSON:function(e){var t,n=e.constructor;if(n.toJSON!==void 0)t=n.toJSON(e);else{t={name:e.name,times:Oi.convertArray(e.times,Array),values:Oi.convertArray(e.values,Array)};var i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}}),Object.assign(ga.prototype,{constructor:ga,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Q,InterpolantFactoryMethodDiscrete:function(e){return new Yu(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Jc(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Xu(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case jr:t=this.InterpolantFactoryMethodDiscrete;break;case Q:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(t!==void 0)return this.createInterpolant=t,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0){if(e===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 jr;case this.InterpolantFactoryMethodLinear:return Q;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(e!==0)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]+=e;return this},scale:function(e){if(e!==1)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,i=n.length,l=0,d=i-1;l!==i&&n[l]<e;)++l;for(;d!==-1&&n[d]>t;)--d;if(++d,l!==0||d!==i){d<=l&&(l=(d=Math.max(d,1))-1);var m=this.getValueSize();this.times=Oi.arraySlice(n,l,d),this.values=Oi.arraySlice(this.values,l*m,d*m)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,i=this.values,l=n.length;l===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var d=null,m=0;m!==l;m++){var x=n[m];if(typeof x=="number"&&isNaN(x)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,m,x),e=!1;break}if(d!==null&&x<d){console.error("THREE.KeyframeTrack: Out of order keys.",this,m,x,d),e=!1;break}d=x}if(i!==void 0&&Oi.isTypedArray(i)){m=0;for(var L=i.length;m!==L;++m){var j=i[m];if(isNaN(j)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,m,j),e=!1;break}}}return e},optimize:function(){for(var e=Oi.arraySlice(this.times),t=Oi.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===2302,l=1,d=e.length-1,m=1;m<d;++m){var x=!1,L=e[m];if(L!==e[m+1]&&(m!==1||L!==L[0]))if(i)x=!0;else for(var j=m*n,Z=j-n,ee=j+n,ie=0;ie!==n;++ie){var z=t[j+ie];if(z!==t[Z+ie]||z!==t[ee+ie]){x=!0;break}}if(x){if(m!==l){e[l]=e[m];var he=m*n,me=l*n;for(ie=0;ie!==n;++ie)t[me+ie]=t[he+ie]}++l}}if(0<d){for(e[l]=e[d],he=d*n,me=l*n,ie=0;ie!==n;++ie)t[me+ie]=t[he+ie];++l}return l!==e.length?(this.times=Oi.arraySlice(e,0,l),this.values=Oi.arraySlice(t,0,l*n)):(this.times=e,this.values=t),this},clone:function(){var e=Oi.arraySlice(this.times,0),t=Oi.arraySlice(this.values,0),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),Zu.prototype=Object.assign(Object.create(ga.prototype),{constructor:Zu,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:jr,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ku.prototype=Object.assign(Object.create(ga.prototype),{constructor:Ku,ValueTypeName:"color"}),Ns.prototype=Object.assign(Object.create(ga.prototype),{constructor:Ns,ValueTypeName:"number"}),ec.prototype=Object.assign(Object.create(za.prototype),{constructor:ec,interpolate_:function(e,t,n,i){for(var l=this.resultBuffer,d=this.sampleValues,m=this.valueSize,x=e*m,L=(n-t)/(i-t),j=x+m;x!==j;x+=4)Gi.slerpFlat(l,0,d,x-m,d,x,L);return l}}),gl.prototype=Object.assign(Object.create(ga.prototype),{constructor:gl,ValueTypeName:"quaternion",DefaultInterpolation:Q,InterpolantFactoryMethodLinear:function(e){return new ec(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),$u.prototype=Object.assign(Object.create(ga.prototype),{constructor:$u,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:jr,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),tc.prototype=Object.assign(Object.create(ga.prototype),{constructor:tc,ValueTypeName:"vector"}),Object.assign(To,{parse:function(e){for(var t=[],n=e.tracks,i=1/(e.fps||1),l=0,d=n.length;l!==d;++l)t.push(ep(n[l]).scale(i));return new To(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},l=0,d=n.length;l!==d;++l)t.push(ga.toJSON(n[l]));return i},CreateFromMorphTargetSequence:function(e,t,n,i){for(var l=t.length,d=[],m=0;m<l;m++){var x=[],L=[];x.push((m+l-1)%l,m,(m+1)%l),L.push(0,1,0);var j=Oi.getKeyframeOrder(x);x=Oi.sortedArray(x,1,j),L=Oi.sortedArray(L,1,j),i||x[0]!==0||(x.push(l),L.push(L[0])),d.push(new Ns(".morphTargetInfluences["+t[m].name+"]",x,L).scale(1/n))}return new To(e,-1,d)},findByName:function(e,t){var n=e;Array.isArray(e)||(n=e.geometry&&e.geometry.animations||e.animations);for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var i={},l=/^([\w-]*?)([\d]+)$/,d=0,m=e.length;d<m;d++){var x=e[d],L=x.name.match(l);if(L&&1<L.length){var j=i[ee=L[1]];j||(i[ee]=j=[]),j.push(x)}}var Z=[];for(var ee in i)Z.push(To.CreateFromMorphTargetSequence(ee,i[ee],t,n));return Z},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(Le,Ge,et,Fe,at){if(et.length!==0){var Je=[],xt=[];Oi.flattenJSON(et,Je,xt,Fe),Je.length!==0&&at.push(new Le(Ge,Je,xt))}},i=[],l=e.name||"default",d=e.length||-1,m=e.fps||30,x=e.hierarchy||[],L=0;L<x.length;L++){var j=x[L].keys;if(j&&j.length!==0)if(j[0].morphTargets){for(var Z={},ee=0;ee<j.length;ee++)if(j[ee].morphTargets)for(var ie=0;ie<j[ee].morphTargets.length;ie++)Z[j[ee].morphTargets[ie]]=-1;for(var z in Z){var he=[],me=[];for(ie=0;ie!==j[ee].morphTargets.length;++ie){var ye=j[ee];he.push(ye.time),me.push(ye.morphTarget===z?1:0)}i.push(new Ns(".morphTargetInfluence["+z+"]",he,me))}d=Z.length*(m||1)}else{var Ae=".bones["+t[L].name+"]";n(tc,Ae+".position",j,"pos",i),n(gl,Ae+".quaternion",j,"rot",i),n(tc,Ae+".scale",j,"scl",i)}}return i.length===0?null:new To(l,d,i)}}),Object.assign(To.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new To(this.name,this.duration,e)}});var yl={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function Fh(e,t,n){var i=this,l=!1,d=0,m=0,x=void 0,L=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(j){m++,l===!1&&i.onStart!==void 0&&i.onStart(j,d,m),l=!0},this.itemEnd=function(j){d++,i.onProgress!==void 0&&i.onProgress(j,d,m),d===m&&(l=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(j){i.onError!==void 0&&i.onError(j)},this.resolveURL=function(j){return x?x(j):j},this.setURLModifier=function(j){return x=j,this},this.addHandler=function(j,Z){return L.push(j,Z),this},this.removeHandler=function(j){var Z=L.indexOf(j);return Z!==-1&&L.splice(Z,2),this},this.getHandler=function(j){for(var Z=0,ee=L.length;Z<ee;Z+=2){var ie=L[Z],z=L[Z+1];if(ie.global&&(ie.lastIndex=0),ie.test(j))return z}return null}}var yd=new Fh;function s(e){this.manager=e!==void 0?e:yd,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(s.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this}});var p={};function P(e){s.call(this,e)}function ae(e){s.call(this,e)}function pe(e){s.call(this,e)}function Oe(e){s.call(this,e)}function Xe(e){s.call(this,e)}function it(e){s.call(this,e)}function wt(e){s.call(this,e)}function gt(){this.type="Curve",this.arcLengthDivisions=200}function Nt(e,t,n,i,l,d,m,x){gt.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=l||0,this.aEndAngle=d||2*Math.PI,this.aClockwise=m||!1,this.aRotation=x||0}function Kt(e,t,n,i,l,d){Nt.call(this,e,t,n,n,i,l,d),this.type="ArcCurve"}function Pn(){var e=0,t=0,n=0,i=0;function l(d,m,x,L){n=-3*(e=d)+3*m-2*(t=x)-L,i=2*d-2*m+x+L}return{initCatmullRom:function(d,m,x,L,j){l(m,x,j*(x-d),j*(L-m))},initNonuniformCatmullRom:function(d,m,x,L,j,Z,ee){var ie=(m-d)/j-(x-d)/(j+Z)+(x-m)/Z,z=(x-m)/Z-(L-m)/(Z+ee)+(L-x)/ee;l(m,x,ie*=Z,z*=Z)},calc:function(d){var m=d*d;return e+t*d+n*m+i*(m*d)}}}P.prototype=Object.assign(Object.create(s.prototype),{constructor:P,load:function(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var l=this,d=yl.get(e);if(d!==void 0)return l.manager.itemStart(e),setTimeout(function(){t&&t(d),l.manager.itemEnd(e)},0),d;if(p[e]===void 0){var m=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(m){var x=m[1],L=!!m[2],j=m[3];j=decodeURIComponent(j),L&&(j=atob(j));try{var Z,ee=(this.responseType||"").toLowerCase();switch(ee){case"arraybuffer":case"blob":for(var ie=new Uint8Array(j.length),z=0;z<j.length;z++)ie[z]=j.charCodeAt(z);Z=ee==="blob"?new Blob([ie.buffer],{type:x}):ie.buffer;break;case"document":var he=new DOMParser;Z=he.parseFromString(j,x);break;case"json":Z=JSON.parse(j);break;default:Z=j}setTimeout(function(){t&&t(Z),l.manager.itemEnd(e)},0)}catch(Ae){setTimeout(function(){i&&i(Ae),l.manager.itemError(e),l.manager.itemEnd(e)},0)}}else{p[e]=[],p[e].push({onLoad:t,onProgress:n,onError:i});var me=new XMLHttpRequest;for(var ye in me.open("GET",e,!0),me.addEventListener("load",function(Ae){var Le=this.response,Ge=p[e];if(delete p[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),yl.add(e,Le);for(var et=0,Fe=Ge.length;et<Fe;et++)(at=Ge[et]).onLoad&&at.onLoad(Le);l.manager.itemEnd(e)}else{for(et=0,Fe=Ge.length;et<Fe;et++){var at;(at=Ge[et]).onError&&at.onError(Ae)}l.manager.itemError(e),l.manager.itemEnd(e)}},!1),me.addEventListener("progress",function(Ae){for(var Le=p[e],Ge=0,et=Le.length;Ge<et;Ge++){var Fe=Le[Ge];Fe.onProgress&&Fe.onProgress(Ae)}},!1),me.addEventListener("error",function(Ae){var Le=p[e];delete p[e];for(var Ge=0,et=Le.length;Ge<et;Ge++){var Fe=Le[Ge];Fe.onError&&Fe.onError(Ae)}l.manager.itemError(e),l.manager.itemEnd(e)},!1),me.addEventListener("abort",function(Ae){var Le=p[e];delete p[e];for(var Ge=0,et=Le.length;Ge<et;Ge++){var Fe=Le[Ge];Fe.onError&&Fe.onError(Ae)}l.manager.itemError(e),l.manager.itemEnd(e)},!1),this.responseType!==void 0&&(me.responseType=this.responseType),this.withCredentials!==void 0&&(me.withCredentials=this.withCredentials),me.overrideMimeType&&me.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain"),this.requestHeader)me.setRequestHeader(ye,this.requestHeader[ye]);me.send(null)}return l.manager.itemStart(e),me}p[e].push({onLoad:t,onProgress:n,onError:i})},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),ae.prototype=Object.assign(Object.create(s.prototype),{constructor:ae,load:function(e,t,n,i){var l=this,d=new P(l.manager);d.setPath(l.path),d.load(e,function(m){t(l.parse(JSON.parse(m)))},n,i)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var i=To.parse(e[n]);t.push(i)}return t}}),pe.prototype=Object.assign(Object.create(s.prototype),{constructor:pe,load:function(e,t,n,i){var l=this,d=[],m=new Vu;m.image=d;var x=new P(this.manager);function L(ie){x.load(e[ie],function(z){var he=l.parse(z,!0);d[ie]={width:he.width,height:he.height,format:he.format,mipmaps:he.mipmaps},(j+=1)===6&&(he.mipmapCount===1&&(m.minFilter=xn),m.format=he.format,m.needsUpdate=!0,t&&t(m))},n,i)}if(x.setPath(this.path),x.setResponseType("arraybuffer"),Array.isArray(e))for(var j=0,Z=0,ee=e.length;Z<ee;++Z)L(Z);else x.load(e,function(ie){var z=l.parse(ie,!0);if(z.isCubemap)for(var he=z.mipmaps.length/z.mipmapCount,me=0;me<he;me++){d[me]={mipmaps:[]};for(var ye=0;ye<z.mipmapCount;ye++)d[me].mipmaps.push(z.mipmaps[me*z.mipmapCount+ye]),d[me].format=z.format,d[me].width=z.width,d[me].height=z.height}else m.image.width=z.width,m.image.height=z.height,m.mipmaps=z.mipmaps;z.mipmapCount===1&&(m.minFilter=xn),m.format=z.format,m.needsUpdate=!0,t&&t(m)},n,i);return m}}),Oe.prototype=Object.assign(Object.create(s.prototype),{constructor:Oe,load:function(e,t,n,i){var l=this,d=new Rl,m=new P(this.manager);return m.setResponseType("arraybuffer"),m.setPath(this.path),m.load(e,function(x){var L=l.parse(x);L&&(L.image!==void 0?d.image=L.image:L.data!==void 0&&(d.image.width=L.width,d.image.height=L.height,d.image.data=L.data),d.wrapS=L.wrapS!==void 0?L.wrapS:On,d.wrapT=L.wrapT!==void 0?L.wrapT:On,d.magFilter=L.magFilter!==void 0?L.magFilter:xn,d.minFilter=L.minFilter!==void 0?L.minFilter:xn,d.anisotropy=L.anisotropy!==void 0?L.anisotropy:1,L.format!==void 0&&(d.format=L.format),L.type!==void 0&&(d.type=L.type),L.mipmaps!==void 0&&(d.mipmaps=L.mipmaps,d.minFilter=Yn),L.mipmapCount===1&&(d.minFilter=xn),d.needsUpdate=!0,t&&t(d,L))},n,i),d}}),Xe.prototype=Object.assign(Object.create(s.prototype),{constructor:Xe,load:function(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var l=this,d=yl.get(e);if(d!==void 0)return l.manager.itemStart(e),setTimeout(function(){t&&t(d),l.manager.itemEnd(e)},0),d;var m=document.createElementNS("http://www.w3.org/1999/xhtml","img");function x(){m.removeEventListener("load",x,!1),m.removeEventListener("error",L,!1),yl.add(e,this),t&&t(this),l.manager.itemEnd(e)}function L(j){m.removeEventListener("load",x,!1),m.removeEventListener("error",L,!1),i&&i(j),l.manager.itemError(e),l.manager.itemEnd(e)}return m.addEventListener("load",x,!1),m.addEventListener("error",L,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(m.crossOrigin=this.crossOrigin),l.manager.itemStart(e),m.src=e,m}}),it.prototype=Object.assign(Object.create(s.prototype),{constructor:it,load:function(e,t,n,i){var l=new Ds,d=new Xe(this.manager);d.setCrossOrigin(this.crossOrigin),d.setPath(this.path);var m=0;function x(j){d.load(e[j],function(Z){l.images[j]=Z,++m==6&&(l.needsUpdate=!0,t&&t(l))},void 0,i)}for(var L=0;L<e.length;++L)x(L);return l}}),wt.prototype=Object.assign(Object.create(s.prototype),{constructor:wt,load:function(e,t,n,i){var l=new Xr,d=new Xe(this.manager);return d.setCrossOrigin(this.crossOrigin),d.setPath(this.path),d.load(e,function(m){l.image=m;var x=0<e.search(/\.jpe?g($|\?)/i)||e.search(/^data\:image\/jpeg/)===0;l.format=x?ti:Gr,l.needsUpdate=!0,t!==void 0&&t(l)},n,i),l}}),Object.assign(gt.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){e===void 0&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){e===void 0&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(e===void 0&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,i=[],l=this.getPoint(0),d=0;for(i.push(0),n=1;n<=e;n++)d+=(t=this.getPoint(n/e)).distanceTo(l),i.push(d),l=t;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,i=this.getLengths(),l=0,d=i.length;n=t||e*i[d-1];for(var m,x=0,L=d-1;x<=L;)if((m=i[l=Math.floor(x+(L-x)/2)]-n)<0)x=l+1;else{if(!(0<m)){L=l;break}L=l-1}if(i[l=L]===n)return l/(d-1);var j=i[l];return(l+(n-j)/(i[l+1]-j))/(d-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),1<n&&(n=1);var i=this.getPoint(t);return this.getPoint(n).clone().sub(i).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,i,l,d=new Re,m=[],x=[],L=[],j=new Re,Z=new fr;for(n=0;n<=e;n++)i=n/e,m[n]=this.getTangentAt(i),m[n].normalize();x[0]=new Re,L[0]=new Re;var ee=Number.MAX_VALUE,ie=Math.abs(m[0].x),z=Math.abs(m[0].y),he=Math.abs(m[0].z);for(ie<=ee&&(ee=ie,d.set(1,0,0)),z<=ee&&(ee=z,d.set(0,1,0)),he<=ee&&d.set(0,0,1),j.crossVectors(m[0],d).normalize(),x[0].crossVectors(m[0],j),L[0].crossVectors(m[0],x[0]),n=1;n<=e;n++)x[n]=x[n-1].clone(),L[n]=L[n-1].clone(),j.crossVectors(m[n-1],m[n]),j.length()>Number.EPSILON&&(j.normalize(),l=Math.acos(yr.clamp(m[n-1].dot(m[n]),-1,1)),x[n].applyMatrix4(Z.makeRotationAxis(j,l))),L[n].crossVectors(m[n],x[n]);if(t===!0)for(l=Math.acos(yr.clamp(x[0].dot(x[e]),-1,1)),l/=e,0<m[0].dot(j.crossVectors(x[0],x[e]))&&(l=-l),n=1;n<=e;n++)x[n].applyMatrix4(Z.makeRotationAxis(m[n],l*n)),L[n].crossVectors(m[n],x[n]);return{tangents:m,normals:x,binormals:L}},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),((Nt.prototype=Object.create(gt.prototype)).constructor=Nt).prototype.isEllipseCurve=!0,Nt.prototype.getPoint=function(e,t){for(var n=t||new zt,i=2*Math.PI,l=this.aEndAngle-this.aStartAngle,d=Math.abs(l)<Number.EPSILON;l<0;)l+=i;for(;i<l;)l-=i;l<Number.EPSILON&&(l=d?0:i),this.aClockwise!==!0||d||(l===i?l=-i:l-=i);var m=this.aStartAngle+e*l,x=this.aX+this.xRadius*Math.cos(m),L=this.aY+this.yRadius*Math.sin(m);if(this.aRotation!==0){var j=Math.cos(this.aRotation),Z=Math.sin(this.aRotation),ee=x-this.aX,ie=L-this.aY;x=ee*j-ie*Z+this.aX,L=ee*Z+ie*j+this.aY}return n.set(x,L)},Nt.prototype.copy=function(e){return gt.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},Nt.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},Nt.prototype.fromJSON=function(e){return gt.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},((Kt.prototype=Object.create(Nt.prototype)).constructor=Kt).prototype.isArcCurve=!0;var jn=new Re,Qn=new Pn,Ut=new Pn,on=new Pn;function Nn(e,t,n,i){gt.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}function vn(e,t,n,i,l){var d=.5*(i-t),m=.5*(l-n),x=e*e;return(2*n-2*i+d+m)*(e*x)+(-3*n+3*i-2*d-m)*x+d*e+n}function pr(e,t,n,i){return(m=1-e)*m*t+2*(1-(d=e))*d*n+(l=e)*l*i;var l,d,m}function cr(e,t,n,i,l){return(j=1-e)*j*j*t+3*(L=1-(x=e))*L*x*n+3*(1-(m=e))*m*m*i+(d=e)*d*d*l;var d,m,x,L,j}function Ar(e,t,n,i){gt.call(this),this.type="CubicBezierCurve",this.v0=e||new zt,this.v1=t||new zt,this.v2=n||new zt,this.v3=i||new zt}function Vn(e,t,n,i){gt.call(this),this.type="CubicBezierCurve3",this.v0=e||new Re,this.v1=t||new Re,this.v2=n||new Re,this.v3=i||new Re}function zn(e,t){gt.call(this),this.type="LineCurve",this.v1=e||new zt,this.v2=t||new zt}function ui(e,t){gt.call(this),this.type="LineCurve3",this.v1=e||new Re,this.v2=t||new Re}function ii(e,t,n){gt.call(this),this.type="QuadraticBezierCurve",this.v0=e||new zt,this.v1=t||new zt,this.v2=n||new zt}function Fi(e,t,n){gt.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new Re,this.v1=t||new Re,this.v2=n||new Re}function Hr(e){gt.call(this),this.type="SplineCurve",this.points=e||[]}((Nn.prototype=Object.create(gt.prototype)).constructor=Nn).prototype.isCatmullRomCurve3=!0,Nn.prototype.getPoint=function(e,t){var n,i,l,d,m=t||new Re,x=this.points,L=x.length,j=(L-(this.closed?0:1))*e,Z=Math.floor(j),ee=j-Z;if(this.closed?Z+=0<Z?0:(Math.floor(Math.abs(Z)/L)+1)*L:ee===0&&Z===L-1&&(Z=L-2,ee=1),n=this.closed||0<Z?x[(Z-1)%L]:(jn.subVectors(x[0],x[1]).add(x[0]),jn),i=x[Z%L],l=x[(Z+1)%L],d=this.closed||Z+2<L?x[(Z+2)%L]:(jn.subVectors(x[L-1],x[L-2]).add(x[L-1]),jn),this.curveType==="centripetal"||this.curveType==="chordal"){var ie=this.curveType==="chordal"?.5:.25,z=Math.pow(n.distanceToSquared(i),ie),he=Math.pow(i.distanceToSquared(l),ie),me=Math.pow(l.distanceToSquared(d),ie);he<1e-4&&(he=1),z<1e-4&&(z=he),me<1e-4&&(me=he),Qn.initNonuniformCatmullRom(n.x,i.x,l.x,d.x,z,he,me),Ut.initNonuniformCatmullRom(n.y,i.y,l.y,d.y,z,he,me),on.initNonuniformCatmullRom(n.z,i.z,l.z,d.z,z,he,me)}else this.curveType==="catmullrom"&&(Qn.initCatmullRom(n.x,i.x,l.x,d.x,this.tension),Ut.initCatmullRom(n.y,i.y,l.y,d.y,this.tension),on.initCatmullRom(n.z,i.z,l.z,d.z,this.tension));return m.set(Qn.calc(ee),Ut.calc(ee),on.calc(ee)),m},Nn.prototype.copy=function(e){gt.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Nn.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Nn.prototype.fromJSON=function(e){gt.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(new Re().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},((Ar.prototype=Object.create(gt.prototype)).constructor=Ar).prototype.isCubicBezierCurve=!0,Ar.prototype.getPoint=function(e,t){var n=t||new zt,i=this.v0,l=this.v1,d=this.v2,m=this.v3;return n.set(cr(e,i.x,l.x,d.x,m.x),cr(e,i.y,l.y,d.y,m.y)),n},Ar.prototype.copy=function(e){return gt.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Ar.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Ar.prototype.fromJSON=function(e){return gt.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},((Vn.prototype=Object.create(gt.prototype)).constructor=Vn).prototype.isCubicBezierCurve3=!0,Vn.prototype.getPoint=function(e,t){var n=t||new Re,i=this.v0,l=this.v1,d=this.v2,m=this.v3;return n.set(cr(e,i.x,l.x,d.x,m.x),cr(e,i.y,l.y,d.y,m.y),cr(e,i.z,l.z,d.z,m.z)),n},Vn.prototype.copy=function(e){return gt.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Vn.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Vn.prototype.fromJSON=function(e){return gt.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},((zn.prototype=Object.create(gt.prototype)).constructor=zn).prototype.isLineCurve=!0,zn.prototype.getPoint=function(e,t){var n=t||new zt;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},zn.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},zn.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},zn.prototype.copy=function(e){return gt.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},zn.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},zn.prototype.fromJSON=function(e){return gt.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},((ui.prototype=Object.create(gt.prototype)).constructor=ui).prototype.isLineCurve3=!0,ui.prototype.getPoint=function(e,t){var n=t||new Re;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},ui.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},ui.prototype.copy=function(e){return gt.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},ui.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},ui.prototype.fromJSON=function(e){return gt.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},((ii.prototype=Object.create(gt.prototype)).constructor=ii).prototype.isQuadraticBezierCurve=!0,ii.prototype.getPoint=function(e,t){var n=t||new zt,i=this.v0,l=this.v1,d=this.v2;return n.set(pr(e,i.x,l.x,d.x),pr(e,i.y,l.y,d.y)),n},ii.prototype.copy=function(e){return gt.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},ii.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},ii.prototype.fromJSON=function(e){return gt.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},((Fi.prototype=Object.create(gt.prototype)).constructor=Fi).prototype.isQuadraticBezierCurve3=!0,Fi.prototype.getPoint=function(e,t){var n=t||new Re,i=this.v0,l=this.v1,d=this.v2;return n.set(pr(e,i.x,l.x,d.x),pr(e,i.y,l.y,d.y),pr(e,i.z,l.z,d.z)),n},Fi.prototype.copy=function(e){return gt.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Fi.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Fi.prototype.fromJSON=function(e){return gt.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},((Hr.prototype=Object.create(gt.prototype)).constructor=Hr).prototype.isSplineCurve=!0,Hr.prototype.getPoint=function(e,t){var n=t||new zt,i=this.points,l=(i.length-1)*e,d=Math.floor(l),m=l-d,x=i[d===0?d:d-1],L=i[d],j=i[d>i.length-2?i.length-1:d+1],Z=i[d>i.length-3?i.length-1:d+2];return n.set(vn(m,x.x,L.x,j.x,Z.x),vn(m,x.y,L.y,j.y,Z.y)),n},Hr.prototype.copy=function(e){gt.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this},Hr.prototype.toJSON=function(){var e=gt.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e},Hr.prototype.fromJSON=function(e){gt.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(new zt().fromArray(i))}return this};var ya=Object.freeze({__proto__:null,ArcCurve:Kt,CatmullRomCurve3:Nn,CubicBezierCurve:Ar,CubicBezierCurve3:Vn,EllipseCurve:Nt,LineCurve:zn,LineCurve3:ui,QuadraticBezierCurve:ii,QuadraticBezierCurve3:Fi,SplineCurve:Hr});function va(){gt.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function xa(e){va.call(this),this.type="Path",this.currentPoint=new zt,e&&this.setFromPoints(e)}function Qa(e){xa.call(this,e),this.uuid=yr.generateUUID(),this.type="Shape",this.holes=[]}function Ur(e,t){Pt.call(this),this.type="Light",this.color=new Qe(e),this.intensity=t!==void 0?t:1,this.receiveShadow=void 0}function qc(e,t,n){Ur.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Pt.DefaultUp),this.updateMatrix(),this.groundColor=new Qe(t)}function jo(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new zt(512,512),this.map=null,this.mapPass=null,this.matrix=new fr,this._frustum=new Qs,this._frameExtents=new zt(1,1),this._viewportCount=1,this._viewports=[new Jr(0,0,1,1)]}function vl(){jo.call(this,new Ni(50,1,.5,500))}function nc(e,t,n,i,l,d){Ur.call(this,e,t),this.type="SpotLight",this.position.copy(Pt.DefaultUp),this.updateMatrix(),this.target=new Pt,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(m){this.intensity=m/Math.PI}}),this.distance=n!==void 0?n:0,this.angle=i!==void 0?i:Math.PI/3,this.penumbra=l!==void 0?l:0,this.decay=d!==void 0?d:1,this.shadow=new vl}function rc(){jo.call(this,new Ni(90,1,.5,500)),this._frameExtents=new zt(4,2),this._viewportCount=6,this._viewports=[new Jr(2,1,1,1),new Jr(0,1,1,1),new Jr(3,1,1,1),new Jr(1,1,1,1),new Jr(3,0,1,1),new Jr(1,0,1,1)],this._cubeDirections=[new Re(1,0,0),new Re(-1,0,0),new Re(0,0,1),new Re(0,0,-1),new Re(0,1,0),new Re(0,-1,0)],this._cubeUps=[new Re(0,1,0),new Re(0,1,0),new Re(0,1,0),new Re(0,1,0),new Re(0,0,1),new Re(0,0,-1)]}function xl(e,t,n,i){Ur.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(l){this.intensity=l/(4*Math.PI)}}),this.distance=n!==void 0?n:0,this.decay=i!==void 0?i:1,this.shadow=new rc}function wl(e,t,n,i,l,d){Lo.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e!==void 0?e:-1,this.right=t!==void 0?t:1,this.top=n!==void 0?n:1,this.bottom=i!==void 0?i:-1,this.near=l!==void 0?l:.1,this.far=d!==void 0?d:2e3,this.updateProjectionMatrix()}function bl(){jo.call(this,new wl(-5,5,5,-5,.5,500))}function Ml(e,t){Ur.call(this,e,t),this.type="DirectionalLight",this.position.copy(Pt.DefaultUp),this.updateMatrix(),this.target=new Pt,this.shadow=new bl}function vd(e,t){Ur.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function xd(e,t,n,i){Ur.call(this,e,t),this.type="RectAreaLight",this.width=n!==void 0?n:10,this.height=i!==void 0?i:10}function wd(e){s.call(this,e),this.textures={}}va.prototype=Object.assign(Object.create(gt.prototype),{constructor:va,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new zn(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=t){var l=n[i]-t,d=this.curves[i],m=d.getLength(),x=m===0?0:1-l/m;return d.getPointAt(x)}i++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.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 e=[],t=0,n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e},getSpacedPoints:function(e){e===void 0&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],i=0,l=this.curves;i<l.length;i++)for(var d=l[i],m=d&&d.isEllipseCurve?2*e:d&&(d.isLineCurve||d.isLineCurve3)?1:d&&d.isSplineCurve?e*d.points.length:e,x=d.getPoints(m),L=0;L<x.length;L++){var j=x[L];t&&t.equals(j)||(n.push(j),t=j)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){gt.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=gt.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var i=this.curves[t];e.curves.push(i.toJSON())}return e},fromJSON:function(e){gt.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push(new ya[i.type]().fromJSON(i))}return this}}),xa.prototype=Object.assign(Object.create(va.prototype),{constructor:xa,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var n=new zn(this.currentPoint.clone(),new zt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,i){var l=new ii(this.currentPoint.clone(),new zt(e,t),new zt(n,i));return this.curves.push(l),this.currentPoint.set(n,i),this},bezierCurveTo:function(e,t,n,i,l,d){var m=new Ar(this.currentPoint.clone(),new zt(e,t),new zt(n,i),new zt(l,d));return this.curves.push(m),this.currentPoint.set(l,d),this},splineThru:function(e){var t=new Hr([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,i,l,d){var m=this.currentPoint.x,x=this.currentPoint.y;return this.absarc(e+m,t+x,n,i,l,d),this},absarc:function(e,t,n,i,l,d){return this.absellipse(e,t,n,n,i,l,d),this},ellipse:function(e,t,n,i,l,d,m,x){var L=this.currentPoint.x,j=this.currentPoint.y;return this.absellipse(e+L,t+j,n,i,l,d,m,x),this},absellipse:function(e,t,n,i,l,d,m,x){var L=new Nt(e,t,n,i,l,d,m,x);if(0<this.curves.length){var j=L.getPoint(0);j.equals(this.currentPoint)||this.lineTo(j.x,j.y)}this.curves.push(L);var Z=L.getPoint(1);return this.currentPoint.copy(Z),this},copy:function(e){return va.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=va.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return va.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Qa.prototype=Object.assign(Object.create(xa.prototype),{constructor:Qa,getPointsHoles:function(e){for(var t=[],n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){xa.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push(i.clone())}return this},toJSON:function(){var e=xa.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var i=this.holes[t];e.holes.push(i.toJSON())}return e},fromJSON:function(e){xa.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push(new xa().fromJSON(i))}return this}}),Ur.prototype=Object.assign(Object.create(Pt.prototype),{constructor:Ur,isLight:!0,copy:function(e){return Pt.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=Pt.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}),qc.prototype=Object.assign(Object.create(Ur.prototype),{constructor:qc,isHemisphereLight:!0,copy:function(e){return Ur.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(jo.prototype,{_projScreenMatrix:new fr,_lightPositionWorld:new Re,_lookTarget:new Re,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,i=this._projScreenMatrix,l=this._lookTarget,d=this._lightPositionWorld;d.setFromMatrixPosition(e.matrixWorld),t.position.copy(d),l.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(l),t.updateMatrixWorld(),i.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(i),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return new this.constructor().copy(this)},toJSON:function(){var e={};return this.bias!==0&&(e.bias=this.bias),this.radius!==1&&(e.radius=this.radius),this.mapSize.x===512&&this.mapSize.y===512||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),vl.prototype=Object.assign(Object.create(jo.prototype),{constructor:vl,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*yr.RAD2DEG*e.angle,i=this.mapSize.width/this.mapSize.height,l=e.distance||t.far;n===t.fov&&i===t.aspect&&l===t.far||(t.fov=n,t.aspect=i,t.far=l,t.updateProjectionMatrix()),jo.prototype.updateMatrices.call(this,e)}}),nc.prototype=Object.assign(Object.create(Ur.prototype),{constructor:nc,isSpotLight:!0,copy:function(e){return Ur.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),rc.prototype=Object.assign(Object.create(jo.prototype),{constructor:rc,isPointLightShadow:!0,updateMatrices:function(e,t){t===void 0&&(t=0);var n=this.camera,i=this.matrix,l=this._lightPositionWorld,d=this._lookTarget,m=this._projScreenMatrix;l.setFromMatrixPosition(e.matrixWorld),n.position.copy(l),d.copy(n.position),d.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(d),n.updateMatrixWorld(),i.makeTranslation(-l.x,-l.y,-l.z),m.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(m)}}),xl.prototype=Object.assign(Object.create(Ur.prototype),{constructor:xl,isPointLight:!0,copy:function(e){return Ur.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),wl.prototype=Object.assign(Object.create(Lo.prototype),{constructor:wl,isOrthographicCamera:!0,copy:function(e,t){return Lo.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,i,l,d){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=l,this.view.height=d,this.updateProjectionMatrix()},clearViewOffset:function(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,l=n-e,d=n+e,m=i+t,x=i-t;if(this.view!==null&&this.view.enabled){var L=(this.right-this.left)/this.view.fullWidth/this.zoom,j=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(l+=L*this.view.offsetX)+L*this.view.width,x=(m-=j*this.view.offsetY)-j*this.view.height}this.projectionMatrix.makeOrthographic(l,d,m,x,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Pt.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}),bl.prototype=Object.assign(Object.create(jo.prototype),{constructor:bl,isDirectionalLightShadow:!0,updateMatrices:function(e){jo.prototype.updateMatrices.call(this,e)}}),Ml.prototype=Object.assign(Object.create(Ur.prototype),{constructor:Ml,isDirectionalLight:!0,copy:function(e){return Ur.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),vd.prototype=Object.assign(Object.create(Ur.prototype),{constructor:vd,isAmbientLight:!0}),xd.prototype=Object.assign(Object.create(Ur.prototype),{constructor:xd,isRectAreaLight:!0,copy:function(e){return Ur.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Ur.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),wd.prototype=Object.assign(Object.create(s.prototype),{constructor:wd,load:function(e,t,n,i){var l=this,d=new P(l.manager);d.setPath(l.path),d.load(e,function(m){t(l.parse(JSON.parse(m)))},n,i)},parse:function(e){var t=this.textures;function n(L){return t[L]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",L),t[L]}var i=new Qd[e.type];if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=new Qe().setHex(e.sheen)),e.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular.setHex(e.specular),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.vertexColors!==void 0&&(i.vertexColors=e.vertexColors),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==1&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.skinning!==void 0&&(i.skinning=e.skinning),e.morphTargets!==void 0&&(i.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(i.morphNormals=e.morphNormals),e.dithering!==void 0&&(i.dithering=e.dithering),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.uniforms!==void 0)for(var l in e.uniforms){var d=e.uniforms[l];switch(i.uniforms[l]={},d.type){case"t":i.uniforms[l].value=n(d.value);break;case"c":i.uniforms[l].value=new Qe().setHex(d.value);break;case"v2":i.uniforms[l].value=new zt().fromArray(d.value);break;case"v3":i.uniforms[l].value=new Re().fromArray(d.value);break;case"v4":i.uniforms[l].value=new Jr().fromArray(d.value);break;case"m3":i.uniforms[l].value=new Ai().fromArray(d.value);case"m4":i.uniforms[l].value=new fr().fromArray(d.value);break;default:i.uniforms[l].value=d.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(var m in e.extensions)i.extensions[m]=e.extensions[m];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap),i.transparent=!0),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){var x=e.normalScale;Array.isArray(x)===!1&&(x=[x,x]),i.normalScale=new zt().fromArray(x)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new zt().fromArray(e.clearcoatNormalScale)),i},setTextures:function(e){return this.textures=e,this}});var tp={decodeText:function(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(l){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}};function bd(){Cn.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Md(e,t,n,i){typeof n=="number"&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Qt.call(this,e,t,n),this.meshPerAttribute=i||1}function _d(e){s.call(this,e)}bd.prototype=Object.assign(Object.create(Cn.prototype),{constructor:bd,isInstancedBufferGeometry:!0,copy:function(e){return Cn.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return new this.constructor().copy(this)},toJSON:function(){var e=Cn.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=!0,e}}),Md.prototype=Object.assign(Object.create(Qt.prototype),{constructor:Md,isInstancedBufferAttribute:!0,copy:function(e){return Qt.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=Qt.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),_d.prototype=Object.assign(Object.create(s.prototype),{constructor:_d,load:function(e,t,n,i){var l=this,d=new P(l.manager);d.setPath(l.path),d.load(e,function(m){t(l.parse(JSON.parse(m)))},n,i)},parse:function(e){var t=new(e.isInstancedBufferGeometry?bd:Cn),n=e.data.index;if(n!==void 0){var i=new np[n.type](n.array);t.setIndex(new Qt(i,1))}var l=e.data.attributes;for(var d in l){var m=l[d],x=(i=new np[m.type](m.array),new(m.isInstancedBufferAttribute?Md:Qt)(i,m.itemSize,m.normalized));m.name!==void 0&&(x.name=m.name),t.setAttribute(d,x)}var L=e.data.morphAttributes;if(L)for(var d in L){for(var j=L[d],Z=[],ee=0,ie=j.length;ee<ie;ee++)m=j[ee],x=new Qt(i=new np[m.type](m.array),m.itemSize,m.normalized),m.name!==void 0&&(x.name=m.name),Z.push(x);t.morphAttributes[d]=Z}e.data.morphTargetsRelative&&(t.morphTargetsRelative=!0);var z=e.data.groups||e.data.drawcalls||e.data.offsets;if(z!==void 0){ee=0;for(var he=z.length;ee!==he;++ee){var me=z[ee];t.addGroup(me.start,me.count,me.materialIndex)}}var ye=e.data.boundingSphere;if(ye!==void 0){var Ae=new Re;ye.center!==void 0&&Ae.fromArray(ye.center),t.boundingSphere=new Zr(Ae,ye.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var np={Int8Array,Uint8Array,Uint8ClampedArray:typeof Uint8ClampedArray!="undefined"?Uint8ClampedArray:Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Td(e){s.call(this,e)}Td.prototype=Object.assign(Object.create(s.prototype),{constructor:Td,load:function(e,t,n,i){var l=this,d=this.path===""?tp.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||d;var m=new P(l.manager);m.setPath(this.path),m.load(e,function(x){var L=null;try{L=JSON.parse(x)}catch(Z){return i!==void 0&&i(Z),void console.error("THREE:ObjectLoader: Can't parse "+e+".",Z.message)}var j=L.metadata;j!==void 0&&j.type!==void 0&&j.type.toLowerCase()!=="geometry"?l.parse(L,t):console.error("THREE.ObjectLoader: Can't load "+e)},n,i)},parse:function(e,t){var n=this.parseShape(e.shapes),i=this.parseGeometries(e.geometries,n),l=this.parseImages(e.images,function(){t!==void 0&&t(x)}),d=this.parseTextures(e.textures,l),m=this.parseMaterials(e.materials,d),x=this.parseObject(e.object,i,m);return e.animations&&(x.animations=this.parseAnimations(e.animations)),e.images!==void 0&&e.images.length!==0||t!==void 0&&t(x),x},parseShape:function(e){var t={};if(e!==void 0)for(var n=0,i=e.length;n<i;n++){var l=new Qa().fromJSON(e[n]);t[l.uuid]=l}return t},parseGeometries:function(e,t){var n={};if(e!==void 0)for(var i=new _d,l=0,d=e.length;l<d;l++){var m,x=e[l];switch(x.type){case"PlaneGeometry":case"PlaneBufferGeometry":m=new Ga[x.type](x.width,x.height,x.widthSegments,x.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":m=new Ga[x.type](x.width,x.height,x.depth,x.widthSegments,x.heightSegments,x.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":m=new Ga[x.type](x.radius,x.segments,x.thetaStart,x.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":m=new Ga[x.type](x.radiusTop,x.radiusBottom,x.height,x.radialSegments,x.heightSegments,x.openEnded,x.thetaStart,x.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":m=new Ga[x.type](x.radius,x.height,x.radialSegments,x.heightSegments,x.openEnded,x.thetaStart,x.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":m=new Ga[x.type](x.radius,x.widthSegments,x.heightSegments,x.phiStart,x.phiLength,x.thetaStart,x.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":m=new Ga[x.type](x.radius,x.detail);break;case"RingGeometry":case"RingBufferGeometry":m=new Ga[x.type](x.innerRadius,x.outerRadius,x.thetaSegments,x.phiSegments,x.thetaStart,x.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":m=new Ga[x.type](x.radius,x.tube,x.radialSegments,x.tubularSegments,x.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":m=new Ga[x.type](x.radius,x.tube,x.tubularSegments,x.radialSegments,x.p,x.q);break;case"TubeGeometry":case"TubeBufferGeometry":m=new Ga[x.type](new ya[x.path.type]().fromJSON(x.path),x.tubularSegments,x.radius,x.radialSegments,x.closed);break;case"LatheGeometry":case"LatheBufferGeometry":m=new Ga[x.type](x.points,x.segments,x.phiStart,x.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":m=new Ga[x.type](x.vertices,x.indices,x.radius,x.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var L=[],j=0,Z=x.shapes.length;j<Z;j++){var ee=t[x.shapes[j]];L.push(ee)}m=new Ga[x.type](L,x.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(L=[],j=0,Z=x.shapes.length;j<Z;j++)ee=t[x.shapes[j]],L.push(ee);var ie=x.options.extrudePath;ie!==void 0&&(x.options.extrudePath=new ya[ie.type]().fromJSON(ie)),m=new Ga[x.type](L,x.options);break;case"BufferGeometry":case"InstancedBufferGeometry":m=i.parse(x);break;case"Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?m=new THREE.LegacyJSONLoader().parse(x,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 "'+x.type+'"');continue}m.uuid=x.uuid,x.name!==void 0&&(m.name=x.name),m.isBufferGeometry===!0&&x.userData!==void 0&&(m.userData=x.userData),n[x.uuid]=m}return n},parseMaterials:function(e,t){var n={},i={};if(e!==void 0){var l=new wd;l.setTextures(t);for(var d=0,m=e.length;d<m;d++){var x=e[d];if(x.type==="MultiMaterial"){for(var L=[],j=0;j<x.materials.length;j++){var Z=x.materials[j];n[Z.uuid]===void 0&&(n[Z.uuid]=l.parse(Z)),L.push(n[Z.uuid])}i[x.uuid]=L}else n[x.uuid]===void 0&&(n[x.uuid]=l.parse(x)),i[x.uuid]=n[x.uuid]}}return i},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],l=To.parse(i);i.uuid!==void 0&&(l.uuid=i.uuid),t.push(l)}return t},parseImages:function(e,t){var n=this,i={};function l(he){return n.manager.itemStart(he),d.load(he,function(){n.manager.itemEnd(he)},void 0,function(){n.manager.itemError(he),n.manager.itemEnd(he)})}if(e!==void 0&&0<e.length){var d=new Xe(new Fh(t));d.setCrossOrigin(this.crossOrigin);for(var m=0,x=e.length;m<x;m++){var L=e[m],j=L.url;if(Array.isArray(j)){i[L.uuid]=[];for(var Z=0,ee=j.length;Z<ee;Z++){var ie=j[Z],z=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(ie)?ie:n.resourcePath+ie;i[L.uuid].push(l(z))}}else z=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(L.url)?L.url:n.resourcePath+L.url,i[L.uuid]=l(z)}}return i},parseTextures:function(e,t){function n(L,j){return typeof L=="number"?L:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",L),j[L])}var i={};if(e!==void 0)for(var l=0,d=e.length;l<d;l++){var m,x=e[l];x.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',x.uuid),t[x.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",x.image),(m=new(Array.isArray(t[x.image])?Ds:Xr)(t[x.image])).needsUpdate=!0,m.uuid=x.uuid,x.name!==void 0&&(m.name=x.name),x.mapping!==void 0&&(m.mapping=n(x.mapping,Cf)),x.offset!==void 0&&m.offset.fromArray(x.offset),x.repeat!==void 0&&m.repeat.fromArray(x.repeat),x.center!==void 0&&m.center.fromArray(x.center),x.rotation!==void 0&&(m.rotation=x.rotation),x.wrap!==void 0&&(m.wrapS=n(x.wrap[0],Np),m.wrapT=n(x.wrap[1],Np)),x.format!==void 0&&(m.format=x.format),x.type!==void 0&&(m.type=x.type),x.encoding!==void 0&&(m.encoding=x.encoding),x.minFilter!==void 0&&(m.minFilter=n(x.minFilter,Vp)),x.magFilter!==void 0&&(m.magFilter=n(x.magFilter,Vp)),x.anisotropy!==void 0&&(m.anisotropy=x.anisotropy),x.flipY!==void 0&&(m.flipY=x.flipY),x.premultiplyAlpha!==void 0&&(m.premultiplyAlpha=x.premultiplyAlpha),x.unpackAlignment!==void 0&&(m.unpackAlignment=x.unpackAlignment),i[x.uuid]=m}return i},parseObject:function(e,t,n){var i;function l(ye){return t[ye]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",ye),t[ye]}function d(ye){if(ye!==void 0){if(Array.isArray(ye)){for(var Ae=[],Le=0,Ge=ye.length;Le<Ge;Le++){var et=ye[Le];n[et]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",et),Ae.push(n[et])}return Ae}return n[ye]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",ye),n[ye]}}switch(e.type){case"Scene":i=new Hn,e.background!==void 0&&Number.isInteger(e.background)&&(i.background=new Qe(e.background)),e.fog!==void 0&&(e.fog.type==="Fog"?i.fog=new Yo(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(i.fog=new po(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":i=new Ni(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(i.focus=e.focus),e.zoom!==void 0&&(i.zoom=e.zoom),e.filmGauge!==void 0&&(i.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(i.filmOffset=e.filmOffset),e.view!==void 0&&(i.view=Object.assign({},e.view));break;case"OrthographicCamera":i=new wl(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(i.zoom=e.zoom),e.view!==void 0&&(i.view=Object.assign({},e.view));break;case"AmbientLight":i=new vd(e.color,e.intensity);break;case"DirectionalLight":i=new Ml(e.color,e.intensity);break;case"PointLight":i=new xl(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":i=new xd(e.color,e.intensity,e.width,e.height);break;case"SpotLight":i=new nc(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":i=new qc(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var m=l(e.geometry),x=d(e.material);i=new(m.bones&&0<m.bones.length?Tc:Ti)(m,x);break;case"InstancedMesh":m=l(e.geometry),x=d(e.material);var L=e.count,j=e.instanceMatrix;(i=new Ou(m,x,L)).instanceMatrix=new Qt(new Float32Array(j.array),16);break;case"LOD":i=new _c;break;case"Line":i=new La(l(e.geometry),d(e.material),e.mode);break;case"LineLoop":i=new Dc(l(e.geometry),d(e.material));break;case"LineSegments":i=new fi(l(e.geometry),d(e.material));break;case"PointCloud":case"Points":i=new Ul(l(e.geometry),d(e.material));break;case"Sprite":i=new Mc(d(e.material));break;case"Group":i=new il;break;default:i=new Pt}if(i.uuid=e.uuid,e.name!==void 0&&(i.name=e.name),e.matrix!==void 0?(i.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(i.matrixAutoUpdate=e.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(e.position!==void 0&&i.position.fromArray(e.position),e.rotation!==void 0&&i.rotation.fromArray(e.rotation),e.quaternion!==void 0&&i.quaternion.fromArray(e.quaternion),e.scale!==void 0&&i.scale.fromArray(e.scale)),e.castShadow!==void 0&&(i.castShadow=e.castShadow),e.receiveShadow!==void 0&&(i.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(i.shadow.bias=e.shadow.bias),e.shadow.radius!==void 0&&(i.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&i.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(i.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(i.visible=e.visible),e.frustumCulled!==void 0&&(i.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(i.renderOrder=e.renderOrder),e.userData!==void 0&&(i.userData=e.userData),e.layers!==void 0&&(i.layers.mask=e.layers),e.children!==void 0)for(var Z=e.children,ee=0;ee<Z.length;ee++)i.add(this.parseObject(Z[ee],t,n));if(e.type==="LOD"){e.autoUpdate!==void 0&&(i.autoUpdate=e.autoUpdate);for(var ie=e.levels,z=0;z<ie.length;z++){var he=ie[z],me=i.getObjectByProperty("uuid",he.object);me!==void 0&&i.addLevel(me,he.distance)}}return i}});var Cd,Cf={UVMapping:300,CubeReflectionMapping:Vt,CubeRefractionMapping:jt,EquirectangularReflectionMapping:Ln,EquirectangularRefractionMapping:nn,SphericalReflectionMapping:er,CubeUVReflectionMapping:yt,CubeUVRefractionMapping:Ue},Np={RepeatWrapping:Zt,ClampToEdgeWrapping:On,MirroredRepeatWrapping:Xn},Vp={NearestFilter:dt,NearestMipmapNearestFilter:lt,NearestMipmapLinearFilter:Xt,LinearFilter:xn,LinearMipmapNearestFilter:$t,LinearMipmapLinearFilter:Yn};function rp(e){typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),s.call(this,e),this.options=void 0}function ip(){this.type="ShapePath",this.color=new Qe,this.subPaths=[],this.currentPath=null}function ap(e){this.type="Font",this.data=e}function Sf(e,t,n,i,l){var d=l.glyphs[e]||l.glyphs["?"];if(d){var m,x,L,j,Z,ee,ie,z,he=new ip;if(d.o)for(var me=d._cachedOutline||(d._cachedOutline=d.o.split(" ")),ye=0,Ae=me.length;ye<Ae;)switch(me[ye++]){case"m":m=me[ye++]*t+n,x=me[ye++]*t+i,he.moveTo(m,x);break;case"l":m=me[ye++]*t+n,x=me[ye++]*t+i,he.lineTo(m,x);break;case"q":L=me[ye++]*t+n,j=me[ye++]*t+i,Z=me[ye++]*t+n,ee=me[ye++]*t+i,he.quadraticCurveTo(Z,ee,L,j);break;case"b":L=me[ye++]*t+n,j=me[ye++]*t+i,Z=me[ye++]*t+n,ee=me[ye++]*t+i,ie=me[ye++]*t+n,z=me[ye++]*t+i,he.bezierCurveTo(Z,ee,ie,z,L,j)}return{offsetX:d.ha*t,path:he}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+l.familyName+".")}function op(e){s.call(this,e)}rp.prototype=Object.assign(Object.create(s.prototype),{constructor:rp,setOptions:function(e){return this.options=e,this},load:function(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);var l=this,d=yl.get(e);if(d!==void 0)return l.manager.itemStart(e),setTimeout(function(){t&&t(d),l.manager.itemEnd(e)},0),d;fetch(e).then(function(m){return m.blob()}).then(function(m){return l.options===void 0?createImageBitmap(m):createImageBitmap(m,l.options)}).then(function(m){yl.add(e,m),t&&t(m),l.manager.itemEnd(e)}).catch(function(m){i&&i(m),l.manager.itemError(e),l.manager.itemEnd(e)}),l.manager.itemStart(e)}}),Object.assign(ip.prototype,{moveTo:function(e,t){return this.currentPath=new xa,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this},bezierCurveTo:function(e,t,n,i,l,d){return this.currentPath.bezierCurveTo(e,t,n,i,l,d),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(_t){for(var hn=[],bn=0,Kn=_t.length;bn<Kn;bn++){var qn=_t[bn],Bn=new Qa;Bn.curves=qn.curves,hn.push(Bn)}return hn}function i(_t,hn){for(var bn=hn.length,Kn=!1,qn=bn-1,Bn=0;Bn<bn;qn=Bn++){var ur=hn[qn],Sn=hn[Bn],Ne=Sn.x-ur.x,nt=Sn.y-ur.y;if(Math.abs(nt)>Number.EPSILON){if(nt<0&&(ur=hn[Bn],Ne=-Ne,Sn=hn[qn],nt=-nt),_t.y<ur.y||_t.y>Sn.y)continue;if(_t.y===ur.y){if(_t.x===ur.x)return 1}else{var qt=nt*(_t.x-ur.x)-Ne*(_t.y-ur.y);if(qt==0)return 1;if(qt<0)continue;Kn=!Kn}}else{if(_t.y!==ur.y)continue;if(Sn.x<=_t.x&&_t.x<=ur.x||ur.x<=_t.x&&_t.x<=Sn.x)return 1}}return Kn}var l=hs.isClockWise,d=this.subPaths;if(d.length===0)return[];if(t===!0)return n(d);var m,x,L,j=[];if(d.length===1)return x=d[0],(L=new Qa).curves=x.curves,j.push(L),j;var Z=!l(d[0].getPoints());Z=e?!Z:Z;var ee,ie,z=[],he=[],me=[],ye=0;he[ye]=void 0,me[ye]=[];for(var Ae=0,Le=d.length;Ae<Le;Ae++)m=l(ee=(x=d[Ae]).getPoints()),(m=e?!m:m)?(!Z&&he[ye]&&ye++,he[ye]={s:new Qa,p:ee},he[ye].s.curves=x.curves,Z&&ye++,me[ye]=[]):me[ye].push({h:x,p:ee[0]});if(!he[0])return n(d);if(1<he.length){for(var Ge=!1,et=[],Fe=0,at=he.length;Fe<at;Fe++)z[Fe]=[];for(Fe=0,at=he.length;Fe<at;Fe++)for(var Je=me[Fe],xt=0;xt<Je.length;xt++){for(var Tt=Je[xt],Et=!0,At=0;At<he.length;At++)i(Tt.p,he[At].p)&&(Fe!==At&&et.push({froms:Fe,tos:At,hole:xt}),Et?(Et=!1,z[At].push(Tt)):Ge=!0);Et&&z[Fe].push(Tt)}0<et.length&&(Ge||(me=z))}Ae=0;for(var Gt=he.length;Ae<Gt;Ae++){L=he[Ae].s,j.push(L);for(var Yt=0,St=(ie=me[Ae]).length;Yt<St;Yt++)L.holes.push(ie[Yt].h)}return j}}),Object.assign(ap.prototype,{isFont:!0,generateShapes:function(e,t){t===void 0&&(t=100);for(var n=[],i=function(m,x,L){for(var j=Array.from?Array.from(m):String(m).split(""),Z=x/L.resolution,ee=(L.boundingBox.yMax-L.boundingBox.yMin+L.underlineThickness)*Z,ie=[],z=0,he=0,me=0;me<j.length;me++){var ye=j[me];if(ye===`
|
|
`)z=0,he-=ee;else{var Ae=Sf(ye,Z,z,he,L);z+=Ae.offsetX,ie.push(Ae.path)}}return ie}(e,t,this.data),l=0,d=i.length;l<d;l++)Array.prototype.push.apply(n,i[l].toShapes());return n}}),op.prototype=Object.assign(Object.create(s.prototype),{constructor:op,load:function(e,t,n,i){var l=this,d=new P(this.manager);d.setPath(this.path),d.load(e,function(m){var x;try{x=JSON.parse(m)}catch(j){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),x=JSON.parse(m.substring(65,m.length-2))}var L=l.parse(x);t&&t(L)},n,i)},parse:function(e){return new ap(e)}});var sp={getContext:function(){return Cd===void 0&&(Cd=new(window.AudioContext||window.webkitAudioContext)),Cd},setContext:function(e){Cd=e}};function Sd(e){s.call(this,e)}function Dd(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new Re)}function ps(e,t){Ur.call(this,void 0,t),this.sh=e!==void 0?e:new Dd}function lp(e,t,n){ps.call(this,void 0,n);var i=new Qe().set(e),l=new Qe().set(t),d=new Re(i.r,i.g,i.b),m=new Re(l.r,l.g,l.b),x=Math.sqrt(Math.PI),L=x*Math.sqrt(.75);this.sh.coefficients[0].copy(d).add(m).multiplyScalar(x),this.sh.coefficients[1].copy(d).sub(m).multiplyScalar(L)}function cp(e,t){ps.call(this,void 0,t);var n=new Qe().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}Sd.prototype=Object.assign(Object.create(s.prototype),{constructor:Sd,load:function(e,t,n,i){var l=new P(this.manager);l.setResponseType("arraybuffer"),l.setPath(this.path),l.load(e,function(d){var m=d.slice(0);sp.getContext().decodeAudioData(m,function(x){t(x)})},n,i)}}),Object.assign(Dd.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,i=e.y,l=e.z,d=this.coefficients;return t.copy(d[0]).multiplyScalar(.282095),t.addScale(d[1],.488603*i),t.addScale(d[2],.488603*l),t.addScale(d[3],.488603*n),t.addScale(d[4],n*i*1.092548),t.addScale(d[5],i*l*1.092548),t.addScale(d[6],.315392*(3*l*l-1)),t.addScale(d[7],n*l*1.092548),t.addScale(d[8],.546274*(n*n-i*i)),t},getIrradianceAt:function(e,t){var n=e.x,i=e.y,l=e.z,d=this.coefficients;return t.copy(d[0]).multiplyScalar(.886227),t.addScale(d[1],1.023328*i),t.addScale(d[2],1.023328*l),t.addScale(d[3],1.023328*n),t.addScale(d[4],.858086*n*i),t.addScale(d[5],.858086*i*l),t.addScale(d[6],.743125*l*l-.247708),t.addScale(d[7],.858086*n*l),t.addScale(d[8],.429043*(n*n-i*i)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return new this.constructor().copy(this)},fromArray:function(e,t){t===void 0&&(t=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].fromArray(e,t+3*i);return this},toArray:function(e,t){e===void 0&&(e=[]),t===void 0&&(t=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].toArray(e,t+3*i);return e}}),Object.assign(Dd,{getBasisAt:function(e,t){var n=e.x,i=e.y,l=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*l,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*l,t[6]=.315392*(3*l*l-1),t[7]=1.092548*n*l,t[8]=.546274*(n*n-i*i)}}),ps.prototype=Object.assign(Object.create(Ur.prototype),{constructor:ps,isLightProbe:!0,copy:function(e){return Ur.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){return Ur.prototype.toJSON.call(this,e)}}),lp.prototype=Object.assign(Object.create(ps.prototype),{constructor:lp,isHemisphereLightProbe:!0,copy:function(e){return ps.prototype.copy.call(this,e),this},toJSON:function(e){return ps.prototype.toJSON.call(this,e)}}),cp.prototype=Object.assign(Object.create(ps.prototype),{constructor:cp,isAmbientLightProbe:!0,copy:function(e){return ps.prototype.copy.call(this,e),this},toJSON:function(e){return ps.prototype.toJSON.call(this,e)}});var Fp=new fr,Bp=new fr;function Gp(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ni,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ni,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 up(e){this.autoStart=e===void 0||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(Gp.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,i,l=e.projectionMatrix.clone(),d=t.eyeSep/2,m=d*t.near/t.focus,x=t.near*Math.tan(yr.DEG2RAD*t.fov*.5)/t.zoom;Bp.elements[12]=-d,Fp.elements[12]=d,n=-x*t.aspect+m,i=x*t.aspect+m,l.elements[0]=2*t.near/(i-n),l.elements[8]=(i+n)/(i-n),this.cameraL.projectionMatrix.copy(l),n=-x*t.aspect-m,i=x*t.aspect-m,l.elements[0]=2*t.near/(i-n),l.elements[8]=(i+n)/(i-n),this.cameraR.projectionMatrix.copy(l)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Bp),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Fp)}}),Object.assign(up.prototype,{start:function(){this.startTime=(typeof performance=="undefined"?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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=(typeof performance=="undefined"?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var Xc=new Re,zp=new Gi,Df=new Re,Yc=new Re;function hp(){Pt.call(this),this.type="AudioListener",this.context=sp.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new up}function Qu(e){Pt.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.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=[]}hp.prototype=Object.assign(Object.create(Pt.prototype),{constructor:hp,getInput:function(){return this.gain},removeFilter:function(){return this.filter!==null&&(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(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){Pt.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Xc,zp,Df),Yc.set(0,0,-1).applyQuaternion(zp),t.positionX){var i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Xc.x,i),t.positionY.linearRampToValueAtTime(Xc.y,i),t.positionZ.linearRampToValueAtTime(Xc.z,i),t.forwardX.linearRampToValueAtTime(Yc.x,i),t.forwardY.linearRampToValueAtTime(Yc.y,i),t.forwardZ.linearRampToValueAtTime(Yc.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(Xc.x,Xc.y,Xc.z),t.setOrientation(Yc.x,Yc.y,Yc.z,n.x,n.y,n.z)}}),Qu.prototype=Object.assign(Object.create(Pt.prototype),{constructor:Qu,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){if(e===void 0&&(e=0),this.isPlaying!==!0){if(this.hasPlaybackControl!==!1){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=t,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(this.hasPlaybackControl!==!1)return this.isPlaying===!0&&(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(this.hasPlaybackControl!==!1)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 e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);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 e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e=e||[],this.isPlaying===!0?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(this.hasPlaybackControl!==!1)return this.playbackRate=e,this.isPlaying===!0&&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 this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(this.hasPlaybackControl!==!1)return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var Zc=new Re,Up=new Gi,Ef=new Re,Kc=new Re;function dp(e){Qu.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function pp(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t!==void 0?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function fp(e,t,n){this.binding=e,this.valueSize=n;var i,l=Float64Array;switch(t){case"quaternion":i=this._slerp;break;case"string":case"bool":l=Array,i=this._select;break;default:i=this._lerp}this.buffer=new l(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}dp.prototype=Object.assign(Object.create(Qu.prototype),{constructor:dp,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){if(Pt.prototype.updateMatrixWorld.call(this,e),this.hasPlaybackControl!==!0||this.isPlaying!==!1){this.matrixWorld.decompose(Zc,Up,Ef),Kc.set(0,0,1).applyQuaternion(Up);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Zc.x,n),t.positionY.linearRampToValueAtTime(Zc.y,n),t.positionZ.linearRampToValueAtTime(Zc.z,n),t.orientationX.linearRampToValueAtTime(Kc.x,n),t.orientationY.linearRampToValueAtTime(Kc.y,n),t.orientationZ.linearRampToValueAtTime(Kc.z,n)}else t.setPosition(Zc.x,Zc.y,Zc.z),t.setOrientation(Kc.x,Kc.y,Kc.z)}}}),Object.assign(pp.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(fp.prototype,{accumulate:function(e,t){var n=this.buffer,i=this.valueSize,l=e*i+i,d=this.cumulativeWeight;if(d===0){for(var m=0;m!==i;++m)n[l+m]=n[m];d=t}else{var x=t/(d+=t);this._mixBufferRegion(n,l,0,x,i)}this.cumulativeWeight=d},apply:function(e){var t=this.valueSize,n=this.buffer,i=e*t+t,l=this.cumulativeWeight,d=this.binding;if(this.cumulativeWeight=0,l<1){var m=3*t;this._mixBufferRegion(n,i,m,1-l,t)}for(var x=t,L=t+t;x!==L;++x)if(n[x]!==n[x+t]){d.setValue(n,i);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,i=3*n;e.getValue(t,i);for(var l=n,d=i;l!==d;++l)t[l]=t[i+l%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,i,l){if(.5<=i)for(var d=0;d!==l;++d)e[t+d]=e[n+d]},_slerp:function(e,t,n,i){Gi.slerpFlat(e,t,e,t,e,n,i)},_lerp:function(e,t,n,i,l){for(var d=1-i,m=0;m!==l;++m){var x=t+m;e[x]=e[x]*d+e[n+m]*i}}});var mp="\\[\\]\\.:\\/",Af=new RegExp("["+mp+"]","g"),gp="[^"+mp+"]",Of="[^"+mp.replace("\\.","")+"]",Pf=/((?:WC+[\/:])*)/.source.replace("WC",gp),Rf=/(WCOD+)?/.source.replace("WCOD",Of),Lf=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",gp),If=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",gp),kf=new RegExp("^"+Pf+Rf+Lf+If+"$"),jf=["material","materials","bones"];function Hp(e,t,n){var i=n||eo.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}function eo(e,t,n){this.path=t,this.parsedPath=n||eo.parseTrackName(t),this.node=eo.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Wp(){this.uuid=yr.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function Jp(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var i=t.tracks,l=i.length,d=new Array(l),m={endingStart:Ce,endingEnd:Ce},x=0;x!==l;++x){var L=i[x].createInterpolant(null);(d[x]=L).settings=m}this._interpolantSettings=m,this._interpolants=d,this._propertyBindings=new Array(l),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 yp(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Ed(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function vp(e,t,n){Zo.call(this,e,t),this.meshPerAttribute=n||1}function qp(e,t,n,i){this.ray=new Pr(e,t),this.near=n||0,this.far=i||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 Xp(e,t){return e.distance-t.distance}function xp(e,t,n,i){if(e.visible!==!1&&(e.raycast(t,n),i===!0))for(var l=e.children,d=0,m=l.length;d<m;d++)xp(l[d],t,n,!0)}function Yp(e,t,n){return this.radius=e!==void 0?e:1,this.phi=t!==void 0?t:0,this.theta=n!==void 0?n:0,this}function Zp(e,t,n){return this.radius=e!==void 0?e:1,this.theta=t!==void 0?t:0,this.y=n!==void 0?n:0,this}Object.assign(Hp.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,l=n.length;i!==l;++i)n[i].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(eo,{Composite:Hp,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new eo.Composite(e,t,n):new eo(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Af,"")},parseTrackName:function(e){var t=kf.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){var l=n.nodeName.substring(i+1);jf.indexOf(l)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=l)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||t===""||t==="root"||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){var i=function(d){for(var m=0;m<d.length;m++){var x=d[m];if(x.name===t||x.uuid===t)return x;var L=i(x.children);if(L)return L}return null},l=i(e.children);if(l)return l}return null}}),Object.assign(eo.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(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,i=0,l=n.length;i!==l;++i)e[t++]=n[i]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,i=0,l=n.length;i!==l;++i)n[i]=e[t++]},function(e,t){for(var n=this.resolvedProperty,i=0,l=n.length;i!==l;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,i=0,l=n.length;i!==l;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,l=t.propertyIndex;if(e||(e=eo.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var d=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var m=0;m<e.length;m++)if(e[m].name===d){d=m;break}break;default:if(e[n]===void 0)return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(d!==void 0){if(e[d]===void 0)return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[d]}}var x=e[i];if(x!==void 0){var L=this.Versioning.None;(this.targetObject=e).needsUpdate!==void 0?L=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(L=this.Versioning.MatrixWorldNeedsUpdate);var j=this.BindingType.Direct;if(l!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(m=0;m<this.node.geometry.morphAttributes.position.length;m++)if(e.geometry.morphAttributes.position[m].name===l){l=m;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(m=0;m<this.node.geometry.morphTargets.length;m++)if(e.geometry.morphTargets[m].name===l){l=m;break}}}j=this.BindingType.ArrayElement,this.resolvedProperty=x,this.propertyIndex=l}else x.fromArray!==void 0&&x.toArray!==void 0?(j=this.BindingType.HasFromToArray,this.resolvedProperty=x):Array.isArray(x)?(j=this.BindingType.EntireArray,this.resolvedProperty=x):this.propertyName=i;this.getValue=this.GetterByBindingType[j],this.setValue=this.SetterByBindingTypeAndVersioning[j][L]}else{var Z=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+Z+"."+i+" but it wasn't found.",e)}}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(eo.prototype,{_getValue_unbound:eo.prototype.getValue,_setValue_unbound:eo.prototype.setValue}),Object.assign(Wp.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,l=this._paths,d=this._parsedPaths,m=this._bindings,x=m.length,L=void 0,j=0,Z=arguments.length;j!==Z;++j){var ee=arguments[j],ie=ee.uuid,z=i[ie];if(z===void 0){z=t++,i[ie]=z,e.push(ee);for(var he=0,me=x;he!==me;++he)m[he].push(new eo(ee,l[he],d[he]))}else if(z<n){L=e[z];var ye=--n,Ae=e[ye];for(e[i[Ae.uuid]=z]=Ae,e[i[ie]=ye]=ee,he=0,me=x;he!==me;++he){var Le=m[he],Ge=Le[ye],et=Le[z];Le[z]=Ge,et===void 0&&(et=new eo(ee,l[he],d[he])),Le[ye]=et}}else e[z]!==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 e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,l=i.length,d=0,m=arguments.length;d!==m;++d){var x=arguments[d],L=x.uuid,j=n[L];if(j!==void 0&&t<=j){var Z=t++,ee=e[Z];e[n[ee.uuid]=j]=ee,e[n[L]=Z]=x;for(var ie=0,z=l;ie!==z;++ie){var he=i[ie],me=he[Z],ye=he[j];he[j]=me,he[Z]=ye}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,l=this._bindings,d=l.length,m=0,x=arguments.length;m!==x;++m){var L=arguments[m].uuid,j=i[L];if(j!==void 0)if(delete i[L],j<n){var Z=--n,ee=e[Z],ie=e[Ae=--t];e[i[ee.uuid]=j]=ee,e[i[ie.uuid]=Z]=ie,e.pop();for(var z=0,he=d;z!==he;++z){var me=(Le=l[z])[Z],ye=Le[Ae];Le[j]=me,Le[Z]=ye,Le.pop()}}else{var Ae;for(e[i[(ie=e[Ae=--t]).uuid]=j]=ie,e.pop(),z=0,he=d;z!==he;++z){var Le;(Le=l[z])[j]=Le[Ae],Le.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,i=n[e],l=this._bindings;if(i!==void 0)return l[i];var d=this._paths,m=this._parsedPaths,x=this._objects,L=x.length,j=this.nCachedObjects_,Z=new Array(L);i=l.length,n[e]=i,d.push(e),m.push(t),l.push(Z);for(var ee=j,ie=x.length;ee!==ie;++ee){var z=x[ee];Z[ee]=new eo(z,e,t)}return Z},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){var i=this._paths,l=this._parsedPaths,d=this._bindings,m=d.length-1,x=d[m];d[t[e[m]]=n]=x,d.pop(),l[n]=l[m],l.pop(),i[n]=i[m],i.pop()}}}),Object.assign(Jp.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&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var i=this._clip.duration,l=e._clip.duration,d=l/i,m=i/l;e.warp(1,d,t),this.warp(m,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var i=this._mixer,l=i.time,d=this._timeScaleInterpolant,m=this.timeScale;d===null&&(d=i._lendControlInterpolant(),this._timeScaleInterpolant=d);var x=d.parameterPositions,L=d.sampleValues;return x[0]=l,x[1]=l+n,L[0]=e/m,L[1]=t/m,this},stopWarping:function(){var e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,i){if(this.enabled){var l=this._startTime;if(l!==null){var d=(e-l)*n;if(d<0||n===0)return;this._startTime=null,t=n*d}t*=this._updateTimeScale(e);var m=this._updateTime(t),x=this._updateWeight(e);if(0<x)for(var L=this._interpolants,j=this._propertyBindings,Z=0,ee=L.length;Z!==ee;++Z)L[Z].evaluate(m),j[Z].accumulate(i,x)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(n!==null){var i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,i=this.loop,l=this._loopCount,d=i===2202;if(e===0)return l!==-1&&d&&(1&l)==1?n-t:t;if(i===2200){l===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n<=t)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(l===-1&&(0<=e?(l=0,this._setEndings(!0,this.repetitions===0,d)):this._setEndings(this.repetitions===0,!0,d)),n<=t||t<0){var m=Math.floor(t/n);t-=n*m,l+=Math.abs(m);var x=this.repetitions-l;if(x<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=0<e?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<e?1:-1});else{if(x==1){var L=e<0;this._setEndings(L,!L,d)}else this._setEndings(!1,!1,d);this._loopCount=l,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:m})}}else this.time=t;if(d&&(1&l)==1)return n-t}return t},_setEndings:function(e,t,n){var i=this._interpolantSettings;n?(i.endingStart=ce,i.endingEnd=ce):(i.endingStart=e?this.zeroSlopeAtStart?ce:Ce:Te,i.endingEnd=t?this.zeroSlopeAtEnd?ce:Ce:Te)},_scheduleFading:function(e,t,n){var i=this._mixer,l=i.time,d=this._weightInterpolant;d===null&&(d=i._lendControlInterpolant(),this._weightInterpolant=d);var m=d.parameterPositions,x=d.sampleValues;return m[0]=l,x[0]=t,m[1]=l+e,x[1]=n,this}}),yp.prototype=Object.assign(Object.create(ka.prototype),{constructor:yp,_bindAction:function(e,t){var n=e._localRoot||this._root,i=e._clip.tracks,l=i.length,d=e._propertyBindings,m=e._interpolants,x=n.uuid,L=this._bindingsByRootAndName,j=L[x];j===void 0&&(j={},L[x]=j);for(var Z=0;Z!==l;++Z){var ee=i[Z],ie=ee.name,z=j[ie];if(z!==void 0)d[Z]=z;else{if((z=d[Z])!==void 0){z._cacheIndex===null&&(++z.referenceCount,this._addInactiveBinding(z,x,ie));continue}var he=t&&t._propertyBindings[Z].binding.parsedPath;++(z=new fp(eo.create(n,ie,he),ee.ValueTypeName,ee.getValueSize())).referenceCount,this._addInactiveBinding(z,x,ie),d[Z]=z}m[Z].resultBuffer=z.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}for(var l=e._propertyBindings,d=0,m=l.length;d!==m;++d){var x=l[d];x.useCount++==0&&(this._lendBinding(x),x.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var l=t[n];--l.useCount==0&&(l.restoreOriginalState(),this._takeBackBinding(l))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return t!==null&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var i=this._actions,l=this._actionsByClip,d=l[t];if(d===void 0)d={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,l[t]=d;else{var m=d.knownActions;e._byClipCacheIndex=m.length,m.push(e)}e._cacheIndex=i.length,i.push(e),d.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],i=e._cacheIndex;t[n._cacheIndex=i]=n,t.pop(),e._cacheIndex=null;var l=e._clip.uuid,d=this._actionsByClip,m=d[l],x=m.knownActions,L=x[x.length-1],j=e._byClipCacheIndex;x[L._byClipCacheIndex=j]=L,x.pop(),e._byClipCacheIndex=null,delete m.actionByRoot[(e._localRoot||this._root).uuid],x.length===0&&delete d[l],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var l=t[n];--l.referenceCount==0&&this._removeInactiveBinding(l)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,l=t[i];t[e._cacheIndex=i]=e,t[l._cacheIndex=n]=l},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,l=t[i];t[e._cacheIndex=i]=e,t[l._cacheIndex=n]=l},_addInactiveBinding:function(e,t,n){var i=this._bindingsByRootAndName,l=i[t],d=this._bindings;l===void 0&&(l={},i[t]=l),(l[n]=e)._cacheIndex=d.length,d.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,i=n.rootNode.uuid,l=n.path,d=this._bindingsByRootAndName,m=d[i],x=t[t.length-1],L=e._cacheIndex;t[x._cacheIndex=L]=x,t.pop(),delete m[l],Object.keys(m).length===0&&delete d[i]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,l=t[i];t[e._cacheIndex=i]=e,t[l._cacheIndex=n]=l},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,l=t[i];t[e._cacheIndex=i]=e,t[l._cacheIndex=n]=l},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return n===void 0&&(e[(n=new Jc(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,l=t[i];t[e.__cacheIndex=i]=e,t[l.__cacheIndex=n]=l},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,i=n.uuid,l=typeof e=="string"?To.findByName(n,e):e,d=l!==null?l.uuid:e,m=this._actionsByClip[d],x=null;if(m!==void 0){var L=m.actionByRoot[i];if(L!==void 0)return L;x=m.knownActions[0],l===null&&(l=x._clip)}if(l===null)return null;var j=new Jp(this,l,t);return this._bindAction(j,x),this._addInactiveAction(j,d,i),j},existingAction:function(e,t){var n=t||this._root,i=n.uuid,l=typeof e=="string"?To.findByName(n,e):e,d=l?l.uuid:e,m=this._actionsByClip[d];return m!==void 0&&m.actionByRoot[i]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0;for(var l=this._nActiveBindings=0;l!==t;++l)e[l].reset();for(l=0;l!==i;++l)n[l].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,i=this.time+=e,l=Math.sign(e),d=this._accuIndex^=1,m=0;m!==n;++m)t[m]._update(i,e,l,d);var x=this._bindings,L=this._nActiveBindings;for(m=0;m!==L;++m)x[m].apply(d);return this},setTime:function(e){for(var t=this.time=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,i=this._actionsByClip,l=i[n];if(l!==void 0){for(var d=l.knownActions,m=0,x=d.length;m!==x;++m){var L=d[m];this._deactivateAction(L);var j=L._cacheIndex,Z=t[t.length-1];L._cacheIndex=null,L._byClipCacheIndex=null,t[Z._cacheIndex=j]=Z,t.pop(),this._removeInactiveBindingsForAction(L)}delete i[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var i in n){var l=n[i].actionByRoot[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}var d=this._bindingsByRootAndName[t];if(d!==void 0)for(var m in d){var x=d[m];x.restoreOriginalState(),this._removeInactiveBinding(x)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Ed.prototype.clone=function(){return new Ed(this.value.clone===void 0?this.value:this.value.clone())},vp.prototype=Object.assign(Object.create(Zo.prototype),{constructor:vp,isInstancedInterleavedBuffer:!0,copy:function(e){return Zo.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(qp.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var i=n||[];return xp(e,this,i,t),i.sort(Xp),i},intersectObjects:function(e,t,n){var i=n||[];if(Array.isArray(e)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var l=0,d=e.length;l<d;l++)xp(e[l],this,i,t);return i.sort(Xp),i}}),Object.assign(Yp.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(yr.clamp(t/this.radius,-1,1))),this}}),Object.assign(Zp.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var Kp=new zt;function wp(e,t){this.min=e!==void 0?e:new zt(1/0,1/0),this.max=t!==void 0?t:new zt(-1/0,-1/0)}Object.assign(wp.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=Kp.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.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(e){return e===void 0&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new zt),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return e===void 0&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new zt),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return t===void 0&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new zt),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return t===void 0&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new zt),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return Kp.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var $p=new Re,Ad=new Re;function bp(e,t){this.start=e!==void 0?e:new Re,this.end=t!==void 0?t:new Re}function Mp(e){Pt.call(this),this.material=e,this.render=function(){}}Object.assign(bp.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return e===void 0&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Re),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return e===void 0&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Re),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return t===void 0&&(console.warn("THREE.Line3: .at() target is now required"),t=new Re),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){$p.subVectors(e,this.start),Ad.subVectors(this.end,this.start);var n=Ad.dot(Ad),i=Ad.dot($p)/n;return t&&(i=yr.clamp(i,0,1)),i},closestPointToPoint:function(e,t,n){var i=this.closestPointToPointParameter(e,t);return n===void 0&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Re),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),((Mp.prototype=Object.create(Pt.prototype)).constructor=Mp).prototype.isImmediateRenderObject=!0;var Qp=new Re;function Od(e,t){Pt.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new Cn,i=[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],l=0,d=1;l<32;l++,d++){var m=l/32*Math.PI*2,x=d/32*Math.PI*2;i.push(Math.cos(m),Math.sin(m),1,Math.cos(x),Math.sin(x),1)}n.setAttribute("position",new an(i,3));var L=new Vi({fog:!1});this.cone=new fi(n,L),this.add(this.cone),this.update()}((Od.prototype=Object.create(Pt.prototype)).constructor=Od).prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Od.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Qp.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Qp),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var ic=new Re,Pd=new fr,_p=new fr;function Rd(e){for(var t=function Z(ee){var ie=[];ee&&ee.isBone&&ie.push(ee);for(var z=0;z<ee.children.length;z++)ie.push.apply(ie,Z(ee.children[z]));return ie}(e),n=new Cn,i=[],l=[],d=new Qe(0,0,1),m=new Qe(0,1,0),x=0;x<t.length;x++){var L=t[x];L.parent&&L.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),l.push(d.r,d.g,d.b),l.push(m.r,m.g,m.b))}n.setAttribute("position",new an(i,3)),n.setAttribute("color",new an(l,3));var j=new Vi({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});fi.call(this,n,j),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function Ld(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var i=new dl(t,4,2),l=new _r({wireframe:!0,fog:!1});Ti.call(this,i,l),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}((Rd.prototype=Object.create(fi.prototype)).constructor=Rd).prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,i=n.getAttribute("position");_p.getInverse(this.root.matrixWorld);for(var l=0,d=0;l<t.length;l++){var m=t[l];m.parent&&m.parent.isBone&&(Pd.multiplyMatrices(_p,m.matrixWorld),ic.setFromMatrixPosition(Pd),i.setXYZ(d,ic.x,ic.y,ic.z),Pd.multiplyMatrices(_p,m.parent.matrixWorld),ic.setFromMatrixPosition(Pd),i.setXYZ(d+1,ic.x,ic.y,ic.z),d+=2)}n.getAttribute("position").needsUpdate=!0,Pt.prototype.updateMatrixWorld.call(this,e)},((Ld.prototype=Object.create(Ti.prototype)).constructor=Ld).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Ld.prototype.update=function(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var Nf=new Re,ef=new Qe,tf=new Qe;function Id(e,t,n){Pt.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new mi(t);i.rotateY(.5*Math.PI),this.material=new _r({wireframe:!0,fog:!1}),this.color===void 0&&(this.material.vertexColors=2);var l=i.getAttribute("position"),d=new Float32Array(3*l.count);i.setAttribute("color",new Qt(d,3)),this.add(new Ti(i,this.material)),this.update()}function kd(e,t,n,i){e=e||10,t=t||10,n=new Qe(n!==void 0?n:4473924),i=new Qe(i!==void 0?i:8947848);for(var l=t/2,d=e/t,m=e/2,x=[],L=[],j=0,Z=0,ee=-m;j<=t;j++,ee+=d){x.push(-m,0,ee,m,0,ee),x.push(ee,0,-m,ee,0,m);var ie=j===l?n:i;ie.toArray(L,Z),Z+=3,ie.toArray(L,Z),Z+=3,ie.toArray(L,Z),Z+=3,ie.toArray(L,Z),Z+=3}var z=new Cn;z.setAttribute("position",new an(x,3)),z.setAttribute("color",new an(L,3));var he=new Vi({vertexColors:2});fi.call(this,z,he)}function Tp(e,t,n,i,l,d){e=e||10,t=t||16,n=n||8,i=i||64,l=new Qe(l!==void 0?l:4473924),d=new Qe(d!==void 0?d:8947848);var m,x,L,j,Z,ee,ie,z=[],he=[];for(j=0;j<=t;j++)L=j/t*(2*Math.PI),m=Math.sin(L)*e,x=Math.cos(L)*e,z.push(0,0,0),z.push(m,0,x),ie=1&j?l:d,he.push(ie.r,ie.g,ie.b),he.push(ie.r,ie.g,ie.b);for(j=0;j<=n;j++)for(ie=1&j?l:d,ee=e-e/n*j,Z=0;Z<i;Z++)L=Z/i*(2*Math.PI),m=Math.sin(L)*ee,x=Math.cos(L)*ee,z.push(m,0,x),he.push(ie.r,ie.g,ie.b),L=(Z+1)/i*(2*Math.PI),m=Math.sin(L)*ee,x=Math.cos(L)*ee,z.push(m,0,x),he.push(ie.r,ie.g,ie.b);var me=new Cn;me.setAttribute("position",new an(z,3)),me.setAttribute("color",new an(he,3));var ye=new Vi({vertexColors:2});fi.call(this,me,ye)}((Id.prototype=Object.create(Pt.prototype)).constructor=Id).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Id.prototype.update=function(){var e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");ef.copy(this.light.color),tf.copy(this.light.groundColor);for(var n=0,i=t.count;n<i;n++){var l=n<i/2?ef:tf;t.setXYZ(n,l.r,l.g,l.b)}t.needsUpdate=!0}e.lookAt(Nf.setFromMatrixPosition(this.light.matrixWorld).negate())},kd.prototype=Object.assign(Object.create(fi.prototype),{constructor:kd,copy:function(e){return fi.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return new this.constructor().copy(this)}}),(Tp.prototype=Object.create(fi.prototype)).constructor=Tp;var nf=new Re,jd=new Re,rf=new Re;function Nd(e,t,n){Pt.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,t===void 0&&(t=1);var i=new Cn;i.setAttribute("position",new an([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var l=new Vi({fog:!1});this.lightPlane=new La(i,l),this.add(this.lightPlane),(i=new Cn).setAttribute("position",new an([0,0,0,0,0,1],3)),this.targetLine=new La(i,l),this.add(this.targetLine),this.update()}((Nd.prototype=Object.create(Pt.prototype)).constructor=Nd).prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Nd.prototype.update=function(){nf.setFromMatrixPosition(this.light.matrixWorld),jd.setFromMatrixPosition(this.light.target.matrixWorld),rf.subVectors(jd,nf),this.lightPlane.lookAt(jd),this.color!==void 0?(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(jd),this.targetLine.scale.z=rf.length()};var Vd=new Re,ea=new Lo;function Cp(e){var t=new Cn,n=new Vi({color:16777215,vertexColors:1}),i=[],l=[],d={},m=new Qe(16755200),x=new Qe(16711680),L=new Qe(43775),j=new Qe(16777215),Z=new Qe(3355443);function ee(z,he,me){ie(z,me),ie(he,me)}function ie(z,he){i.push(0,0,0),l.push(he.r,he.g,he.b),d[z]===void 0&&(d[z]=[]),d[z].push(i.length/3-1)}ee("n1","n2",m),ee("n2","n4",m),ee("n4","n3",m),ee("n3","n1",m),ee("f1","f2",m),ee("f2","f4",m),ee("f4","f3",m),ee("f3","f1",m),ee("n1","f1",m),ee("n2","f2",m),ee("n3","f3",m),ee("n4","f4",m),ee("p","n1",x),ee("p","n2",x),ee("p","n3",x),ee("p","n4",x),ee("u1","u2",L),ee("u2","u3",L),ee("u3","u1",L),ee("c","t",j),ee("p","c",Z),ee("cn1","cn2",Z),ee("cn3","cn4",Z),ee("cf1","cf2",Z),ee("cf3","cf4",Z),t.setAttribute("position",new an(i,3)),t.setAttribute("color",new an(l,3)),fi.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=d,this.update()}function oa(e,t,n,i,l,d,m){Vd.set(l,d,m).unproject(i);var x=t[e];if(x!==void 0)for(var L=n.getAttribute("position"),j=0,Z=x.length;j<Z;j++)L.setXYZ(x[j],Vd.x,Vd.y,Vd.z)}((Cp.prototype=Object.create(fi.prototype)).constructor=Cp).prototype.update=function(){var e=this.geometry,t=this.pointMap;ea.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),oa("c",t,e,ea,0,0,-1),oa("t",t,e,ea,0,0,1),oa("n1",t,e,ea,-1,-1,-1),oa("n2",t,e,ea,1,-1,-1),oa("n3",t,e,ea,-1,1,-1),oa("n4",t,e,ea,1,1,-1),oa("f1",t,e,ea,-1,-1,1),oa("f2",t,e,ea,1,-1,1),oa("f3",t,e,ea,-1,1,1),oa("f4",t,e,ea,1,1,1),oa("u1",t,e,ea,.7,1.1,-1),oa("u2",t,e,ea,-.7,1.1,-1),oa("u3",t,e,ea,0,2,-1),oa("cf1",t,e,ea,-1,0,1),oa("cf2",t,e,ea,1,0,1),oa("cf3",t,e,ea,0,-1,1),oa("cf4",t,e,ea,0,1,1),oa("cn1",t,e,ea,-1,0,-1),oa("cn2",t,e,ea,1,0,-1),oa("cn3",t,e,ea,0,-1,-1),oa("cn4",t,e,ea,0,1,-1),e.getAttribute("position").needsUpdate=!0};var Fd=new Ki;function $c(e,t){this.object=e,t===void 0&&(t=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]),i=new Float32Array(24),l=new Cn;l.setIndex(new Qt(n,1)),l.setAttribute("position",new Qt(i,3)),fi.call(this,l,new Vi({color:t})),this.matrixAutoUpdate=!1,this.update()}function Sp(e,t){this.type="Box3Helper",this.box=e,t=t||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]),i=new Cn;i.setIndex(new Qt(n,1)),i.setAttribute("position",new an([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)),fi.call(this,i,new Vi({color:t})),this.geometry.computeBoundingSphere()}function Dp(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=t===void 0?1:t;var i=n!==void 0?n:16776960,l=new Cn;l.setAttribute("position",new an([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)),l.computeBoundingSphere(),La.call(this,l,new Vi({color:i}));var d=new Cn;d.setAttribute("position",new an([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),d.computeBoundingSphere(),this.add(new Ti(d,new _r({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}(($c.prototype=Object.create(fi.prototype)).constructor=$c).prototype.update=function(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&Fd.setFromObject(this.object),!Fd.isEmpty()){var t=Fd.min,n=Fd.max,i=this.geometry.attributes.position,l=i.array;l[0]=n.x,l[1]=n.y,l[2]=n.z,l[3]=t.x,l[4]=n.y,l[5]=n.z,l[6]=t.x,l[7]=t.y,l[8]=n.z,l[9]=n.x,l[10]=t.y,l[11]=n.z,l[12]=n.x,l[13]=n.y,l[14]=t.z,l[15]=t.x,l[16]=n.y,l[17]=t.z,l[18]=t.x,l[19]=t.y,l[20]=t.z,l[21]=n.x,l[22]=t.y,l[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}},$c.prototype.setFromObject=function(e){return this.object=e,this.update(),this},$c.prototype.copy=function(e){return fi.prototype.copy.call(this,e),this.object=e.object,this},$c.prototype.clone=function(){return new this.constructor().copy(this)},((Sp.prototype=Object.create(fi.prototype)).constructor=Sp).prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),Pt.prototype.updateMatrixWorld.call(this,e))},((Dp.prototype=Object.create(La.prototype)).constructor=Dp).prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?M:A,this.lookAt(this.plane.normal),Pt.prototype.updateMatrixWorld.call(this,e)};var Ep,af,of=new Re;function Qc(e,t,n,i,l,d){Pt.call(this),e===void 0&&(e=new Re(0,0,1)),t===void 0&&(t=new Re(0,0,0)),n===void 0&&(n=1),i===void 0&&(i=16776960),l===void 0&&(l=.2*n),d===void 0&&(d=.2*l),Ep===void 0&&((Ep=new Cn).setAttribute("position",new an([0,0,0,0,1,0],3)),(af=new Is(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new La(Ep,new Vi({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Ti(af,new _r({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,l,d)}function Bd(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new Cn;n.setAttribute("position",new an(t,3)),n.setAttribute("color",new an([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new Vi({vertexColors:2});fi.call(this,n,i)}((Qc.prototype=Object.create(Pt.prototype)).constructor=Qc).prototype.setDirection=function(e){if(.99999<e.y)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{of.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(of,t)}},Qc.prototype.setLength=function(e,t,n){t===void 0&&(t=.2*e),n===void 0&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Qc.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},Qc.prototype.copy=function(e){return Pt.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Qc.prototype.clone=function(){return new this.constructor().copy(this)},(Bd.prototype=Object.create(fi.prototype)).constructor=Bd;var eh=4,ac=8,Vs=Math.pow(2,ac),sf=[.125,.215,.35,.446,.526,.582],lf=ac-eh+1+sf.length,th=20,Ua={};Ua[Ke]=0,Ua[vt]=1,Ua[Jt]=2,Ua[Gn]=3,Ua[sr]=4,Ua[hi]=5,Ua[Ft]=6;var cf,uf,Ap=new wl,Gd=((uf=new ks({defines:{n:cf=th},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(cf)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new Re(0,1,0)},inputEncoding:{value:Ua[Ke]},outputEncoding:{value:Ua[Ke]}},vertexShader:`
|
|
precision mediump float;
|
|
precision mediump int;
|
|
attribute vec3 position;
|
|
attribute vec2 uv;
|
|
attribute float faceIndex;
|
|
varying vec3 vOutputDirection;
|
|
vec3 getDirection(vec2 uv, float face) {
|
|
uv = 2.0 * uv - 1.0;
|
|
vec3 direction = vec3(uv, 1.0);
|
|
if (face == 0.0) {
|
|
direction = direction.zyx;
|
|
direction.z *= -1.0;
|
|
} else if (face == 1.0) {
|
|
direction = direction.xzy;
|
|
direction.z *= -1.0;
|
|
} else if (face == 3.0) {
|
|
direction = direction.zyx;
|
|
direction.x *= -1.0;
|
|
} else if (face == 4.0) {
|
|
direction = direction.xzy;
|
|
direction.y *= -1.0;
|
|
} else if (face == 5.0) {
|
|
direction.xz *= -1.0;
|
|
}
|
|
return direction;
|
|
}
|
|
void main() {
|
|
vOutputDirection = getDirection(uv, faceIndex);
|
|
gl_Position = vec4( position, 1.0 );
|
|
}
|
|
`,fragmentShader:`
|
|
precision mediump float;
|
|
precision mediump int;
|
|
varying vec3 vOutputDirection;
|
|
uniform sampler2D envMap;
|
|
uniform int samples;
|
|
uniform float weights[n];
|
|
uniform bool latitudinal;
|
|
uniform float dTheta;
|
|
uniform float mipInt;
|
|
uniform vec3 poleAxis;
|
|
|
|
|
|
uniform int inputEncoding;
|
|
uniform int outputEncoding;
|
|
|
|
#include <encodings_pars_fragment>
|
|
|
|
vec4 inputTexelToLinear(vec4 value){
|
|
if(inputEncoding == 0){
|
|
return value;
|
|
}else if(inputEncoding == 1){
|
|
return sRGBToLinear(value);
|
|
}else if(inputEncoding == 2){
|
|
return RGBEToLinear(value);
|
|
}else if(inputEncoding == 3){
|
|
return RGBMToLinear(value, 7.0);
|
|
}else if(inputEncoding == 4){
|
|
return RGBMToLinear(value, 16.0);
|
|
}else if(inputEncoding == 5){
|
|
return RGBDToLinear(value, 256.0);
|
|
}else{
|
|
return GammaToLinear(value, 2.2);
|
|
}
|
|
}
|
|
|
|
vec4 linearToOutputTexel(vec4 value){
|
|
if(outputEncoding == 0){
|
|
return value;
|
|
}else if(outputEncoding == 1){
|
|
return LinearTosRGB(value);
|
|
}else if(outputEncoding == 2){
|
|
return LinearToRGBE(value);
|
|
}else if(outputEncoding == 3){
|
|
return LinearToRGBM(value, 7.0);
|
|
}else if(outputEncoding == 4){
|
|
return LinearToRGBM(value, 16.0);
|
|
}else if(outputEncoding == 5){
|
|
return LinearToRGBD(value, 256.0);
|
|
}else{
|
|
return LinearToGamma(value, 2.2);
|
|
}
|
|
}
|
|
|
|
vec4 envMapTexelToLinear(vec4 color) {
|
|
return inputTexelToLinear(color);
|
|
}
|
|
|
|
|
|
#define ENVMAP_TYPE_CUBE_UV
|
|
#include <cube_uv_reflection_fragment>
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(0.0);
|
|
for (int i = 0; i < n; i++) {
|
|
if (i >= samples)
|
|
break;
|
|
for (int dir = -1; dir < 2; dir += 2) {
|
|
if (i == 0 && dir == 1)
|
|
continue;
|
|
vec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);
|
|
if (all(equal(axis, vec3(0.0))))
|
|
axis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);
|
|
axis = normalize(axis);
|
|
float theta = dTheta * float(dir * i);
|
|
float cosTheta = cos(theta);
|
|
// Rodrigues' axis-angle rotation
|
|
vec3 sampleDirection = vOutputDirection * cosTheta
|
|
+ cross(axis, vOutputDirection) * sin(theta)
|
|
+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);
|
|
gl_FragColor.rgb +=
|
|
weights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);
|
|
}
|
|
}
|
|
gl_FragColor = linearToOutputTexel(gl_FragColor);
|
|
}
|
|
`,blending:T,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",uf),eu=null,tu=null,Op=function(){for(var e=[],t=[],n=[],i=ac,l=0;l<lf;l++){var d=Math.pow(2,i);t.push(d);var m=1/d;ac-eh<l?m=sf[l-ac+eh-1]:l==0&&(m=0),n.push(m);for(var x=1/(d-1),L=-x/2,j=1+x/2,Z=[L,L,j,L,j,j,L,L,j,j,L,j],ee=new Float32Array(108),ie=new Float32Array(72),z=new Float32Array(36),he=0;he<6;he++){var me=he%3*2/3-1,ye=2<he?0:-1,Ae=[me,ye,0,me+2/3,ye,0,me+2/3,1+ye,0,me,ye,0,me+2/3,1+ye,0,me,1+ye,0];ee.set(Ae,18*he),ie.set(Z,12*he);var Le=[he,he,he,he,he,he];z.set(Le,6*he)}var Ge=new Cn;Ge.setAttribute("position",new Qt(ee,3)),Ge.setAttribute("uv",new Qt(ie,2)),Ge.setAttribute("faceIndex",new Qt(z,1)),e.push(Ge),eh<i&&i--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}(),Bh=Op._lodPlanes,hf=Op._sizeLods,zd=Op._sigmas,Ud=null,Ci=null,Pp=null,nu=(1+Math.sqrt(5))/2,nh=1/nu,df=[new Re(1,1,1),new Re(-1,1,1),new Re(1,1,-1),new Re(-1,1,-1),new Re(0,nu,nh),new Re(0,nu,-nh),new Re(nh,0,nu),new Re(-nh,0,nu),new Re(nu,nh,0),new Re(-nu,nh,0)];function Rp(e){Ci=e,Lp(Gd)}function pf(e){var t={magFilter:dt,minFilter:dt,generateMipmaps:!1,type:e?e.type:kr,format:e?e.format:wi,encoding:e?e.encoding:Jt,depthBuffer:!1,stencilBuffer:!1},n=mf(t);return n.depthBuffer=!e,Ud=mf(t),n}function ff(e){Ud.dispose(),Ci.setRenderTarget(Pp),e.scissorTest=!1,e.setSize(e.width,e.height)}function Lp(e){var t=new Hn;t.add(new Ti(Bh[0],e)),Ci.compile(t,Ap)}function mf(e){var t=new Zi(3*Vs,3*Vs,e);return t.texture.mapping=yt,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Ip(e,t,n,i,l){e.viewport.set(t,n,i,l),e.scissor.set(t,n,i,l)}function gf(e){var t=Ci.autoClear;Ci.autoClear=!1;for(var n=1;n<lf;n++)yf(e,n-1,n,Math.sqrt(zd[n]*zd[n]-zd[n-1]*zd[n-1]),df[(n-1)%df.length]);Ci.autoClear=t}function yf(e,t,n,i,l){vf(e,Ud,t,n,i,"latitudinal",l),vf(Ud,e,n,n,i,"longitudinal",l)}function vf(e,t,n,i,l,d,m){d!=="latitudinal"&&d!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");var x=new Hn;x.add(new Ti(Bh[i],Gd));var L=Gd.uniforms,j=hf[n]-1,Z=isFinite(l)?Math.PI/(2*j):2*Math.PI/(2*th-1),ee=l/Z,ie=isFinite(l)?1+Math.floor(3*ee):th;th<ie&&console.warn("sigmaRadians, "+l+", is too large and will clip, as it requested "+ie+" samples when the maximum is set to "+th);for(var z=[],he=0,me=0;me<th;++me){var ye=me/ee,Ae=Math.exp(-ye*ye/2);z.push(Ae),me==0?he+=Ae:me<ie&&(he+=2*Ae)}for(me=0;me<z.length;me++)z[me]=z[me]/he;L.envMap.value=e.texture,L.samples.value=ie,L.weights.value=z,L.latitudinal.value=d==="latitudinal",m&&(L.poleAxis.value=m),L.dTheta.value=Z,L.mipInt.value=ac-n,L.inputEncoding.value=Ua[e.texture.encoding],L.outputEncoding.value=Ua[e.texture.encoding];var Le=hf[i];Ip(t,ye=3*Math.max(0,Vs-2*Le),(i===0?0:2*Vs)+2*Le*(ac-eh<i?i-ac+eh:0),3*Le,2*Le),Ci.setRenderTarget(t),Ci.render(x,Ap)}function xf(){var e=new ks({uniforms:{envMap:{value:null},texelSize:{value:new zt(1,1)},inputEncoding:{value:Ua[Ke]},outputEncoding:{value:Ua[Ke]}},vertexShader:`
|
|
precision mediump float;
|
|
precision mediump int;
|
|
attribute vec3 position;
|
|
attribute vec2 uv;
|
|
attribute float faceIndex;
|
|
varying vec3 vOutputDirection;
|
|
vec3 getDirection(vec2 uv, float face) {
|
|
uv = 2.0 * uv - 1.0;
|
|
vec3 direction = vec3(uv, 1.0);
|
|
if (face == 0.0) {
|
|
direction = direction.zyx;
|
|
direction.z *= -1.0;
|
|
} else if (face == 1.0) {
|
|
direction = direction.xzy;
|
|
direction.z *= -1.0;
|
|
} else if (face == 3.0) {
|
|
direction = direction.zyx;
|
|
direction.x *= -1.0;
|
|
} else if (face == 4.0) {
|
|
direction = direction.xzy;
|
|
direction.y *= -1.0;
|
|
} else if (face == 5.0) {
|
|
direction.xz *= -1.0;
|
|
}
|
|
return direction;
|
|
}
|
|
void main() {
|
|
vOutputDirection = getDirection(uv, faceIndex);
|
|
gl_Position = vec4( position, 1.0 );
|
|
}
|
|
`,fragmentShader:`
|
|
precision mediump float;
|
|
precision mediump int;
|
|
varying vec3 vOutputDirection;
|
|
uniform sampler2D envMap;
|
|
uniform vec2 texelSize;
|
|
|
|
|
|
uniform int inputEncoding;
|
|
uniform int outputEncoding;
|
|
|
|
#include <encodings_pars_fragment>
|
|
|
|
vec4 inputTexelToLinear(vec4 value){
|
|
if(inputEncoding == 0){
|
|
return value;
|
|
}else if(inputEncoding == 1){
|
|
return sRGBToLinear(value);
|
|
}else if(inputEncoding == 2){
|
|
return RGBEToLinear(value);
|
|
}else if(inputEncoding == 3){
|
|
return RGBMToLinear(value, 7.0);
|
|
}else if(inputEncoding == 4){
|
|
return RGBMToLinear(value, 16.0);
|
|
}else if(inputEncoding == 5){
|
|
return RGBDToLinear(value, 256.0);
|
|
}else{
|
|
return GammaToLinear(value, 2.2);
|
|
}
|
|
}
|
|
|
|
vec4 linearToOutputTexel(vec4 value){
|
|
if(outputEncoding == 0){
|
|
return value;
|
|
}else if(outputEncoding == 1){
|
|
return LinearTosRGB(value);
|
|
}else if(outputEncoding == 2){
|
|
return LinearToRGBE(value);
|
|
}else if(outputEncoding == 3){
|
|
return LinearToRGBM(value, 7.0);
|
|
}else if(outputEncoding == 4){
|
|
return LinearToRGBM(value, 16.0);
|
|
}else if(outputEncoding == 5){
|
|
return LinearToRGBD(value, 256.0);
|
|
}else{
|
|
return LinearToGamma(value, 2.2);
|
|
}
|
|
}
|
|
|
|
vec4 envMapTexelToLinear(vec4 color) {
|
|
return inputTexelToLinear(color);
|
|
}
|
|
|
|
|
|
#define RECIPROCAL_PI 0.31830988618
|
|
#define RECIPROCAL_PI2 0.15915494
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(0.0);
|
|
vec3 outputDirection = normalize(vOutputDirection);
|
|
vec2 uv;
|
|
uv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;
|
|
uv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;
|
|
vec2 f = fract(uv / texelSize - 0.5);
|
|
uv -= f * texelSize;
|
|
vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;
|
|
uv.x += texelSize.x;
|
|
vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;
|
|
uv.y += texelSize.y;
|
|
vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;
|
|
uv.x -= texelSize.x;
|
|
vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;
|
|
vec3 tm = mix(tl, tr, f.x);
|
|
vec3 bm = mix(bl, br, f.x);
|
|
gl_FragColor.rgb = mix(tm, bm, f.y);
|
|
gl_FragColor = linearToOutputTexel(gl_FragColor);
|
|
}
|
|
`,blending:T,depthTest:!1,depthWrite:!1});return e.type="EquirectangularToCubeUV",e}function wf(){var e=new ks({uniforms:{envMap:{value:null},inputEncoding:{value:Ua[Ke]},outputEncoding:{value:Ua[Ke]}},vertexShader:`
|
|
precision mediump float;
|
|
precision mediump int;
|
|
attribute vec3 position;
|
|
attribute vec2 uv;
|
|
attribute float faceIndex;
|
|
varying vec3 vOutputDirection;
|
|
vec3 getDirection(vec2 uv, float face) {
|
|
uv = 2.0 * uv - 1.0;
|
|
vec3 direction = vec3(uv, 1.0);
|
|
if (face == 0.0) {
|
|
direction = direction.zyx;
|
|
direction.z *= -1.0;
|
|
} else if (face == 1.0) {
|
|
direction = direction.xzy;
|
|
direction.z *= -1.0;
|
|
} else if (face == 3.0) {
|
|
direction = direction.zyx;
|
|
direction.x *= -1.0;
|
|
} else if (face == 4.0) {
|
|
direction = direction.xzy;
|
|
direction.y *= -1.0;
|
|
} else if (face == 5.0) {
|
|
direction.xz *= -1.0;
|
|
}
|
|
return direction;
|
|
}
|
|
void main() {
|
|
vOutputDirection = getDirection(uv, faceIndex);
|
|
gl_Position = vec4( position, 1.0 );
|
|
}
|
|
`,fragmentShader:`
|
|
precision mediump float;
|
|
precision mediump int;
|
|
varying vec3 vOutputDirection;
|
|
uniform samplerCube envMap;
|
|
|
|
|
|
uniform int inputEncoding;
|
|
uniform int outputEncoding;
|
|
|
|
#include <encodings_pars_fragment>
|
|
|
|
vec4 inputTexelToLinear(vec4 value){
|
|
if(inputEncoding == 0){
|
|
return value;
|
|
}else if(inputEncoding == 1){
|
|
return sRGBToLinear(value);
|
|
}else if(inputEncoding == 2){
|
|
return RGBEToLinear(value);
|
|
}else if(inputEncoding == 3){
|
|
return RGBMToLinear(value, 7.0);
|
|
}else if(inputEncoding == 4){
|
|
return RGBMToLinear(value, 16.0);
|
|
}else if(inputEncoding == 5){
|
|
return RGBDToLinear(value, 256.0);
|
|
}else{
|
|
return GammaToLinear(value, 2.2);
|
|
}
|
|
}
|
|
|
|
vec4 linearToOutputTexel(vec4 value){
|
|
if(outputEncoding == 0){
|
|
return value;
|
|
}else if(outputEncoding == 1){
|
|
return LinearTosRGB(value);
|
|
}else if(outputEncoding == 2){
|
|
return LinearToRGBE(value);
|
|
}else if(outputEncoding == 3){
|
|
return LinearToRGBM(value, 7.0);
|
|
}else if(outputEncoding == 4){
|
|
return LinearToRGBM(value, 16.0);
|
|
}else if(outputEncoding == 5){
|
|
return LinearToRGBD(value, 256.0);
|
|
}else{
|
|
return LinearToGamma(value, 2.2);
|
|
}
|
|
}
|
|
|
|
vec4 envMapTexelToLinear(vec4 color) {
|
|
return inputTexelToLinear(color);
|
|
}
|
|
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(0.0);
|
|
gl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;
|
|
gl_FragColor = linearToOutputTexel(gl_FragColor);
|
|
}
|
|
`,blending:T,depthTest:!1,depthWrite:!1});return e.type="CubemapToCubeUV",e}function bf(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Nn.call(this,e),this.type="catmullrom",this.closed=!0}function Mf(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Nn.call(this,e),this.type="catmullrom"}function kp(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Nn.call(this,e),this.type="catmullrom"}Rp.prototype={constructor:Rp,fromScene:function(e,t,n,i){t===void 0&&(t=0),n===void 0&&(n=.1),i===void 0&&(i=100),Pp=Ci.getRenderTarget();var l=pf();return function(d,m,x,L){var j=new Ni(90,1,m,x),Z=[1,1,1,1,-1,1],ee=[1,1,-1,-1,-1,1],ie=Ci.outputEncoding,z=Ci.toneMapping,he=Ci.toneMappingExposure,me=Ci.getClearColor(),ye=Ci.getClearAlpha();Ci.toneMapping=st,Ci.toneMappingExposure=1,Ci.outputEncoding=Ke,d.scale.z*=-1;var Ae=d.background;if(Ae&&Ae.isColor){Ae.convertSRGBToLinear();var Le=Math.max(Ae.r,Ae.g,Ae.b),Ge=Math.min(Math.max(Math.ceil(Math.log2(Le)),-128),127);Ae=Ae.multiplyScalar(Math.pow(2,-Ge));var et=(Ge+128)/255;Ci.setClearColor(Ae,et),d.background=null}for(var Fe=0;Fe<6;Fe++){var at=Fe%3;at==0?(j.up.set(0,Z[Fe],0),j.lookAt(ee[Fe],0,0)):at==1?(j.up.set(0,0,Z[Fe]),j.lookAt(0,ee[Fe],0)):(j.up.set(0,Z[Fe],0),j.lookAt(0,0,ee[Fe])),Ip(L,at*Vs,2<Fe?Vs:0,Vs,Vs),Ci.setRenderTarget(L),Ci.render(d,j)}Ci.toneMapping=z,Ci.toneMappingExposure=he,Ci.outputEncoding=ie,Ci.setClearColor(me,ye),d.scale.z*=-1}(e,n,i,l),0<t&&yf(l,0,0,t),gf(l),ff(l),l},fromEquirectangular:function(e){return e.magFilter=dt,e.minFilter=dt,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){Pp=Ci.getRenderTarget();var t=pf(e);return function(n,i){var l=new Hn;n.isCubeTexture?tu==null&&(tu=wf()):eu==null&&(eu=xf());var d=n.isCubeTexture?tu:eu;l.add(new Ti(Bh[0],d));var m=d.uniforms;(m.envMap.value=n).isCubeTexture||m.texelSize.value.set(1/n.image.width,1/n.image.height),m.inputEncoding.value=Ua[n.encoding],m.outputEncoding.value=Ua[n.encoding],Ip(i,0,0,3*Vs,2*Vs),Ci.setRenderTarget(i),Ci.render(l,Ap)}(e,t),gf(t),ff(t),t},compileCubemapShader:function(){tu==null&&Lp(tu=wf())},compileEquirectangularShader:function(){eu==null&&Lp(eu=xf())},dispose:function(){Gd.dispose(),tu!=null&&tu.dispose(),eu!=null&&eu.dispose();for(var e=0;e<Bh.length;e++)Bh[e].dispose()}},gt.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(gt.prototype),(e.prototype.constructor=e).prototype.getPoint=t,e},Object.assign(va.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new lr,n=0,i=e.length;n<i;n++){var l=e[n];t.vertices.push(new Re(l.x,l.y,l.z||0))}return t}}),Object.assign(xa.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),bf.prototype=Object.create(Nn.prototype),Mf.prototype=Object.create(Nn.prototype),kp.prototype=Object.create(Nn.prototype),Object.assign(kp.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.")}}),kd.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Rd.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(s.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),tp.extractUrlBase(e)}}),s.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(Td.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(wp.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Ki.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Qs.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},bp.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(yr,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),yr.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),yr.ceilPowerOfTwo(e)}}),Object.assign(Ai.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(fr.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new Re().setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.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(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,i,l,d){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,i,n,l,d)}}),ia.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Gi.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(Pr.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(ki.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(ki,{barycoordFromPoint:function(e,t,n,i,l){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),ki.getBarycoord(e,t,n,i,l)},normal:function(e,t,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),ki.getNormal(e,t,n,i)}}),Object.assign(Qa.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new hl(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new $l(this,e)}}),Object.assign(zt.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Re.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(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Jr.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(lr.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(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(Pt.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Pt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},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(Ti.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(Ti.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(_c.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Au.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Tc.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(gt.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Ni.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),t!==void 0&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Ur.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Qt.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===Ma},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Ma)}}}),Object.assign(Qt.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(e===!0?Ma:Wr),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(Cn.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?e==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Qt(t,arguments[2])))},addDrawCall:function(e,t,n){n!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},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(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Cn.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(Zo.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===Ma},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(Zo.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(e===!0?Ma:Wr),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Ls.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(Ed.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(It.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 Qe}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===1}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(js.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(Ya.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(Du.prototype,{clearTarget:function(e,t,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,i)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},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(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},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(Du.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},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(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=e===!0?vt:Ke}}}),Object.defineProperties(Oh.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(Zi.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(Qu.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return new Sd().load(e,function(n){t.setBuffer(n)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),pp.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Ys.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};var Vf={merge:function(e,t,n){var i;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),i=t.matrix,t=t.geometry),e.merge(t,i,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};zo.crossOrigin=void 0,zo.loadTexture=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var l=new wt;l.setCrossOrigin(this.crossOrigin);var d=l.load(e,n,void 0,i);return t&&(d.mapping=t),d},zo.loadTextureCube=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var l=new it;l.setCrossOrigin(this.crossOrigin);var d=l.load(e,n,void 0,i);return t&&(d.mapping=t),d},zo.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},zo.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Ff={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")}};typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"113"}})),h.ACESFilmicToneMapping=He,h.AddEquation=C,h.AddOperation=De,h.AdditiveBlending=Y,h.AlphaFormat=Tr,h.AlwaysDepth=q,h.AlwaysStencilFunc=zs,h.AmbientLight=vd,h.AmbientLightProbe=cp,h.AnimationClip=To,h.AnimationLoader=ae,h.AnimationMixer=yp,h.AnimationObjectGroup=Wp,h.AnimationUtils=Oi,h.ArcCurve=Kt,h.ArrayCamera=mc,h.ArrowHelper=Qc,h.Audio=Qu,h.AudioAnalyser=pp,h.AudioContext=sp,h.AudioListener=hp,h.AudioLoader=Sd,h.AxesHelper=Bd,h.AxisHelper=function(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Bd(e)},h.BackSide=M,h.BasicDepthPacking=oo,h.BasicShadowMap=0,h.BinaryTextureLoader=function(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Oe(e)},h.Bone=Lh,h.BooleanKeyframeTrack=Zu,h.BoundingBoxHelper=function(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new $c(e,t)},h.Box2=wp,h.Box3=Ki,h.Box3Helper=Sp,h.BoxBufferGeometry=cc,h.BoxGeometry=sh,h.BoxHelper=$c,h.BufferAttribute=Qt,h.BufferGeometry=Cn,h.BufferGeometryLoader=_d,h.ByteType=Br,h.Cache=yl,h.Camera=Lo,h.CameraHelper=Cp,h.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},h.CanvasTexture=Ac,h.CatmullRomCurve3=Nn,h.CineonToneMapping=Ot,h.CircleBufferGeometry=Gc,h.CircleGeometry=qu,h.ClampToEdgeWrapping=On,h.Clock=up,h.ClosedSplineCurve3=bf,h.Color=Qe,h.ColorKeyframeTrack=Ku,h.CompressedTexture=Vu,h.CompressedTextureLoader=pe,h.ConeBufferGeometry=Ju,h.ConeGeometry=Wu,h.CubeCamera=Ys,h.CubeGeometry=sh,h.CubeReflectionMapping=Vt,h.CubeRefractionMapping=jt,h.CubeTexture=Ds,h.CubeTextureLoader=it,h.CubeUVReflectionMapping=yt,h.CubeUVRefractionMapping=Ue,h.CubicBezierCurve=Ar,h.CubicBezierCurve3=Vn,h.CubicInterpolant=Xu,h.CullFaceBack=D,h.CullFaceFront=U,h.CullFaceFrontBack=3,h.CullFaceNone=b,h.Curve=gt,h.CurvePath=va,h.CustomBlending=G,h.CylinderBufferGeometry=Is,h.CylinderGeometry=pl,h.Cylindrical=Zp,h.DataTexture=Rl,h.DataTexture2DArray=gu,h.DataTexture3D=Na,h.DataTextureLoader=Oe,h.DecrementStencilOp=7683,h.DecrementWrapStencilOp=34056,h.DefaultLoadingManager=yd,h.DepthFormat=or,h.DepthStencilFormat=ni,h.DepthTexture=Fu,h.DirectionalLight=Ml,h.DirectionalLightHelper=Nd,h.DirectionalLightShadow=bl,h.DiscreteInterpolant=Yu,h.DodecahedronBufferGeometry=fo,h.DodecahedronGeometry=Jl,h.DoubleSide=N,h.DstAlphaFactor=ne,h.DstColorFactor=be,h.DynamicBufferAttribute=function(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Qt(e,t).setUsage(Ma)},h.DynamicCopyUsage=35050,h.DynamicDrawUsage=Ma,h.DynamicReadUsage=35049,h.EdgesGeometry=Ql,h.EdgesHelper=function(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new fi(new Ql(e.geometry),new Vi({color:t!==void 0?t:16777215}))},h.EllipseCurve=Nt,h.EqualDepth=le,h.EqualStencilFunc=514,h.EquirectangularReflectionMapping=Ln,h.EquirectangularRefractionMapping=nn,h.Euler=y,h.EventDispatcher=ka,h.ExtrudeBufferGeometry=Ls,h.ExtrudeGeometry=hl,h.Face3=gn,h.Face4=function(e,t,n,i,l,d,m){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new gn(e,t,n,l,d,m)},h.FaceColors=1,h.FileLoader=P,h.FlatShading=1,h.Float32Attribute=function(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new an(e,t)},h.Float32BufferAttribute=an,h.Float64Attribute=function(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Cr(e,t)},h.Float64BufferAttribute=Cr,h.FloatType=Mt,h.Fog=Yo,h.FogExp2=po,h.Font=ap,h.FontLoader=op,h.FrontFaceDirectionCCW=1,h.FrontFaceDirectionCW=0,h.FrontSide=A,h.Frustum=Qs,h.GammaEncoding=Ft,h.Geometry=lr,h.GeometryUtils=Vf,h.GreaterDepth=Ye,h.GreaterEqualDepth=Pe,h.GreaterEqualStencilFunc=518,h.GreaterStencilFunc=516,h.GridHelper=kd,h.Group=il,h.HalfFloatType=rn,h.HemisphereLight=qc,h.HemisphereLightHelper=Id,h.HemisphereLightProbe=lp,h.IcosahedronBufferGeometry=Lc,h.IcosahedronGeometry=Io,h.ImageBitmapLoader=rp,h.ImageLoader=Xe,h.ImageUtils=zo,h.ImmediateRenderObject=Mp,h.IncrementStencilOp=7682,h.IncrementWrapStencilOp=34055,h.InstancedBufferAttribute=Md,h.InstancedBufferGeometry=bd,h.InstancedInterleavedBuffer=vp,h.InstancedMesh=Ou,h.Int16Attribute=function(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Mi(e,t)},h.Int16BufferAttribute=Mi,h.Int32Attribute=function(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new we(e,t)},h.Int32BufferAttribute=we,h.Int8Attribute=function(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Rr(e,t)},h.Int8BufferAttribute=Rr,h.IntType=ut,h.InterleavedBuffer=Zo,h.InterleavedBufferAttribute=yc,h.Interpolant=za,h.InterpolateDiscrete=jr,h.InterpolateLinear=Q,h.InterpolateSmooth=2302,h.InvertStencilOp=5386,h.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},h.KeepStencilOp=so,h.KeyframeTrack=ga,h.LOD=_c,h.LatheBufferGeometry=Kl,h.LatheGeometry=Bc,h.Layers=E,h.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")},h.LessDepth=ge,h.LessEqualDepth=oe,h.LessEqualStencilFunc=515,h.LessStencilFunc=513,h.Light=Ur,h.LightProbe=ps,h.LightShadow=jo,h.Line=La,h.Line3=bp,h.LineBasicMaterial=Vi,h.LineCurve=zn,h.LineCurve3=ui,h.LineDashedMaterial=Wc,h.LineLoop=Dc,h.LinePieces=1,h.LineSegments=fi,h.LineStrip=0,h.LinearEncoding=Ke,h.LinearFilter=xn,h.LinearInterpolant=Jc,h.LinearMipMapLinearFilter=1008,h.LinearMipMapNearestFilter=1007,h.LinearMipmapLinearFilter=Yn,h.LinearMipmapNearestFilter=$t,h.LinearToneMapping=st,h.Loader=s,h.LoaderUtils=tp,h.LoadingManager=Fh,h.LogLuvEncoding=In,h.LoopOnce=2200,h.LoopPingPong=2202,h.LoopRepeat=2201,h.LuminanceAlphaFormat=Di,h.LuminanceFormat=ba,h.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},h.Material=It,h.MaterialLoader=wd,h.Math=yr,h.MathUtils=yr,h.Matrix3=Ai,h.Matrix4=fr,h.MaxEquation=c,h.Mesh=Ti,h.MeshBasicMaterial=_r,h.MeshDepthMaterial=Xo,h.MeshDistanceMaterial=rl,h.MeshFaceMaterial=function(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e},h.MeshLambertMaterial=ma,h.MeshMatcapMaterial=ml,h.MeshNormalMaterial=Hc,h.MeshPhongMaterial=js,h.MeshPhysicalMaterial=zc,h.MeshStandardMaterial=ds,h.MeshToonMaterial=Uc,h.MinEquation=u,h.MirroredRepeatWrapping=Xn,h.MixOperation=xe,h.MultiMaterial=function(e){return e===void 0&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,(e.materials=e).clone=function(){return e.slice()},e},h.MultiplyBlending=S,h.MultiplyOperation=se,h.NearestFilter=dt,h.NearestMipMapLinearFilter=1005,h.NearestMipMapNearestFilter=1004,h.NearestMipmapLinearFilter=Xt,h.NearestMipmapNearestFilter=lt,h.NeverDepth=Be,h.NeverStencilFunc=512,h.NoBlending=T,h.NoColors=F,h.NoToneMapping=tt,h.NormalBlending=_,h.NotEqualDepth=ze,h.NotEqualStencilFunc=517,h.NumberKeyframeTrack=Ns,h.Object3D=Pt,h.ObjectLoader=Td,h.ObjectSpaceNormalMap=Do,h.OctahedronBufferGeometry=mi,h.OctahedronGeometry=Ea,h.OneFactor=O,h.OneMinusDstAlphaFactor=ue,h.OneMinusDstColorFactor=je,h.OneMinusSrcAlphaFactor=te,h.OneMinusSrcColorFactor=X,h.OrthographicCamera=wl,h.PCFShadowMap=V,h.PCFSoftShadowMap=I,h.PMREMGenerator=Rp,h.ParametricBufferGeometry=Pc,h.ParametricGeometry=$a,h.Particle=function(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Mc(e)},h.ParticleBasicMaterial=function(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Ko(e)},h.ParticleSystem=function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Ul(e,t)},h.ParticleSystemMaterial=function(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Ko(e)},h.Path=xa,h.PerspectiveCamera=Ni,h.Plane=ia,h.PlaneBufferGeometry=el,h.PlaneGeometry=Ll,h.PlaneHelper=Dp,h.PointCloud=function(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Ul(e,t)},h.PointCloudMaterial=function(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Ko(e)},h.PointLight=xl,h.PointLightHelper=Ld,h.Points=Ul,h.PointsMaterial=Ko,h.PolarGridHelper=Tp,h.PolyhedronBufferGeometry=aa,h.PolyhedronGeometry=Bu,h.PositionalAudio=dp,h.PropertyBinding=eo,h.PropertyMixer=fp,h.QuadraticBezierCurve=ii,h.QuadraticBezierCurve3=Fi,h.Quaternion=Gi,h.QuaternionKeyframeTrack=gl,h.QuaternionLinearInterpolant=ec,h.REVISION="113",h.RGBADepthPacking=Ei,h.RGBAFormat=Gr,h.RGBAIntegerFormat=xo,h.RGBA_ASTC_10x10_Format=is,h.RGBA_ASTC_10x5_Format=Dr,h.RGBA_ASTC_10x6_Format=rs,h.RGBA_ASTC_10x8_Format=xs,h.RGBA_ASTC_12x10_Format=Bo,h.RGBA_ASTC_12x12_Format=Yi,h.RGBA_ASTC_4x4_Format=Gs,h.RGBA_ASTC_5x4_Format=ro,h.RGBA_ASTC_5x5_Format=ys,h.RGBA_ASTC_6x5_Format=Oa,h.RGBA_ASTC_6x6_Format=vs,h.RGBA_ASTC_8x5_Format=io,h.RGBA_ASTC_8x6_Format=ao,h.RGBA_ASTC_8x8_Format=qr,h.RGBA_PVRTC_2BPPV1_Format=Aa,h.RGBA_PVRTC_4BPPV1_Format=Fo,h.RGBA_S3TC_DXT1_Format=ts,h.RGBA_S3TC_DXT3_Format=ms,h.RGBA_S3TC_DXT5_Format=no,h.RGBDEncoding=hi,h.RGBEEncoding=Jt,h.RGBEFormat=wi,h.RGBFormat=ti,h.RGBIntegerFormat=Xi,h.RGBM16Encoding=sr,h.RGBM7Encoding=Gn,h.RGB_ETC1_Format=gs,h.RGB_PVRTC_2BPPV1_Format=la,h.RGB_PVRTC_4BPPV1_Format=ns,h.RGB_S3TC_DXT1_Format=Bs,h.RGFormat=Ri,h.RGIntegerFormat=Zn,h.RawShaderMaterial=ks,h.Ray=Pr,h.Raycaster=qp,h.RectAreaLight=xd,h.RedFormat=H,h.RedIntegerFormat=Nr,h.ReinhardToneMapping=mt,h.RepeatWrapping=Zt,h.ReplaceStencilOp=7681,h.ReverseSubtractEquation=R,h.RingBufferGeometry=Fc,h.RingGeometry=Hu,h.Scene=Hn,h.SceneUtils=Ff,h.ShaderChunk=Er,h.ShaderLib=_o,h.ShaderMaterial=Ya,h.ShadowMaterial=fl,h.Shape=Qa,h.ShapeBufferGeometry=$o,h.ShapeGeometry=$l,h.ShapePath=ip,h.ShapeUtils=hs,h.ShortType=$e,h.Skeleton=Au,h.SkeletonHelper=Rd,h.SkinnedMesh=Tc,h.SmoothShading=2,h.Sphere=Zr,h.SphereBufferGeometry=dl,h.SphereGeometry=Uu,h.Spherical=Yp,h.SphericalHarmonics3=Dd,h.SphericalReflectionMapping=er,h.Spline=kp,h.SplineCurve=Hr,h.SplineCurve3=Mf,h.SpotLight=nc,h.SpotLightHelper=Od,h.SpotLightShadow=vl,h.Sprite=Mc,h.SpriteMaterial=ol,h.SrcAlphaFactor=J,h.SrcAlphaSaturateFactor=ve,h.SrcColorFactor=W,h.StaticCopyUsage=35046,h.StaticDrawUsage=Wr,h.StaticReadUsage=35045,h.StereoCamera=Gp,h.StreamCopyUsage=35042,h.StreamDrawUsage=35040,h.StreamReadUsage=35041,h.StringKeyframeTrack=$u,h.SubtractEquation=B,h.SubtractiveBlending=k,h.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},h.TangentSpaceNormalMap=wo,h.TetrahedronBufferGeometry=Rc,h.TetrahedronGeometry=gr,h.TextBufferGeometry=fa,h.TextGeometry=Ji,h.Texture=Xr,h.TextureLoader=wt,h.TorusBufferGeometry=ql,h.TorusGeometry=kc,h.TorusKnotBufferGeometry=yi,h.TorusKnotGeometry=gi,h.Triangle=ki,h.TriangleFanDrawMode=2,h.TriangleStripDrawMode=1,h.TrianglesDrawMode=0,h.TubeBufferGeometry=Ps,h.TubeGeometry=Ic,h.UVMapping=300,h.Uint16Attribute=function(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new pi(e,t)},h.Uint16BufferAttribute=pi,h.Uint32Attribute=function(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new _i(e,t)},h.Uint32BufferAttribute=_i,h.Uint8Attribute=function(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new tr(e,t)},h.Uint8BufferAttribute=tr,h.Uint8ClampedAttribute=function(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new ci(e,t)},h.Uint8ClampedBufferAttribute=ci,h.Uncharted2ToneMapping=Rt,h.Uniform=Ed,h.UniformsLib=wn,h.UniformsUtils=lh,h.UnsignedByteType=kr,h.UnsignedInt248Type=Mr,h.UnsignedIntType=Ie,h.UnsignedShort4444Type=tn,h.UnsignedShort5551Type=En,h.UnsignedShort565Type=br,h.UnsignedShortType=We,h.VSMShadowMap=g,h.Vector2=zt,h.Vector3=Re,h.Vector4=Jr,h.VectorKeyframeTrack=tc,h.Vertex=function(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Re(e,t,n)},h.VertexColors=2,h.VideoTexture=Wl,h.WebGLCubeRenderTarget=Zs,h.WebGLMultisampleRenderTarget=Us,h.WebGLRenderTarget=Zi,h.WebGLRenderTargetCube=function(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Zs(e,n)},h.WebGLRenderer=Du,h.WebGLUtils=Nl,h.WireframeGeometry=Oc,h.WireframeHelper=function(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new fi(new Oc(e.geometry),new Vi({color:t!==void 0?t:16777215}))},h.WrapAroundEnding=Te,h.XHRLoader=function(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new P(e)},h.ZeroCurvatureEnding=Ce,h.ZeroFactor=f,h.ZeroSlopeEnding=ce,h.ZeroStencilOp=0,h.sRGBEncoding=vt,Object.defineProperty(h,"__esModule",{value:!0})},typeof o=="object"&&r!==void 0?v(o):typeof define=="function"&&define.amd?define(["exports"],v):v((a=a||self).THREE={})},{}],20:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MrxDbgUtils=void 0;var a,v=w("three"),h=w("./Operate/MxEntSelJig"),b=w("./Operate/MxJigCmdManager"),D=w("./UI/MxUiVue"),U=w("./Operate/MrxDbgUiPrPoint"),V=w("./Operate/MrxDbgUiPrBase"),I=w("./MxThreeJS");(a=o.MrxDbgUtils||(o.MrxDbgUtils={})).findEntAtPoint=function(g,A,M,N,F){return M===void 0&&(M=null),N===void 0&&(N=!0),new Promise(function(T){for(var _=g.findMxEntityAtPoint(A,N,F),Y=[],k=_.length,S=0;S<k;S++){var G=_[S];if(!M||!M.type||M.type==G.getTypeName()){var C=G.objectId();Y.push(C)}}T(Y)})},a.selectEnt=function(g,A){return A===void 0&&(A=null),new Promise(function(M){var N=new h.MxEntSelJig;N.disableAllTrace(),N.setDynamicInputType(b.MxJigCmdManager.DynamicInputType.kDynTip),g&&D.MxUiVue.acutPrintf(g),N.filter=A,N.callRet=function(F){M(F)},b.MxJigCmdManager.runCmd(N)})},a.getCorner=function(g,A,M,N,F){return M===void 0&&(M=!1),F===void 0&&(F=!1),new Promise(function(T){var _=new U.MrxDbgUiPrPoint;_.setMessage(A),M?(_.setDynamicInputType(b.MxJigCmdManager.DynamicInputType.kDynTip),_.disableAllTrace()):(_.setDynamicInputType(b.MxJigCmdManager.DynamicInputType.kXYCoordInput),F&&_.disableAllTrace());var Y=new V.McEdGetPointWorldDrawObject;Y.setDraw(function(k,S){var G=new v.Vector3(g.x,k.y,k.z),C=new v.Vector3(k.x,g.y,k.z),B=[];B.push(g),B.push(G),B.push(k),B.push(C),B.push(g);var R=null,u=65280;if(M){if(k.x>g.x)R=I.MxThreeJS.createLines(B,16777215),u=255;else{var c=S.getMcEdJig().getMxObject().viewCoordLong2Cad(3);R=I.MxThreeJS.createDashedLines(B,16777215,2*c,c)}var f=[];f.push(g),f.push(G),f.push(k),f.push(g),f.push(k),f.push(C);var O=I.MxThreeJS.createTriangle(f,u,.27);S.drawEntity(O,30),S.drawEntity(R,31)}else R=I.MxThreeJS.createLines(B,16777215),S.drawEntity(R,31)}),_.setUserDraw(Y),_.go(function(k){N&&N({status:k,detailedResult:_.getDetailedResult()}),k!=0?T(null):(_.clearLastInputPoint(),T(_.value()))})})}},{"./MxThreeJS":37,"./Operate/MrxDbgUiPrBase":45,"./Operate/MrxDbgUiPrPoint":47,"./Operate/MxEntSelJig":50,"./Operate/MxJigCmdManager":54,"./UI/MxUiVue":65,three:19}],21:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxDrawCommands=void 0;var a=w("./MxFun"),v=w("./MxType"),h=w("./Operate/MxIntelliSelect"),b=w("./Operate/MxJigCmdManager");function D(M){M!=null&&M.grips!=null&&M.ids!=null&&a.MxFun.getCurrentMx().getMcObject().getGripManager().gripEditImp(M)}function U(M){if(M!=null&&M.pt!=null){var N=a.MxFun.getCurrentMx(),F=M.pt;if(!N.getMxDatabase().getGripManager().doPointSelect(F)){var T=!0;if(N.isValidMcObject()&&N.getMcObject().getGripManager().doPointSelect(F)&&(T=!1),a.MxFun.isPC()||(T=!1),T&&N.isMultipleSelect){var _=N.screenCoord2Current(F.x,F.y,0),Y=new h.MxIntelliSelectJig(_);Y.setDisableDynInput(!0),Y.setDisableOsnap(!0),b.MxJigCmdManager.runCmd(Y)}}}}function V(M){M!=null&&M.grips!=null&&M.ents!=null&&a.MxFun.getCurrentMx().getMxDatabase().getGripManager().gripEditImp(M)}function I(){a.MxFun.getCurrentMx().getMcObject().undo()}function g(){a.MxFun.getCurrentMx().getMcObject().redo()}function A(){a.MxFun.getCurrentMx().startPanCommand()}(o.MxDrawCommands||(o.MxDrawCommands={})).registerCommand=function(){a.MxFun.addCommand("Mx_FrontEndWebpageIntelliSel",U,v.MxType.MxCommandFlag.MCRX_CMD_TRANSPARENT|v.MxType.MxCommandFlag.MCRX_CMD_NO_UNDO_MARKER|v.MxType.MxCommandFlag.MCRX_CMD_NO_CLEAR_SELECT|v.MxType.MxCommandFlag.MCRX_CMD_NO_RECORD_PRVCMD),a.MxFun.addCommand("Mx_FrontEndWebpageGripEdit",V,v.MxType.MxCommandFlag.MCRX_CMD_TRANSPARENT|v.MxType.MxCommandFlag.MCRX_CMD_NO_UNDO_MARKER|v.MxType.MxCommandFlag.MCRX_CMD_NO_CLEAR_SELECT|v.MxType.MxCommandFlag.MCRX_CMD_NO_RECORD_PRVCMD),a.MxFun.addCommand("McDraw_GripEdit",D,v.MxType.MxCommandFlag.MCRX_CMD_TRANSPARENT|v.MxType.MxCommandFlag.MCRX_CMD_NO_CLEAR_SELECT|v.MxType.MxCommandFlag.MCRX_CMD_NO_RECORD_PRVCMD),a.MxFun.addCommand("Mx_Undo",I,v.MxType.MxCommandFlag.MCRX_CMD_NO_UNDO_MARKER),a.MxFun.addCommand("Mx_Redo",g,v.MxType.MxCommandFlag.MCRX_CMD_NO_UNDO_MARKER),a.MxFun.addCommand("Mx_Pan",A,v.MxType.MxCommandFlag.MCRX_CMD_NO_UNDO_MARKER)}},{"./MxFun":27,"./MxType":39,"./Operate/MxIntelliSelect":52,"./Operate/MxJigCmdManager":54}],22:[function(w,r,o){var a;Object.defineProperty(o,"__esModule",{value:!0}),o.MxDrawData=void 0,(a=o.MxDrawData||(o.MxDrawData={})).m_dInputRectWidth=16,a.m_isEnableIntelliSelect=!0,a.m_isEnableGripEidt=!0,a.m_isEnableCADEntityGripEidt=1,a.m_isForbiddenDynInput=!1,a.m_isMultipleSelect=!1,a.m_isAutoResetRenderer=!1,a.m_isCorrectLargeCoordinates=!0,a.m_isRequestHeaderCacheControl=!1,a.m_gripPointColor=3355443455,a.m_isMapBox=!1,a.m_isEnableDrawingViewAngle=!0,a.m_isEnableCommandRightClickMenu=!1,a.m_isMobileCommandOperationSupportsMultipoint=!0,a.getIniSet=function(){return{EnableIntelliSelect:a.m_isEnableIntelliSelect,EnableGripEidt:a.m_isEnableGripEidt,EnableCADEntityGripEidt:a.m_isEnableCADEntityGripEidt,ForbiddenDynInput:a.m_isForbiddenDynInput,EnableDrawingViewAngle:a.m_isEnableDrawingViewAngle,gripPointColor:a.m_gripPointColor,multipleSelect:a.m_isMultipleSelect,EnableCommandRightClickMenu:a.m_isEnableCommandRightClickMenu}},a.setIniset=function(v){v.EnableIntelliSelect!==void 0&&typeof v.EnableIntelliSelect=="boolean"&&(a.m_isEnableIntelliSelect=v.EnableIntelliSelect),v.EnableGripEidt!==void 0&&typeof v.EnableGripEidt=="boolean"&&(a.m_isEnableGripEidt=v.EnableGripEidt),v.EnableGripEdit!==void 0&&typeof v.EnableGripEdit=="boolean"&&(a.m_isEnableGripEidt=v.EnableGripEdit),v.EnableCADEntityGripEidt!==void 0&&typeof v.EnableCADEntityGripEidt=="number"&&(a.m_isEnableCADEntityGripEidt=v.EnableCADEntityGripEidt),v.EnableCADEntityGripEdit!==void 0&&typeof v.EnableCADEntityGripEdit=="number"&&(a.m_isEnableCADEntityGripEidt=v.EnableCADEntityGripEdit),v.ForbiddenDynInput!==void 0&&typeof v.ForbiddenDynInput=="boolean"&&(a.m_isForbiddenDynInput=v.ForbiddenDynInput),v.multipleSelect!==void 0&&typeof v.multipleSelect=="boolean"&&(a.m_isMultipleSelect=v.multipleSelect),v.autoResetRenderer!==void 0&&typeof v.autoResetRenderer=="boolean"&&(a.m_isAutoResetRenderer=v.autoResetRenderer),v.correctLargeCoordinates!==void 0&&typeof v.correctLargeCoordinates=="boolean"&&(a.m_isCorrectLargeCoordinates=v.correctLargeCoordinates),v.requestHeaderCacheControl!==void 0&&typeof v.requestHeaderCacheControl=="boolean"&&(a.m_isRequestHeaderCacheControl=v.requestHeaderCacheControl),v.MapBox!==void 0&&typeof v.MapBox=="boolean"&&(a.m_isMapBox=v.MapBox),v.inputRectWidth!==void 0&&typeof v.inputRectWidth=="number"&&(a.m_dInputRectWidth=v.inputRectWidth),v.gripPointColor!==void 0&&typeof v.gripPointColor=="number"&&(a.m_gripPointColor=v.gripPointColor),v.EnableDrawingViewAngle!==void 0&&typeof v.EnableDrawingViewAngle=="boolean"&&(a.m_isEnableDrawingViewAngle=v.EnableDrawingViewAngle),v.EnableCommandRightClickMenu!==void 0&&typeof v.EnableCommandRightClickMenu=="boolean"&&(a.m_isEnableCommandRightClickMenu=v.EnableCommandRightClickMenu),v.MobileCommandOperationSupportsMultipoint!==void 0&&typeof v.MobileCommandOperationSupportsMultipoint=="boolean"&&(a.m_isMobileCommandOperationSupportsMultipoint=v.MobileCommandOperationSupportsMultipoint)}},{}],23:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxDrawObject=o.IniSetName=o.MxRunMode=void 0;var a,v,h,b=w("three"),D=w("./MxFun"),U=w("./View/MxBrowseLayerData"),V=w("./View/MxBrowseDisplay"),I=w("./MxNetData"),g=w("./MxNetData"),A=w("./MxManager"),M=w("./MxSystemVariable"),N=w("./MxLocalFileLoad"),F=w("./Operate/MxDrawObjectOsnap"),T=w("./View/MxDbDatabase"),_=w("./View/MxDrawMapBox"),Y=w("./MxDrawObjectEvent"),k=w("./View/MxDbEntityGrip"),S=w("./cpp/McDrawObject"),G=w("./UI/MxUiVue"),C=w("./MxDrawData"),B=w("./MxTempMarkDraw");(v=a=o.MxRunMode||(o.MxRunMode={}))[v.kBrowse=1]="kBrowse",v[v.kCPPMxCAD=4]="kCPPMxCAD",(h=o.IniSetName||(o.IniSetName={})).kEnableOsnapFunction="EnableOsnapFunction";var R=(u.prototype.getCurrentMousePostion=function(){return this.curMousePostion},u.prototype.isValidCurMousePostion=function(){return this.m_isValidCurMousePostion},u.prototype.setCurrentMousePostion=function(c,f){if(f===void 0&&(f=!1),f){if(0<c.touches.length){var O=c.target.getBoundingClientRect();this.curMousePostion.x=c.touches[0].clientX-O.left,this.curMousePostion.y=c.touches[0].clientY-O.top,this.m_isValidCurMousePostion=!0}}else this.curMousePostion.x=c.offsetX,this.curMousePostion.y=c.offsetY,this.m_isValidCurMousePostion=!0},u.prototype.mapBoxRender=function(c,f,O){this.mcObject.updateDisplayMapBox(f),O||(this.camera.projectionMatrix=f,this.renderer.autoClear=!1,this.renderer.state.reset(),this.secenView&&this.renderer.render(this.secenView,this.cameraView),this.renderer.render(this.scene,this.camera),this._callCreateCanvasImageData!=null&&(this._callCreateCanvasImageData(this.renderer.domElement.toDataURL("image/png")),this._callCreateCanvasImageData=void 0)),this.callEvent("render",this.renderer)},u.prototype.mapBoxInitThreeJSObject=function(c,f,O,W){this.scene=c,this.camera=f,this.renderer=O,this.controls=W},u.prototype.getMxDrawThreeJs=function(){return this.mxdrawThreeJS},u.prototype.setPointMultipleSelect=function(c){this.isPointMultipleSelect=c},u.prototype.pointMultipleSelect=function(){return this.isPointMultipleSelect},u.prototype.getMcObject=function(){return this.mcObject},u.prototype.is3DMode=function(){return this.mcObject.mxdraw3d.is3DMode()},u.prototype.getSysVarLong=function(c){return this.mcObject.isValid()?this.mcObject.getSysVarLong(c):this.m_sysVariable.getSysVarNumber(c)},u.prototype.getSysVarDouble=function(c){return this.mcObject.isValid()?this.mcObject.getSysVarDouble(c):this.m_sysVariable.getSysVarNumber(c)},u.prototype.getSysVarPoint=function(c){return this.mcObject.isValid()?this.mcObject.getSysVarPoint(c):this.m_sysVariable.getSysVarPoint(c)},u.prototype.getCAD2DocMatrix=function(){return this._cad2Doc},u.prototype.isValidMcObject=function(){return this.mcObject.isValid()},u.prototype.getId=function(){return this.id},u.prototype.getEventManager=function(){return this.eventManager},u.prototype.setCurrentLoadUrl=function(c){this._sCurrentLoadURL=c},u.prototype.getCurrentLoadUrl=function(){return this._sCurrentLoadURL},u.prototype.isWebgl2=function(){return!(!this._rendererParam||this._rendererParam.retver!="webgl2")},u.prototype.getMxDatabase=function(){return this.m_mxDatabase},u.prototype.updateCanvasSize=function(){this._onResizeFun&&this._onResizeFun(void 0,!1)},u.prototype.addMxEntity=function(c){return this.m_mxDatabase.addMxEntity(c)},u.prototype.getMxEntity=function(c){return this.m_mxDatabase.getEntity(c)},u.prototype.getMxEntityUserObject=function(c){var f=this.getMxEntity(c);return f?f.getUserObject():null},u.prototype.eraseAllMxEntity=function(){this.m_mxDatabase.eraseAllEntity()},u.prototype.eraseMxEntity=function(c){var f=this.m_mxDatabase.getEntity(c);return!!f&&f.erase()},u.prototype.getAllMxEntity=function(){var c=[];return this.m_mxDatabase.getAllEntity().forEach(function(f){f&&c.push(f.getUserObject())}),c},u.prototype.getMxAllSelect=function(){var c=this.m_mxDatabase.getSelectManager().getAllSelect(),f=this.m_mxDatabase.getGripManager().getAllSelect(),O=new Set;return c.forEach(function(W){O.add(W)}),f.forEach(function(W){O.has(W)||c.push(W)}),c},u.prototype.getPrvCommandSelect=function(){return this.m_mxDatabase.getSelectManager().getPrvCommandSelect()},u.prototype.getMxCADAllSelect=function(){return this.mcObject.isValid()?this.mcObject.getGripManager().getAllSelect():[]},u.prototype.getSelectPoints=function(){return this.mcObject.getGripManager().getSelectPoints()},u.prototype.getPrvCommandMxCADSelect=function(){return this.mcObject.isValid()?this.mcObject.getGripManager().getPrvCommandSelect():[]},u.prototype.addMxCurrentSelect=function(c,f,O){return f===void 0&&(f=!0),O===void 0&&(O=!0),this.m_mxDatabase.getGripManager().addSelect(c,f,O)},u.prototype.addMxCADCurrentSelect=function(c,f,O){return f===void 0&&(f=!0),O===void 0&&(O=!0),!!this.mcObject.isValid()&&this.mcObject.getGripManager().addSelect(c,f,O)},u.prototype.fireSelectChange=function(c){if(c){if(this.mcObject.isValid())return this.mcObject.getGripManager().fireSelectChange()}else this.m_mxDatabase.getGripManager().fireMxEntitySelectChange()},u.prototype.clearMxCurrentSelect=function(){var c=this.m_mxDatabase.clearMxCurrentSelect();return this.mcObject.isValid()&&this.mcObject.getGripManager().clearAll(),c},u.prototype.addViewObject=function(c){this.secenView?this.threejsselectObjectsView.add(c):console.log("this.secenView is null")},u.prototype.removeViewObject=function(c){D.MxFun.removeThreejsObject(c,this.threejsselectObjectsView)},u.prototype.setOtherRefFile=function(c){this._tzDwgStaticFile=c},u.prototype.setRequestHeader=function(c){this._requestHeader=c},u.prototype.initZoomW=function(c,f){this._initZoomwCoordPt1=c.clone(),this._initZoomWCoordPt2=f.clone()},u.prototype.setMouseRightRotate=function(c){this._mouseRightRotate=c,this.controls!=null&&(this.controls.mouseButtons.RIGHT=c?b.MOUSE.ROTATE:-1)},u.prototype.setZoomSpeed=function(c){var f=this.controls.zoomSpeed;return this.controls.zoomSpeed=c,f},u.prototype.resetRenderer=function(){this.renderer.info.reset()},u.prototype.getRenderer=function(){return this.renderer},u.prototype.isPaningCommand_call=function(){return this.bakControls!=null},u.prototype.startPanCommand_call=function(){this.bakControls={},this.bakControls.LEFT=this.controls.mouseButtons.LEFT,this.bakControls.RIGHT=this.controls.mouseButtons.RIGHT,this.bakControls.MIDDLE=this.controls.mouseButtons.MIDDLE,this.controls.mouseButtons.LEFT=b.MOUSE.PAN,this._mouseRightRotate?this.controls.mouseButtons.RIGHT=b.MOUSE.ROTATE:this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=1,G.MxUiVue.setCursorType(G.MxUiVue.CursorType.kPan)},u.prototype.endPanCommand_call=function(){this.bakControls&&(this.controls.mouseButtons.LEFT=this.bakControls.LEFT,this.controls.mouseButtons.RIGHT=this.bakControls.RIGHT,this.controls.mouseButtons.MIDDLE=this.bakControls.MIDDLE,this.bakControls=void 0,G.MxUiVue.setCursorType(G.MxUiVue.CursorType.kNormal))},u.prototype.isPaningCommand=function(){return this.mxdrawThreeJS.isPaningCommand()},u.prototype.startPanCommand=function(){this.mxdrawThreeJS.startPanCommand()},u.prototype.endPanCommand=function(){this.mxdrawThreeJS.endPanCommand()},u.prototype.setMouseMiddlePan=function(c){this._isMouseMiddlePan=typeof c=="boolean"?c?1:0:c,this.controls!=null&&(this._isMouseMiddlePan==1?(this.controls.mouseButtons.LEFT=-1,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=b.MOUSE.PAN):this._isMouseMiddlePan==2?(this.controls.mouseButtons.LEFT=b.MOUSE.PAN,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=b.MOUSE.PAN):(this.controls.mouseButtons.LEFT=b.MOUSE.PAN,this._mouseRightRotate?this.controls.mouseButtons.RIGHT=b.MOUSE.ROTATE:this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=1))},u.prototype.resetThreeJSControls=function(){this.controls&&(this.controls.saveState(),this.controls.reset())},u.prototype.enableZoom=function(c){this.controls!=null&&(this.controls.enableZoom=c)},u.prototype.enablePan=function(c){this.controls!=null&&(this.controls.enablePan=c)},u.prototype.getOrbitControls=function(){return this.controls},u.prototype.enableViewControls=function(c){this.controls.enabled=c},u.prototype.initRunMode=function(c){this._isCreate?console.log("iniRunMode failed,mxobject already created"):this._runMode=c},u.prototype.getRunMode=function(){return this._runMode},u.prototype.setStaticLocalLoad=function(c){this._isStaticLocalLoad=c},u.prototype.isStaticLocalLoad=function(){return this._isStaticLocalLoad},u.prototype.setStaticLocalLoadPath=function(c){this._staticLocalLoadPath=c},u.prototype.on=function(c,f){if(this._event[c])if(this._event[c]instanceof Array){var O=this._event[c];O.includes(f)||O.push(f)}else{var W=this._event[c];if(W==f)return;this._event[c]=[],this._event[c].push(W),this._event[c].push(f)}else this._event[c]=f},u.prototype.addEvent=function(c,f){this.on(c,f)},u.prototype.addControlsEvent=function(c,f,O){return O===void 0&&(O=!1),this.eventManager.addEventListener(c,f,O)},u.prototype.removeEvent=function(c){this._event[c]=void 0},u.prototype.removeEventFuction=function(c,f){if(this._event[c]){if(this._event[c]instanceof Array){var O=this._event[c].indexOf(f);if(O!=-1)return this._event[c].splice(O,1),this._event[c].length==0&&delete this._event[c],!0}else if(this._event[c]==f)return delete this._event[c],!0}return!1},u.prototype.sysVariable=function(){return this.m_sysVariable},u.prototype.setIniset=function(c){var f=this;Object.keys(c).forEach(function(O){f.m_iniSet[O]=c[O]}),C.MxDrawData.setIniset(c),c.multipleSelect!==void 0&&typeof c.multipleSelect=="boolean"&&(this.isMultipleSelect=c.multipleSelect)},u.prototype.getInisetValue=function(c){return this.m_iniSet[c]},u.prototype.getViewColor=function(){return this._viewcolor},u.prototype.isWhiteViewColor=function(){return!!this.mcObject.isPaperSpaceDisplay()||this._viewcolor==16777215},u.prototype.initUserLoginData=function(c,f){this._userIdentitySign=c,this._userRandomToken=f},u.prototype.initRendererParam=function(c){this._rendererParam=c},u.prototype.getRendererParam=function(){return this._rendererParam},u.prototype.automaticInversionColor=function(c){return this._viewcolor!=16777215||c!=16777215?c:0},u.prototype.automaticInversionColor2=function(c){return this._viewcolor==16777215&&(16777215&c)==16777215?4278190080&c:c},u.prototype.setViewColor=function(c){this._viewcolor=c,this._runMode!=a.kCPPMxCAD&&this.scene!=null&&(this.scene.background=new b.Color(c))},u.prototype.zoomScale=function(c,f){this.mxdrawThreeJS.zoomScale(c,f)},u.prototype.setViewAngle=function(c){this.mxdrawThreeJS.setViewAngle(c)},u.prototype.zoomW=function(c,f,O,W,X){X===void 0&&(X=!1),this.mxdrawThreeJS.zoomW(c,f,O,W,X)},u.prototype.zoomCenter=function(c,f,O){this.mxdrawThreeJS.zoomCenter(c,f,O)},u.prototype.getViewAngle=function(){return this._viewangle},u.prototype.callInitCompleteEvent=function(){this.callEvent("loadComplete")},u.prototype.callInitObjectEvent=function(){this.callEvent("initObject")},u.prototype.callInitSceneEvent=function(c,f,O){var W=this._event.initScene;if(!W)return 0;if(W instanceof Array){var X=0;return W.forEach(function(J){X=J(c,f,O)}),X}return W(c,f,O)},u.prototype.callOpenFileComplete=function(c,f){f===void 0&&(f=0);try{var O=this._event.openFileComplete;if(!O)return;O instanceof Array?O.forEach(function(W){W(c,f)}):O(c,f)}catch(W){throw console.log(W),W}},u.prototype.hasEvent=function(c){return this._event[c]!=null},u.prototype.regenAllMxDbEntity=function(){return this.m_mxDatabase.regenAllMxDbEntity()},u.prototype.callEvent=function(c,f){try{var O=this._event[c];if(!O)return!1;if(O instanceof Array){var W=!1;return O.forEach(function(X){W=X(f)}),W}return O(f)}catch(X){throw console.log(X),X}},u.prototype.callViewChange=function(){this.onViewChange(),this.callEvent("viewchange")},u.prototype.userLoginResult=function(c){this.callEvent("userLoginResult",c)},u.prototype.serverReturn=function(c){var f=JSON.parse(c);this.callEvent("serverReturn",f)},u.prototype.openFileResult=function(c){JSON.parse(c).linkServer||console.log("link mx serverobj error"),this.callEvent("openFileResult",c)},u.prototype.xzSize=function(c){var f=this._devicePixelRatio;if(f-1<=1e-4&&-1e-4<=f-1)return c;for(var O=9999999,W=c,X=0,J=c;X<100;X++){if((ne=(te=J*f)-Math.floor(te))<=.001)return J;ne<O&&(O=ne,W=J),J+=1}for(J=c;X<100;X++){var te,ne;if((ne=(te=J*f)-Math.floor(te))<=.001)return J;ne<O&&(O=ne,W=J),--J}return W},u.prototype.setSize=function(c,f){this._viewWidth=c,this._viewHeight=f,this._userCanvas!=null&&(this._userCanvas.width=c,this._userCanvas.height=f,this._userCanvas.style.width=c+"px",this._userCanvas.style.height=f+"px"),this.onResizeImp(),this.updateDisplay()},u.prototype.getCurrentColor=function(){return this._color},u.prototype.setCurrentColor=function(c){this._color=c},u.prototype.call=function(c,f,O){this._net.getSend().CallServerJS(c,f,O)},u.prototype.zoomAll=function(){this._is2d&&this.call("getDatabaseBoundHelp",'{"isBackground":1}',function(c){if(c.length!=0){var f=JSON.parse(c);this.zoomW(new b.Vector3(f[0],f[1],0),new b.Vector3(f[2],f[3],0))}})},u.prototype.getViewCenterDocCoord=function(){return this._userCanvas!=null?this.screenCoord2Current(.5*this._userCanvas.clientWidth,.5*this._userCanvas.clientHeight,0):this.screenCoord2Current(.5*this._viewWidth,.5*this._viewHeight,0)},u.prototype.closeWebSocket=function(){this._net.closeWebSocket()},u.prototype.findMxEntityAtPoint=function(c,f,O){!f&&f!==void 0||(c=this.currentCoord2Screen(c.x,c.y,0));var W=[],X=this.m_mxDatabase.getIntersectObjects(c);if(X.length==0)return W;var J=new Map;return X.forEach(function(te){var ne=k.MxGetMxDbEntitForThreeJsObject(te.object);if(ne){var ue=ne.objectId();if(!J.has(ue)){if(O){var be=k.MxGetWordDrawxDataForThreeJsObject(te.object);be&&O(ue,be)}J.set(ue,ne.getUserObject())}}}),J.forEach(function(te){W.push(te)}),W},u.prototype.isCppMxCAD=function(){return this._runMode==a.kCPPMxCAD},u.prototype.loadMxCADImage=function(c,f,O){var W=this;O===void 0&&(O=""),this.mcObject.isValid()?(O.length==0&&(O=c).lastIndexOf("/")!=-1&&(O=O.substring(O.lastIndexOf("/")+1).toLowerCase()),this.mcObject.getTextureManager().loadImage(c,O,function(X,J){X?(W.mcObject.getTextureManager().createOpenGLTexture(c),f(J)):f(void 0)})):f(void 0)},u.prototype.onLoad=function(c){if(this._runMode==a.kCPPMxCAD)this.callInitCompleteEvent();else if(this._isStaticLocalLoad)this._net=new g.MxNet,this._net.init(this,!1),0<this._openFile.length&&(this._staticLocalNet=new N.MxLocalDwgFileLoad(this._net),this._staticLocalNet.load(encodeURIComponent(this._staticLocalLoadPath),encodeURIComponent(this._openFile)));else if(this._openFile.length==0)this.callInitCompleteEvent(),this.callOpenFileComplete(0);else if(this._net=new g.MxNet,this._net.init(this,!1),this._staticNet=new g.MxHFileLoad(this._net),this._staticNet.setRequestHeader(this._requestHeader),this._staticNet.setUrlParam(c),this._staticNet.load(this._openFile,this._staticLoadingOpenFiles),this._tzDwgStaticFile&&0<this._tzDwgStaticFile.length){var f=new g.MxNet;f.init(this,!1),this._extRefManager.createTzDwgExternalReferences(99999),f.setCurrentDatabaseId(99999),this._staticLoadTzNet=new g.MxHFileLoad(f),this._staticLoadTzNet.setShowloading(!1),this._staticLoadTzNet.setRequestHeader(this._requestHeader),this._staticLoadTzNet.load(this._tzDwgStaticFile,[])}},u.prototype.stopAllLoading=function(){this._staticNet&&this._staticNet.stopAllLoading()},u.prototype.getStaticNet=function(){return this._staticNet},u.prototype.isStaticFileNet=function(){return!this._isStaticLocalLoad&&this._staticNet!=null},u.prototype.getStaticLocalNet=function(){return this._staticLocalNet},u.prototype.getStaticLoadTzNet=function(){return this._staticLoadTzNet},u.prototype.getViewWidth=function(){return this._userCanvas!=null?this._userCanvas.clientWidth:this._viewWidth},u.prototype.getViewHeight=function(){return this._userCanvas!=null?this._userCanvas.clientHeight:this._viewHeight},u.prototype.makeCurrent=function(){A.MxManager.setCurrentMx(this),this.mcObject.makeCurrent()},u.prototype.createCanvasImageData=function(c,f){var O=0,W=0,X=!1,J=!1,te=!1;f&&f.range_pt1&&f.range_pt2&&(te=J=!0,this.saveZoom()),f&&f.width&&f.height&&(O=this.getViewWidth(),W=this.getViewHeight(),X=!0,this.setSize(f.width,f.height)),te&&this.zoomW(f.range_pt1,f.range_pt2);var ne=this;this._callCreateCanvasImageData=function(ue){X&&ne.setSize(O,W),J&&ne.recoverZoom(),c(ue)},this.updateDisplay()},u.prototype.getIntersectObjects=function(c){return this.getMxDrawThreeJs().createRaycaster(c).intersectObjects(this.threejsselectObjects.children,!0)},u.prototype.addObject=function(c){this.threejsselectObjects.add(c)},u.prototype.removeObject=function(c){this.threejsselectObjects.remove(c)},u.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),this._callCreateCanvasImageData!=null&&(this._callCreateCanvasImageData(this.renderer.domElement.toDataURL("image/png")),this._callCreateCanvasImageData=void 0),this.callEvent("render",this.renderer)},u.prototype.updateDisplay=function(c){c===void 0&&(c=!1),this.mxdrawThreeJS.updateDisplay(c)},u.prototype.isRenderLoop=function(){return this._isAnimation},u.prototype.renderLoop=function(c){c===void 0&&(c=!0),this._isAnimation=c,this.updateDisplay()},u.prototype.updateDisplayImplement=function(c){c===void 0&&(c=!1);var f=this,O=function(){f.m_mxDatabase.upDirtyDisplay(),f._isAnimation?(f._isAnimationStarting=!0,requestAnimationFrame(O)):f._isWaiteCount=0,f.render()};c!==!0?this._isAnimationStarting||(this._isAnimation?requestAnimationFrame(O):((5<this._isWaiteCount||this._isWaiteCount<0)&&(this._isWaiteCount=0),this._isWaiteCount<=0&&requestAnimationFrame(O),this._isWaiteCount++)):O()},u.prototype.gotoLayoutOld=function(c){c=="Modle"&&(c="");var f=this._openFile;for(var O in this._iniParam)(te=(J=this._iniParam[O])[0])=="srcname"&&(f=J[1]);var W={},X="";for(var O in this._iniParam){var J,te;if(W[te=(J=this._iniParam[O])[0]]==null){W[te]=!0;var ne=J[1];if(te=="file"){if(ne=f,0<c.length){var ue=ne.substring(ne.lastIndexOf(".")+1);ne=ne.substring(0,ne.lastIndexOf("."))+"%23"+c+"%23."+ue}}else if(te=="srcname")continue;X.length==0?X=te+"="+ne+"&srcname="+f:X+="&"+te+"="+ne}}var be=D.MxFun.getLocationPageUrl()+"?"+X;window.location.href=be},u.prototype.gotoLayout=function(c){var f=!1,O=!this.isStaticFileNet();for(var W in this._iniParam)if((be=this._iniParam[W])[0]=="dwgdir"){f=!0;break}if(f||O)this.gotoLayoutOld(c);else{c=="Model"&&(c="");var X=this._openFile;if(!X)return;var J=X.lastIndexOf(".dwg");if(J===void 0||J===-1)return;if((X=X.substring(0,J))[X.length-1]=="#"){var te=X.substring(0,X.length-1),ne=te.lastIndexOf("#");ne!==void 0&&ne!==-1&&(X=te.substring(0,ne))}0<c.length?X=X+"#"+c+"#.dwg.mxb1.wgh":X+=".dwg.mxb1.wgh";var ue={};for(var W in this._iniParam){var be,je=(be=this._iniParam[W])[0];if(ue[je]==null){ue[je]=!0;var ve=be[1];je!="file"&&je!="srcname"&&(X+="&"+je+"="+ve)}}var Be=D.MxFun.getLocationPageUrl()+"?file="+X;window.location.href=encodeURI(Be)}},u.prototype.addInitParam=function(c,f){var O=new Array;O.push(c),O.push(f),this._iniParam.push(O)},u.prototype.openFile=function(c,f){if(f===void 0&&(f=""),!this._isCreate)return console.log("mx: openFile Fialed mxasser(_isCreate == false)"),!1;if(this.stopAllLoading(),c.length==0)return!1;this.reInit(),this._devicePixelRatio=window.devicePixelRatio,c instanceof Array?(this._openFile=c[0],this._staticLoadingOpenFiles=c):this._openFile=c,this._openFileExtName=this._openFile.substring(this._openFile.lastIndexOf(".")+1),this._iniParam=[],this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null;var O=new Array;return O.push("file"),O.push(this._openFile),this._iniParam.push(O),this.onLoad(f),!0},u.prototype.updateCameraDisplayRange=function(c,f,O){this.mxdrawThreeJS.updateCameraDisplayRange(c,f,O)},u.prototype.updateCameraForm3dViewData=function(c){this.mxdrawThreeJS.updateCameraForm3dViewData(c)},u.prototype.clearAllObject=function(){this.reInit()},u.prototype.newFile=function(c,f,O,W){if(!this._isCreate)return console.log("mx: openFile Fialed mxasser(_isCreate == false)"),!1;var X,J;if(J=c instanceof Object&&f instanceof Object?(X=c,f):(X=new b.Vector3(c,f,0),new b.Vector3(O,W,0)),X.x>J.x){var te=X.x;X.x=J.x,J.x=te}if(X.y>J.y){var ne=X.y;X.y=J.y,J.y=ne}this.reInit(),this._devicePixelRatio=window.devicePixelRatio,this._openFile="",this._openFileExtName="dwg",this._iniParam=[],this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null;var ue=new b.Matrix4;ue.identity(),this.intiDoc2Wold(ue),this.initCAD2Doc(ue),this.initializingObjectMatrix(),this.mxdrawThreeJS.updateCameraDisplayRange(X,J,0),this.updateDisplay(!0);var be=D.MxFun.getUiObj();be!=null&&(be.SetLayoutData(this._allLayoutName),be.UpDisplayLayout())},u.prototype.calcViewsize=function(){if(this._userCanvas==null)return{viewWidth:window.innerWidth,viewHeight:window.innerHeight};var c=this._userCanvas.clientWidth,f=this._userCanvas.clientHeight;if(this._event.onResize!=null){var O=this._event.onResize;O instanceof Array&&(O=O[0]);var W=O();W!=null&&(c=parseInt(W.width),f=parseInt(W.height))}return{viewWidth:c,viewHeight:f}},u.prototype.initMxCpp=function(c){c&&c.getImp()?(this.mcObject.init(this,c),this.secenView!=null?this.secenView.background=null:this.scene.background=null):console.log("mxerror: mcppObjectImp is null")},u.prototype.create=function(c,f,O,W){if(this._is2d?this.mxdrawThreeJS=W?new _.MxDrawMapBoxThreeJS(W,this):new _.MxDrawObject2dThreeJS(this):this.mxdrawThreeJS=new _.MxDrawObject3dThreeJS(this),this._callCreateCanvasImageData=void 0,this._devicePixelRatio=window.devicePixelRatio,this._runMode==a.kCPPMxCAD)this._openFile="";else{if(f instanceof Array?(this._openFile=f[0],this._staticLoadingOpenFiles=f):this._openFile=f,this._iniParam=D.MxFun.getUrlParams(),this._openFileExtName=this._openFile.substring(this._openFile.lastIndexOf(".")+1),this._openFile!=""){var X=new Array;X.push("file"),X.push(this._openFile),this._iniParam.push(X)}this._userIdentitySign!=""&&(this.addInitParam("userIdentitySign",this._userIdentitySign),this.addInitParam("userRandomToken",this._userRandomToken)),this.addInitParam("runMode","browse")}this._userCanvas=c;var J=window.innerWidth,te=window.innerHeight;if(c!=null&&(J=c.clientWidth,te=c.clientHeight),this._viewWidth=J,this._viewHeight=te,this.m_mxDatabase.getSelectManager().setCanvasSize(J,te),this.mxdrawThreeJS.onInitThreejs(),this.eventManager.registEvent(this),this.onCreate(),this.m_mxDatabase.init(this),this._parentDocObject=new b.Object3D,this.scene.add(this._parentDocObject),this._parentDocObject_SmallCoord=new b.Object3D,this.scene.add(this._parentDocObject_SmallCoord),this.threejsselectObjects=new b.Object3D,this.scene.add(this.threejsselectObjects),this._objectsOsnap=new F.MxDrawObjectOsnap(this),this.tempMarkDraw.init(this),A.MxManager.add(this),A.MxManager.setCurrentMx(this),this.mxdrawThreeJS.addControlsChangeEvent(),W||this.updateDisplay(),this.mxdrawThreeJS.getType()!=_.MxThreeJSType.kMapBox){var ne=this;if(c==null){var ue=function(le,Pe){Pe===void 0&&(Pe=!0),ne._viewWidth=window.innerWidth,ne._viewHeight=window.innerHeight,ne.onResizeImp()&&ne.updateDisplay(Pe)};window.addEventListener("resize",ue,!1),this._onResizeFun=ue}else{var be=function(le,Pe){Pe===void 0&&(Pe=!0),le&&le.viewWidth&&le.viewHeight||(le=ne.calcViewsize()),ne._viewWidth=le.viewWidth,ne._viewHeight=le.viewHeight,ne.onResizeImp(ne._viewWidth,ne._viewHeight)&&ne.updateDisplay(Pe)};if(this._onResizeFun=be,this._event.addResizeEvent!=null){var je=this._event.addResizeEvent;je instanceof Array&&(je=je[0]),je(be,c)}else window.addEventListener("resize",be,!1);if(window.setTimeout(function(){be(void 0,!1)},5),this._event.onResize!=null){var ve=ne.calcViewsize();be(ve,!1);var Be=0,q=0,ge=!0,oe=window.setInterval(function(){q++;var le=ne.calcViewsize();if(le.viewWidth==ve.viewWidth&&le.viewHeight==ve.viewHeight&&0<le.viewWidth&&0<le.viewHeight){if(8<++Be)return clearInterval(oe),void be(le,!1);1<=Be&&ge&&(be(le,!1),2<=Be&&(ge=!1))}else Be=0;ve=le,50<q&&(clearInterval(oe),0<le.viewWidth&&0<le.viewHeight?be(le,!1):console.log("mxassert(0) error view size"))},50)}}}this.callInitObjectEvent(),this.onLoad(O),this._isCreate=!0},u.prototype.initResize=function(){if(this._userCanvas==null)this._viewWidth=window.innerWidth,this._viewHeight=window.innerHeight,this.onResizeImp();else{if(this._viewWidth=this._userCanvas.clientWidth,this._viewHeight=this._userCanvas.clientHeight,this._event.onResize!=null){var c=this._event.onResize;c instanceof Array&&(c=c[0]);var f=c();f!=null&&(this._viewWidth=f.width,this._viewHeight=f.height)}this.onResizeImp(this._viewWidth,this._viewHeight)}this.updateDisplay()},u.prototype.is2D=function(){return this._is2d},u.prototype.getOpenFile=function(){return this._openFile},u.prototype.getFileTitle=function(){var c=this._openFile;if(this._openFile.substring(this._openFile.lastIndexOf(".")+1).toLowerCase()=="wgh"){var f=this._openFile.substring(0,this._openFile.indexOf(".mxb1.wgh")).split("/");(c=f.length==1?f[0]:f[f.length-1])[0]=="$"&&(c=c.substring(1))}return c},u.prototype.getIniParam=function(){return this._iniParam},u.prototype.getOpenFileExtName=function(){return this._openFileExtName},u.prototype.loadCodeToServer=function(c,f){this._net.getSend().CallLoadCodeToServer(c,f)},u.prototype.userLogin=function(c,f){this._net.getSend().UserLogin(c,f)},u.prototype.getUserCanvas=function(){return this._userCanvas},u.prototype.getCanvas=function(){return this._userCanvas!=null?this._userCanvas:this.renderer.domElement},u.prototype.getScene=function(){return this.scene},u.prototype.getCamera=function(){return this.camera},u.prototype.callCommand=function(c,f,O){f===void 0&&(f=""),this._net.getSend().DoCommand(c,f,O)},u.prototype.deleteAll=function(){this.removeAllEntity(),this.callCommand("Mx_ClearAll"),this.updateDisplay()},u.prototype.initAllLayoutName=function(c){this._allLayoutName=c},u.prototype.getAllLayoutName=function(){return this._allLayoutName},u.prototype.updataClipMaterial=function(){this._blocks.updataClipMaterial(this)},u.prototype.getExtRefManager=function(){return this._extRefManager},u.prototype.showLayer=function(c,f){typeof c=="string"&&(c=this._layers.getLayerIdForName(c)),this._blocks.showLayer(c,f),this.updateDisplay()},u.prototype.addLayerInfo=function(c,f,O){f=this.automaticInversionColor(16777215&f),this._layers.add(c,f,O)},u.prototype.setZeroLayerId=function(c){this._layers.setZeroLayerId(c)},u.prototype.addLayerInfoComplete=function(){this._layers.initComplete()},u.prototype.addEntity=function(c,f){var O=this._mapId2Entity.get(c);O==null&&(O=new Array,this._mapId2Entity.set(c,O)),O.push(f)},u.prototype.getEntity=function(c){return this._mapId2Entity.get(c)},u.prototype.clearThreejsScence=function(){this.m_mxDatabase.getGripManager().reInit(),this.isValidMcObject()&&this.mcObject.getGripManager().reInit(),D.MxFun.removeThreejsObject(this.threejsselectObjects,this.scene),this.threejsselectObjects=new b.Object3D,D.MxFun.removeThreejsObject(this._parentDocObject,this.scene),this._parentDocObject=new b.Object3D,D.MxFun.removeThreejsObject(this._parentDocObject_SmallCoord,this.scene),this._parentDocObject_SmallCoord=new b.Object3D,this.scene.remove(),this.scene.dispose(),this.scene=new b.Scene,this.scene.add(this.threejsselectObjects),this.scene.add(this._parentDocObject),this.scene.add(this._parentDocObject_SmallCoord),this._objectsOsnap=new F.MxDrawObjectOsnap(this),this.m_mxDatabase.reInit(),this.tempMarkDraw.init(this),this.mxdrawThreeJS.onInitScene(),D.MxFun.removeThreejsObject(this.threejsselectObjectsView,this.secenView),this.threejsselectObjectsView=null,this.secenView.remove(),this.secenView.dispose(),this.secenView=null,this.onInitViewScene(),this._runMode!=a.kCPPMxCAD&&this.mxdrawThreeJS.getType()!=_.MxThreeJSType.kMapBox||(this.secenView!=null?this.secenView.background=null:this.scene.background=null)},u.prototype.reInit=function(){this.clearThreejsScence(),this._openFile="",this._openFileExtName="",this._mapId2Entity=new Map,this._setAdyDelete=new Map,this._layers=new U.MxBrowseLayerData,this._blocks=new V.Blocks,this._extRefManager=new V.ExternalReferenceManager,this._doc2World=new b.Matrix4,this._word2doc=new b.Matrix4,this._allLayoutName=new Array,this._tzDwgStaticFile="",this._devicePixelRatio=window.devicePixelRatio,this._blocks.initRootBlockRef()},u.prototype.removeEntity=function(c){if(this._setAdyDelete[c]==null){this._setAdyDelete[c]=!0;var f=this._mapId2Entity.get(c);if(f!=null){for(var O in f)this.scene.remove(f[O]);this._mapId2Entity.delete(c)}}},u.prototype.removeEntityFromServer=function(c){for(var f=c.getInt32(4,!0),O=0;O<f;O++){var W=c.getInt32(4*(O+20),!0);this.removeEntity(W)}},u.prototype.removeAllEntity=function(){var c=this;this._mapId2Entity.forEach(function(f,O,W){for(var X in f)c.scene.remove(f[X])}),this._mapId2Entity.clear()},u.prototype.mxWebAddEntity=function(c){this._setAdyDelete.clear();var f=this.mxWebAddEntity_3DChild(c);this.mxWebAddEntity_Curve(c,f),this._setAdyDelete.clear()},u.prototype.getViewWorldCoord=function(){var c=new b.Vector3(-1,-1,1);c.unproject(this.camera);var f=new b.Vector3(-1,1,1);f.unproject(this.camera);var O=new b.Vector3(1,1,1);O.unproject(this.camera);var W=new b.Vector3(1,-1,1);return W.unproject(this.camera),{pt1:c,pt2:f,pt3:O,pt4:W}},u.prototype.getViewDocCoord=function(){var c=this.getViewWorldCoord();return c.pt1=this.docCoord2Cad2(this.worldCoord2Doc(c.pt1.x,c.pt1.y,0)),c.pt2=this.docCoord2Cad2(this.worldCoord2Doc(c.pt2.x,c.pt2.y,0)),c.pt3=this.docCoord2Cad2(this.worldCoord2Doc(c.pt3.x,c.pt3.y,0)),c.pt4=this.docCoord2Cad2(this.worldCoord2Doc(c.pt4.x,c.pt4.y,0)),c},u.prototype.screenCoord2World=function(c,f,O){return this.mxdrawThreeJS.screenCoord2World(c,f,O)},u.prototype.worldCoord2Screen=function(c,f,O){return this.mxdrawThreeJS.worldCoord2Screen(c,f,O)},u.prototype.screenCoord2World_mxdrawThreeJS_call=function(c,f,O){var W=this.getCanvas(),X=W.clientWidth,J=W.clientHeight;O=.5;var te=this.camera;te&&te.isOrthographicCamera&&(O=(te.near+te.far)/(te.near-te.far));var ne=new b.Vector3(c/X*2-1,-f/J*2+1,O);return ne.unproject(this.camera),ne.z=0,ne},u.prototype.worldCoord2Screen_mxdrawThreeJS_call=function(c,f,O){var W=new b.Vector3(c,f,O).project(this.camera),X=this.getCanvas(),J=X.clientWidth/2,te=X.clientHeight/2,ne=Math.round(W.x*J+J),ue=Math.round(-W.y*te+te);return new b.Vector3(ne,ue,0)},u.prototype.worldCoordLong2Doc=function(c){var f=this.worldCoord2Doc(0,0,0),O=this.worldCoord2Doc(c,0,0);return f.distanceTo(O)},u.prototype.docCoordLong2World=function(c){var f=this.docCoord2World(0,0,0),O=this.docCoord2World(c,0,0);return f.distanceTo(O)},u.prototype.getDoc2CADMatrix=function(){return this._doc2CAD},u.prototype.docCoord2Cad=function(c,f,O){var W=new b.Vector3(c,f,O);return W.applyMatrix4(this._doc2CAD),W},u.prototype.toSmallcoord=function(c){return this._runMode==a.kCPPMxCAD?this.cadCoord2Doc2(c):c},u.prototype.toSmallcoord2=function(c,f,O){return O===void 0&&(O=0),this._runMode==a.kCPPMxCAD?this.cadCoord2Doc(c,f,O):new b.Vector3(c,f,O)},u.prototype.docCoord2Cad2=function(c){return(c=c.clone()).applyMatrix4(this._doc2CAD),c},u.prototype.cadCoord2Doc=function(c,f,O){var W=new b.Vector3(c,f,O);return W.applyMatrix4(this._cad2Doc),W},u.prototype.cadCoord2Doc2=function(c){return(c=c.clone()).applyMatrix4(this._cad2Doc),c},u.prototype.docCoordLong2Cad=function(c){var f=this.docCoord2Cad(0,0,0),O=this.docCoord2Cad(c,0,0);return f.distanceTo(O)},u.prototype.cadCoordLong2Doc=function(c){var f=this.cadCoord2Doc(0,0,0),O=this.cadCoord2Doc(c,0,0);return f.distanceTo(O)},u.prototype.viewCoordLong2Cad=function(c){return this.docCoordLong2Cad(this.screenCoordLong2Doc(c))},u.prototype.cadCoordLong2View=function(c){return this.docCoordLong2Screen(this.cadCoordLong2Doc(c))},u.prototype.viewCoord2Cad=function(c,f,O){var W=this.screenCoord2Doc(c,f,O);return this.docCoord2Cad(W.x,W.y,W.z)},u.prototype.cadCoord2View=function(c,f,O){var W=this.cadCoord2Doc(c,f,O);return this.docCoord2Screen(W.x,W.y,W.z)},u.prototype.docCoord2World=function(c,f,O){var W=new b.Vector3(c,f,O);return W.applyMatrix4(this._doc2World),W},u.prototype.getDoc2World=function(){return this._doc2World},u.prototype.getWorldToDoc=function(){return this._word2doc},u.prototype.worldCoord2Doc=function(c,f,O){var W=new b.Vector3(c,f,O);return W.applyMatrix4(this._word2doc),W},u.prototype.screenCoord2Doc=function(c,f,O){var W=this.screenCoord2World(c,f,O);return this.worldCoord2Doc(W.x,W.y,0)},u.prototype.worldCoord2Currnet=function(c,f,O){var W=new b.Vector3(c,f,O);return W.applyMatrix4(this._word2Current),W},u.prototype.currentCoord2World=function(c,f,O){var W=new b.Vector3(c,f,O);return W.applyMatrix4(this._current2word),W},u.prototype.screenCoord2Current=function(c,f,O){var W=this.screenCoord2World(c,f,O);return W.applyMatrix4(this._word2Current),W},u.prototype.currentCoord2Screen=function(c,f,O){var W=new b.Vector3(c,f,O);return W.applyMatrix4(this._current2word),this.worldCoord2Screen(W.x,W.y,W.z)},u.prototype.docCoord2Screen=function(c,f,O){var W=this.docCoord2World(c,f,O);return this.worldCoord2Screen(W.x,W.y,W.z)},u.prototype.screenCoordLong2Doc=function(c){var f=this.screenCoord2Doc(0,0,0),O=this.screenCoord2Doc(c,0,0);return f.distanceTo(O)},u.prototype.screenCoordLong2DocScale=function(){var c=this.screenCoord2Doc(0,0,0),f=this.screenCoord2Doc(1,0,0);return c.distanceTo(f)},u.prototype.docCoordLong2Screen=function(c){var f=this.docCoord2Screen(0,0,0),O=this.docCoord2Screen(0<c?c:-c,0,0);return 0<=c?f.distanceTo(O):-f.distanceTo(O)},u.prototype.screenCoordLong2World=function(c){var f=this.screenCoord2World(0,0,0),O=this.screenCoord2World(0<c?c:-c,0,0);return 0<=c?f.distanceTo(O):-f.distanceTo(O)},u.prototype.worldCoordLong2Screen=function(c){var f=this.worldCoord2Screen(0,0,0),O=this.worldCoord2Screen(c,0,0);return f.distanceTo(O)},u.prototype.initCAD2Doc=function(c){c instanceof Array?this._cad2Doc.fromArray(c):this._cad2Doc=c,this._doc2CAD.getInverse(this._cad2Doc),this.mcObject.initCAD2Doc(this._cad2Doc,this._doc2CAD)},u.prototype.intiDoc2Wold=function(c){c instanceof Array?this._doc2World.fromArray(c):this._doc2World=c,this._word2doc.getInverse(this._doc2World)},u.prototype.intiword2Current=function(c){this._word2Current=c.clone(),this._current2word.getInverse(this._word2Current)},u.prototype.initializingObjectMatrix=function(){this.isNewObjectMatrix&&this._runMode==a.kCPPMxCAD?(this.m_mxDatabase.initObjectMatrix(this._cad2Doc),this._parentDocObject.matrix=this._cad2Doc,this._parentDocObject.matrixAutoUpdate=!1,this._parentDocObject_SmallCoord.matrix=new b.Matrix4,this._parentDocObject_SmallCoord.matrixAutoUpdate=!1,this.threejsselectObjects.matrix=this._cad2Doc,this.threejsselectObjects.matrixAutoUpdate=!1,this.intiword2Current(this._doc2CAD)):(this.m_mxDatabase.initObjectMatrix(this._doc2World),this._parentDocObject.matrix=this._doc2World,this._parentDocObject.matrixAutoUpdate=!1,this._parentDocObject_SmallCoord.matrix=this._doc2World,this._parentDocObject_SmallCoord.matrixAutoUpdate=!1,this.threejsselectObjects.matrix=this._doc2World,this.threejsselectObjects.matrixAutoUpdate=!1,this.intiword2Current(this._word2doc))},u.prototype.getDrawContainer=function(){return this.threejsselectObjects},u.prototype.getTheTempDrawContainer=function(){return this._parentDocObject},u.prototype.getTheTempDrawContainer_SmallCoord=function(){return this._parentDocObject_SmallCoord},u.prototype.getTempMarkDraw=function(){return this.tempMarkDraw},u.prototype.mxWebAddEntityFor2dPointMeshBuffers=function(c,f){var O=new I.MxNetData(c),W=O.getdPointMeshBuffersHead(),X=W.zeroLayerIdIndex,J=W.databaseIndex;f!=-1&&(J=f);for(var te=W.datasize,ne=0;ne<W.datacount;ne++){var ue=O.getdPointMeshBufferDataHead(te);te=ue.offset;var be=ue.layerId,je=be==X,ve=ue.blkId,Be=ue.pointCount;if(!(Be<1)){for(var q=[],ge=[],oe=[],le=[],Pe=[],Ye=0;Ye<Be;Ye++){var ze=c.getFloat32(te,!0);te+=4;var se=c.getFloat32(te,!0);te+=4;var xe=c.getFloat32(te,!0);te+=4;var De=c.getFloat32(te,!0);te+=4;var tt=c.getFloat32(te,!0);te+=4;var st=c.getFloat32(te,!0);te+=4;var mt=c.getInt32(te,!0);te+=4;var Rt=mt>>24&255;Rt==2?(le.push(ze,se),le.push(xe,De),le.push(tt,st)):Rt==1?ve!=0&&je?(Pe.push(ze,se),Pe.push(xe,De),Pe.push(tt,st)):(oe.push(ze,se),oe.push(xe,De),oe.push(tt,st)):(mt=this.automaticInversionColor(16777215&mt),q.push(ze,se),q.push(xe,De),q.push(tt,st),ge.push((255&mt)/255,(mt>>8&255)/255,(mt>>16&255)/255),ge.push((255&mt)/255,(mt>>8&255)/255,(mt>>16&255)/255),ge.push((255&mt)/255,(mt>>8&255)/255,(mt>>16&255)/255))}var Ot=this._blocks,He=this._layers;J!=0&&(Ot=this._extRefManager.getBlocks(J),He=this._extRefManager.getLayers(J));var Vt=Ot.crateBlock(ve);Vt.addGeometryMesh(q,ge,be,le,oe,Pe),Ot.createThreejsObj(Vt,this,He)}}},u.prototype.mxWebAddEntityForMemorySections=function(c,f){var O=new I.MxNetData(c),W=O.getMemorySectionsHead(),X=(W.zeroLayerIdIndex,W.databaseIndex);f!=-1&&(X=f);var J=W.nOffset,te=this._blocks,ne=this._layers;X!=0&&(te=this._extRefManager.getBlocks(X),ne=this._extRefManager.getLayers(X));for(var ue=0;ue<W.datacount;ue++){var be=O.getMemorySectionHead(J);J=be.offset;var je=new V.MxNewDisplayMemorySection;je.layerId=be.layerId,je.blockId=be.blkId,je.id=be.memId,je.color=be.memColor,je.type=be.memType;var ve=!1;je.type==V.MxNewDisplayMemorySectionType.kLinesType_Float?(ve=!0,je.type=V.MxNewDisplayMemorySectionType.kLinesType):je.type==V.MxNewDisplayMemorySectionType.kTriangleType_Float?(ve=!0,je.type=V.MxNewDisplayMemorySectionType.kTriangleType):je.type==V.MxNewDisplayMemorySectionType.kPointType_Float&&(ve=!0,je.type=V.MxNewDisplayMemorySectionType.kPointType);var Be=be.pointCount;if(!(Be<1)){for(var q=[],ge=0;ge<Be;ge++)if(ve){var oe=c.getFloat32(J,!0);J+=4;var le=c.getFloat32(J,!0);J+=4,c.getFloat32(J,!0),J+=4,q.push(oe,le,0)}else oe=c.getFloat64(J,!0),J+=8,le=c.getFloat64(J,!0),J+=8,c.getFloat64(J,!0),J+=8,q.push(oe,le,0);je.points=q;var Pe=te.crateBlock(je.blockId);Pe.addMemorySections(je),te.createThreejsObj(Pe,this,ne)}}},u.prototype.convertBytesToUTF8=function(c,f){var O=0;f=Math.min(f||c.length,c.length),c[0]===239&&c[1]===187&&c[2]===191&&(O=3);for(var W=[],X=0;O<f;X++){var J,te,ne,ue=c[O++];if(ue===0)break;ue<128?W[X]=String.fromCharCode(ue):194<=ue&&ue<224?(J=c[O++],W[X]=String.fromCharCode(((31&ue)<<6)+(63&J))):224<=ue&&ue<240?(J=c[O++],te=c[O++],W[X]=String.fromCharCode(((15&ue)<<12)+((63&J)<<6)+(63&te))):240<=ue&&ue<245&&(ne=((7&ue)<<18)+((63&(J=c[O++]))<<12)+((63&(te=c[O++]))<<6)+(63&c[O++])-65536,W[X]=String.fromCharCode(55296+(ne>>10),56320+(1023&ne)))}return W.join("")},u.prototype.mxWebAddEntityFor2dPointTextureBuffers=function(c,f){var O=new I.MxNetData(c),W=O.getdPointTextureBuffersHead(),X=W.ver,J=(W.zeroLayerIdIndex,W.databaseIndex);f!=-1&&(J=f);for(var te=W.datasize,ne=0;ne<W.datacount;ne++){var ue=O.getdPointTextureBufferDataHead(te);te=ue.offset;var be=ue.layerId,je=ue.blkId,ve=ue.dataCount;if(!(ve<1)){var Be=0,q=this._blocks,ge=this._layers;J!=0&&(q=this._extRefManager.getBlocks(J),ge=this._extRefManager.getLayers(J));for(var oe=q.crateBlock(je);Be<ve;Be++){var le=c.getFloat64(te,!0);te+=8;var Pe=c.getFloat64(te,!0);te+=8;var Ye=c.getFloat64(te,!0);te+=8;var ze=c.getUint32(te,!0);te+=4;var se=c.getUint32(te,!0);te+=4;var xe=this.convertBytesToUTF8(new Uint8Array(c.buffer.slice(te,te+se)),void 0);te+=se;var De=[],tt=[],st=[];if(!(ze<1)){for(var mt=0;mt<ze;mt++){if(5<=X){var Rt=c.getFloat64(te,!0);te+=8;var Ot=c.getFloat64(te,!0);te+=8,c.getFloat64(te,!0),te+=8;var He=c.getFloat64(te,!0);te+=8;var Vt=c.getFloat64(te,!0);te+=8,c.getFloat64(te,!0),te+=8;var jt=c.getFloat64(te,!0);te+=8;var Ln=c.getFloat64(te,!0);te+=8,c.getFloat64(te,!0),te+=8,De.push(Rt,Ot),De.push(He,Vt),De.push(jt,Ln)}else Rt=c.getFloat32(te,!0),te+=4,Ot=c.getFloat32(te,!0),te+=4,He=c.getFloat32(te,!0),te+=4,Vt=c.getFloat32(te,!0),te+=4,jt=c.getFloat32(te,!0),te+=4,Ln=c.getFloat32(te,!0),te+=4,De.push(Rt,Ot),De.push(He,Vt),De.push(jt,Ln);var nn=c.getInt32(te,!0);te+=4;var er=c.getFloat32(te,!0);te+=4;var yt=c.getFloat32(te,!0);te+=4;var Ue=c.getFloat32(te,!0);te+=4;var Zt=c.getFloat32(te,!0);te+=4;var On=c.getFloat32(te,!0);te+=4;var Xn=c.getFloat32(te,!0);te+=4;var dt=nn>>24&255;nn=dt==2||dt==1?16777215:this.automaticInversionColor(16777215&nn),st.push(er,yt),st.push(Ue,Zt),st.push(On,Xn),tt.push((255&nn)/255,(nn>>8&255)/255,(nn>>16&255)/255),tt.push((255&nn)/255,(nn>>8&255)/255,(nn>>16&255)/255),tt.push((255&nn)/255,(nn>>8&255)/255,(nn>>16&255)/255)}oe.addGeometryTexture(De,st,tt,be,xe,le,Pe,Ye)}}q.createThreejsObj(oe,this,ge)}}},u.prototype.mxWebAddEntityFor2dPointCurveBuffers=function(c,f){var O=new I.MxNetData(c),W=O.getdPointCurveBuffersHead(),X=W.zeroLayerIdIndex,J=W.databaseIndex;f!=-1&&(J=f);for(var te=W.datasize,ne=0;ne<W.datacount;ne++){var ue=O.getdPointCurveBufferDataHead(te);te=ue.offset;var be=ue.layerId,je=be==X,ve=ue.blkId,Be=ue.pointCount;if(!(Be<1)){for(var q=[],ge=[],oe=[],le=[],Pe=[],Ye=0;Ye<Be;Ye++){var ze=c.getFloat32(te,!0);te+=4;var se=c.getFloat32(te,!0);te+=4;var xe=c.getFloat32(te,!0);te+=4;var De=c.getFloat32(te,!0);te+=4;var tt=c.getInt32(te,!0);te+=4;var st=tt>>24&255;st==2?(le.push(ze,se),le.push(xe,De)):st==1?ve!=0&&je?(Pe.push(ze,se),Pe.push(xe,De)):(oe.push(ze,se),oe.push(xe,De)):(q.push(ze,se),q.push(xe,De),tt=this.automaticInversionColor(16777215&tt),ge.push((255&tt)/255,(tt>>8&255)/255,(tt>>16&255)/255),ge.push((255&tt)/255,(tt>>8&255)/255,(tt>>16&255)/255))}var mt=this._blocks,Rt=this._layers;J!=0&&(mt=this._extRefManager.getBlocks(J),Rt=this._extRefManager.getLayers(J));var Ot=mt.crateBlock(ve);Ot.addGeometryCurve(q,ge,be,le,oe,Pe),mt.createThreejsObj(Ot,this,Rt)}}},u.prototype.mxWebAddEntityFor2dPointCurveBuffer=function(c,f){var O=new I.MxNetData(c);if(!O.getIsSketchEntity()){var W,X=O.getLayerId(),J=X==O.getZeroLayerId(),te=O.getBlockId();if(!((W=c.getInt32(20,!0)/20)<1)){for(var ne=80,ue=[],be=[],je=[],ve=[],Be=[],q=0;q<W;q++){var ge=c.getFloat32(ne,!0);ne+=4;var oe=c.getFloat32(ne,!0);ne+=4;var le=c.getFloat32(ne,!0);ne+=4;var Pe=c.getFloat32(ne,!0);ne+=4;var Ye=c.getInt32(ne,!0);ne+=4;var ze=Ye>>24&255;ze==2?(ve.push(ge,oe),ve.push(le,Pe)):ze==1?te!=0&&J?(Be.push(ge,oe),Be.push(le,Pe)):(je.push(ge,oe),je.push(le,Pe)):(Ye=this.automaticInversionColor(16777215&Ye),ue.push(ge,oe),ue.push(le,Pe),be.push((255&Ye)/255,(Ye>>8&255)/255,(Ye>>16&255)/255),be.push((255&Ye)/255,(Ye>>8&255)/255,(Ye>>16&255)/255))}var se=O.getDatabaseIndex();f!=-1&&(se=f);var xe=this._blocks,De=this._layers;se!=0&&(xe=this._extRefManager.getBlocks(se),De=this._extRefManager.getLayers(se));var tt=xe.crateBlock(te);tt.addGeometryCurve(ue,be,X,ve,je,Be),xe.createThreejsObj(tt,this,De)}}},u.prototype.mxWebAddEntityFor2dPointMeshBuffer=function(c,f){var O=new I.MxNetData(c);if(!O.getIsSketchEntity()){var W,X=O.getLayerId(),J=O.getBlockId(),te=X==O.getZeroLayerId();if(!((W=c.getInt32(12,!0)/28)<1)){for(var ne=80,ue=[],be=[],je=[],ve=[],Be=[],q=0;q<W;q++){var ge=c.getFloat32(ne,!0);ne+=4;var oe=c.getFloat32(ne,!0);ne+=4;var le=c.getFloat32(ne,!0);ne+=4;var Pe=c.getFloat32(ne,!0);ne+=4;var Ye=c.getFloat32(ne,!0);ne+=4;var ze=c.getFloat32(ne,!0);ne+=4;var se=c.getInt32(ne,!0);ne+=4;var xe=se>>24&255;xe==2?(ve.push(ge,oe),ve.push(le,Pe),ve.push(Ye,ze)):xe==1?J!=0&&te?(Be.push(ge,oe),Be.push(le,Pe),Be.push(Ye,ze)):(je.push(ge,oe),je.push(le,Pe),je.push(Ye,ze)):(ue.push(ge,oe),ue.push(le,Pe),ue.push(Ye,ze),se=this.automaticInversionColor(16777215&se),be.push((255&se)/255,(se>>8&255)/255,(se>>16&255)/255),be.push((255&se)/255,(se>>8&255)/255,(se>>16&255)/255),be.push((255&se)/255,(se>>8&255)/255,(se>>16&255)/255))}var De=O.getDatabaseIndex();f!=-1&&(De=f);var tt=this._blocks,st=this._layers;De!=0&&(tt=this._extRefManager.getBlocks(De),st=this._extRefManager.getLayers(De));var mt=tt.crateBlock(J);mt.addGeometryMesh(ue,be,X,ve,je,Be),tt.createThreejsObj(mt,this,st)}}},u.prototype.mxWebCreateAllBlocks=function(c,f){var O=new I.MxNetData(c).getDatabaseIndex();f!=-1&&(O=f);var W=this._blocks;O!=0&&(W=this._extRefManager.getBlocks(O)),W.createBlocks(c,this.scene)},u.prototype.mxWebEntitysData=function(c,f){f==-1&&this._objectsOsnap.mxWebEntitysData(c,f)},u.prototype.getObjectOsnap=function(){return this._objectsOsnap},u.prototype.saveMxEntityToJson=function(c){return this.m_mxDatabase.saveJson(c)},u.prototype.getDtabaseJsonString=function(){return JSON.stringify(this.m_mxDatabase.toJsonObject())},u.prototype.loadMxEntityFromJson=function(c){return this.m_mxDatabase.loadJson(c)},u);function u(c){this._is2d=!0,this._runMode=a.kBrowse,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.camera_recover=null,this.secenView=null,this.cameraView=null,this.renderer=null,this.controls=null,this.threejsselectObjectsView=null,this._mouseRightRotate=!1,this._isMouseMiddlePan=1,this._mapId2Entity=new Map,this._setAdyDelete=new Map,this._layers=new U.MxBrowseLayerData,this._blocks=new V.Blocks,this._extRefManager=new V.ExternalReferenceManager,this._doc2World=new b.Matrix4,this._word2doc=new b.Matrix4,this._cad2Doc=new b.Matrix4,this._doc2CAD=new b.Matrix4,this._word2Current=new b.Matrix4,this._current2word=new b.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._parentDocObject_SmallCoord=null,this.threejsselectObjects=null,this.tempMarkDraw=new B.MxTempMarkDraw,this._onResizeFun=null,this._sCurrentLoadURL="",this.eventManager=new Y.MxDrawObjectEvent,this._viewangle=0,this.id=0,this.mcObject=new S.McDrawObject,this.isPointMultipleSelect=!1,this.isNewObjectMatrix=!0,this.bakControls=void 0,this.isMultipleSelect=!1,this.mxdrawThreeJS=null,this.curMousePostion=new b.Vector2(0,0),this.m_isValidCurMousePostion=!1,this._is2d=c,this._blocks.initRootBlockRef(),this.m_iniSet[h.kEnableOsnapFunction]=!1,this.m_sysVariable.init(this),this.m_mxDatabase=new T.MxDbDatabase,this.id=A.MxManager.allocId(),this.isMultipleSelect=C.MxDrawData.m_isMultipleSelect,this.mcObject.initMxObject(this)}o.MxDrawObject=R},{"./MxDrawData":22,"./MxDrawObjectEvent":26,"./MxFun":27,"./MxLocalFileLoad":28,"./MxManager":29,"./MxNetData":31,"./MxSystemVariable":35,"./MxTempMarkDraw":36,"./Operate/MxDrawObjectOsnap":49,"./UI/MxUiVue":65,"./View/MxBrowseDisplay":66,"./View/MxBrowseLayerData":67,"./View/MxDbDatabase":68,"./View/MxDbEntityGrip":70,"./View/MxDrawMapBox":75,"./cpp/McDrawObject":78,three:19}],24:[function(w,r,o){var a,v=this&&this.__extends||(a=function(T,_){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,k){Y.__proto__=k}||function(Y,k){for(var S in k)Object.prototype.hasOwnProperty.call(k,S)&&(Y[S]=k[S])})(T,_)},function(T,_){function Y(){this.constructor=T}a(T,_),T.prototype=_===null?Object.create(_):(Y.prototype=_.prototype,new Y)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxDrawObject2d=void 0;var h,b=w("three"),D=w("./MxFun"),U=w("./MxDrawObject"),V=w("three-orbitcontrols"),I=w("./MxNetData"),g=w("./MxMaterial"),A=w("./MxDrawData"),M=w("./View/MxDrawMapBox"),N=(v(F,h=U.MxDrawObject),F.prototype.set3DDraw=function(T){this.is3DDraw=T},F.prototype.getOrthographicCamera=function(){return this.camera instanceof b.OrthographicCamera?this.camera:null},F.prototype.getFullDisplayRange=function(){return{minPt:this._initMinDisplayPoint,maxPt:this._initMaxDisplayPoint}},F.prototype.saveZoom=function(){this.camera_recover=this.camera.clone(!1),this.controls.saveState()},F.prototype.recoverZoom=function(){this.camera_recover&&(this.camera.copy(this.camera_recover,!1),this.camera_recover=null,this.getOrthographicCamera().updateProjectionMatrix(),this.controls.reset(),this.mcObject.updateDisplayMatrixData())},F.prototype.zoomW_call=function(T,_,Y,k){if(T.distanceTo(_)<1e-7)console.log("Mx:ZoomW param invalid");else{if(Y!=null&&Y||(T=this.currentCoord2World(T.x,T.y,0),_=this.currentCoord2World(_.x,_.y,0)),T.x>_.x){var S=T.x;T.x=_.x,_.x=S}T.y>_.y&&(S=T.y,T.y=_.y,_.y=S);var G=this.getViewWidth(),C=this.getViewHeight();C<5&&(C=5),G<5&&(G=5);var B=Math.abs(T.x-_.x),R=Math.abs(T.y-_.y);B<1e-5&&(B=1e-5),R<1e-5&&(R=1e-5);var u=this.getOrthographicCamera();if(B/R<G/C){var c=.5*R,f=G/C;u.left=-c*f,u.right=c*f,u.top=c,u.bottom=-c}else c=.5*B,f=C/G,u.left=-c,u.right=c,u.top=c*f,u.bottom=-c*f;var O=B,W=R,X=O;X<W&&(X=W),this._runMode==U.MxRunMode.kCPPMxCAD?(u.far=10240,u.near=-10240):(u.far=1e3*X,u.far<9e4&&(u.far=9e4),u.near=1e3*-X,-9e4<u.near&&(u.near=-9e4));var J=T.x+.5*O,te=T.y+.5*W;u.zoom=1,u.position.set(J,te,100),u.lookAt(new b.Vector3(J,te,0)),u.updateProjectionMatrix(),this.controls.target.x=J,this.controls.target.y=te,this.controls.target.z=0,this.controls.update(),this.mcObject.updateDisplayMatrixData(k)}},F.prototype.zoomScale_call=function(T){var _=this.getOrthographicCamera();_.zoom=Math.max(this.controls.minZoom,Math.min(this.controls.maxZoom,_.zoom*T)),_.updateProjectionMatrix(),this.controls.update(),this.mcObject.updateDisplayMatrixData()},F.prototype.zoomCenter_call=function(T,_){var Y=this.bakViewDocWidth,k=this.bakViewDocHeight;if(this.bakViewDocWidth){var S=new b.Vector3,G=new b.Vector3;S.x=T-.5*this.bakViewDocWidth,S.y=_-.5*this.bakViewDocHeight,G.x=T+.5*this.bakViewDocWidth,G.y=_+.5*this.bakViewDocHeight,this.zoomW(S,G)}else{var C=this.getViewWidth(),B=this.getViewHeight(),R=this.screenCoord2World(0,0,0),u=this.screenCoord2World(C,B,0);Y=u.x-R.x,k=u.y-R.y;var c=T-(R.x+.5*(u.x-R.x)),f=_-(R.y+.5*(u.y-R.y));R.x+=c,R.y+=f,u.x+=c,u.y+=f,this.zoomW(R,u)}this.bakViewDocWidth=Y,this.bakViewDocHeight=k},F.prototype.calcCameraUp=function(T){var _=new b.Vector3(0,1,0),Y=new b.Matrix4;return Y.makeRotationZ(T),_.applyMatrix4(Y),_},F.prototype.updateCameraForm3dViewDataImp=function(T){T.updateCamera(this.getOrthographicCamera(),this.controls,this.getViewWidth(),this.getViewHeight()),this.mcObject.updateDisplayMatrixData(!1),this.controls.mouseButtons.LEFT=b.MOUSE.PAN,this.controls.mouseButtons.RIGHT=b.MOUSE.ROTATE,this.controls.mouseButtons.MIDDLE=b.MOUSE.PAN,this.controls.touches.ONE=b.TOUCH.ROTATE,this.controls.touches.TWO=b.TOUCH.PAN},F.prototype.updateCameraDisplayRangeImp=function(T,_,Y){this._initZoomwCoordPt1!=null&&this._initZoomWCoordPt2!=null?(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=_),this._viewangle=Y,this.camera.up=this.calcCameraUp(Y),this.cameraView.up=this.calcCameraUp(Y),this.cameraView.updateProjectionMatrix(),this.zoomW(this._initMinDisplayPoint,this._initMaxDisplayPoint,!0)},F.prototype.setViewAngle_call=function(T){this._viewangle=T;var _=this.getOrthographicCamera();_&&(_.up=this.calcCameraUp(T),_.updateProjectionMatrix()),this.cameraView.up=this.calcCameraUp(T),this.cameraView.updateProjectionMatrix(),this.controls.update(),this.mcObject.setViewAngle(T),this.mcObject.updateDisplayMatrixData()},F.prototype.zoomInitialStates=function(){this._initMinDisplayPoint!=null&&this._initMaxDisplayPoint!=null?(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(){if(this.callInitSceneEvent(this.scene,this.controls,!0)==0){var T=new b.AmbientLight(3355443,1);this.scene.add(T);var _=new b.DirectionalLight(16777215,1);_.position.set(-2,2,3).normalize(),this.scene.add(_)}},F.prototype.updataCameraView=function(T,_){var Y=T,k=_;this.cameraView.left=0,this.cameraView.right=Y,this.cameraView.top=k,this.cameraView.bottom=0,this.cameraView.updateProjectionMatrix()},F.prototype.onInitViewScene=function(){if(!this.secenView){this.secenView=new b.Scene,this._runMode!=U.MxRunMode.kCPPMxCAD&&this.mxdrawThreeJS.getType()!=M.MxThreeJSType.kMapBox&&(this.secenView.background=new b.Color(this._viewcolor));var T=this.getViewWidth(),_=this.getViewHeight();T=this.xzSize(T),_=this.xzSize(_),this.cameraView=new b.OrthographicCamera(0,T,_,0,1,2e3),this.cameraView.position.set(0,0,2e3),this.cameraView.lookAt(new b.Vector3(0,0,0)),this.cameraView.updateProjectionMatrix();var Y=new b.AmbientLight(3355443,1);this.secenView.add(Y);var k=new b.DirectionalLight(16777215,1);k.position.set(-2,2,3).normalize(),this.secenView.add(k),this.threejsselectObjectsView=new b.Object3D,this.secenView.add(this.threejsselectObjectsView)}},F.prototype.onInitThreejs=function(){var T=this.getViewWidth(),_=this.getViewHeight(),Y=(T=this.xzSize(T))/(_=this.xzSize(_))*50;this.onInitViewScene(),this.camera=new b.OrthographicCamera(Y/-2,Y/2,25,-25,-10240,10240),this.camera.position.set(0,0,200),this.scene=new b.Scene;var k=this.getUserCanvas(),S=this._rendererParam;S=S||{},k==null?(S.antialias=!1,S.stencil=!0,this.renderer=new b.WebGLRenderer(S),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(T,_),document.body.appendChild(this.renderer.domElement)):(S.canvas=k,S.stencil=!0,this.renderer=new b.WebGLRenderer(S),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio)),this.renderer.sortObjects=!0,this.renderer.info.autoReset=A.MxDrawData.m_isAutoResetRenderer,this.renderer.info.reset();var G=this.getUserCanvas();G==null&&(G=this.renderer.domElement),this.controls=new V.OrbitControls(this.camera,G),this.is3DDraw||(this.controls.enableZoom=!0),this.controls.enableRotate=!1,D.MxFun.isPC()?(this.controls.zoomSpeed=4,this.controls.screenSpacePanning=!0,this.controls.touches.ONE=b.TOUCH.PAN,this.setMouseMiddlePan(this._isMouseMiddlePan),this._mouseRightRotate&&(this.controls.mouseButtons.RIGHT=b.MOUSE.ROTATE)):(this.setMouseMiddlePan(this._isMouseMiddlePan),this.controls.zoomSpeed=1.5,this.controls.touches.ONE=b.TOUCH.PAN,this.controls.screenSpacePanning=!0)},F.prototype.onCreate=function(){this._is2d=!0,this.mxdrawThreeJS.onInitScene()},F.prototype.mxWebAddEntity_3DChild=function(T){var _=new I.MxNetData(T).getMesh();if(_.id==null)return _.size;var Y=new b.Mesh(_.geometry,g.MxMaterial.GetBaseColorMaterial(_.nColorIndex));return this.removeEntity(_.id),this.scene.add(Y),_.isSketchEntity&&this.addEntity(_.id,Y),_.size},F.prototype.mxWebAddEntity_Curve=function(T,_){var Y=new I.MxNetData(T).getCurve(_);if(Y.id!=null){var k=g.MxMaterial.GetCurveColorMaterial(Y.colorIndex),S=new b.LineSegments(Y.geometry,k);this.removeEntity(Y.id),this.scene.add(S),Y.isSketchEntity&&this.addEntity(Y.id,S)}},F.prototype.onViewChange=function(){this._onResizeImpCalling||(this._bakOnResizeViewWorldCoord=void 0),this.bakViewDocHeight=this.bakViewDocWidth=void 0},F.prototype.mapBox_onResizeImp=function(T,_){var Y=T,k=_;this.mcObject.setSize(Y,k),this.callEvent("viewsizechange",{width:Y,height:k}),this.callEvent("viewchange"),this.m_mxDatabase.getSelectManager().setCanvasSize(Y,k)},F.prototype.callOnResizeImp=function(T,_){var Y;this._bakOnResizeViewWorldCoord?Y=this._bakOnResizeViewWorldCoord:(Y=this.getViewWorldCoord(),this._bakOnResizeViewWorldCoord=Y);var k=Y.pt1.x+.5*(Y.pt3.x-Y.pt1.x),S=Y.pt1.y+.5*(Y.pt3.y-Y.pt1.y),G=new b.Matrix4;G.makeRotationZ(this._viewangle);var C=new b.Matrix4().makeTranslation(k,S,0).multiply(G).multiply(new b.Matrix4().makeTranslation(-k,-S,0)),B=Y.pt1.clone(),R=Y.pt2.clone(),u=Y.pt3.clone(),c=Y.pt4.clone();B.applyMatrix4(C),R.applyMatrix4(C),u.applyMatrix4(C),c.applyMatrix4(C);var f=B.clone();f.x>R.x&&(f.x=R.x),f.x>u.x&&(f.x=u.x),f.x>c.x&&(f.x=c.x),f.y>R.y&&(f.y=R.y),f.y>u.y&&(f.y=u.y),f.y>c.y&&(f.y=c.y);var O=B.clone();O.x<R.x&&(O.x=R.x),O.x<u.x&&(O.x=u.x),O.x<c.x&&(O.x=c.x),O.y<R.y&&(O.y=R.y),O.y<u.y&&(O.y=u.y),O.y<c.y&&(O.y=c.y);var W=new b.Vector2;if(this.renderer.getSize(W),W.x==T&&W.y==_)return!1;var X=this.getOrthographicCamera(),J=Math.abs(O.x-f.x),te=Math.abs(O.y-f.y);if(J<1e-5&&(J=1e-5),te<1e-5&&(te=1e-5),J/te<T/_){var ne=.5*te,ue=T/_;X.left=-ne*ue,X.right=ne*ue,X.top=ne,X.bottom=-ne}else ne=.5*J,ue=_/T,X.left=-ne,X.right=ne,X.top=ne*ue,X.bottom=-ne*ue;var be=f.x+.5*J,je=f.y+.5*te;X.zoom=1;var ve=X.position.z;return X.position.set(be,je,ve),X.lookAt(new b.Vector3(be,je,0)),X.updateProjectionMatrix(),this.controls.target.x=be,this.controls.target.y=je,this.controls.target.z=0,this.controls.update(),!0},F.prototype.onResizeImp=function(T,_){var Y=this.getViewWidth();T!=null&&(Y=T);var k=this.getViewHeight();if(_!=null&&(k=_),k<5||Y<5)return!1;Y=this.xzSize(Y),k=this.xzSize(k),this._onResizeImpCalling=!0;var S=this.mcObject.mxdraw3d.onResize(this.getOrthographicCamera(),this.controls,Y,k);return S&&(this.renderer.setSize(Y,k),this.mcObject.setSize(Y,k),this.updataClipMaterial(),this.updataCameraView(Y,k),this.callEvent("viewsizechange",{width:Y,height:k}),this.callEvent("viewchange"),this.m_mxDatabase.getSelectManager().setCanvasSize(Y,k),this.m_mxDatabase.onViewChange()),this._onResizeImpCalling=!1,S},F);function F(){var T=h.call(this,!0)||this;return T._initMinDisplayPoint=null,T._initMaxDisplayPoint=null,T.is3DDraw=D.MxFun.is3DDwg(),T._bakOnResizeViewWorldCoord=void 0,T._onResizeImpCalling=!1,T.bakViewDocWidth=void 0,T.bakViewDocHeight=void 0,T}o.MxDrawObject2d=N},{"./MxDrawData":22,"./MxDrawObject":23,"./MxFun":27,"./MxMaterial":30,"./MxNetData":31,"./View/MxDrawMapBox":75,three:19,"three-orbitcontrols":17}],25:[function(w,r,o){var a,v=this&&this.__extends||(a=function(N,F){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,_){T.__proto__=_}||function(T,_){for(var Y in _)Object.prototype.hasOwnProperty.call(_,Y)&&(T[Y]=_[Y])})(N,F)},function(N,F){function T(){this.constructor=N}a(N,F),N.prototype=F===null?Object.create(F):(T.prototype=F.prototype,new T)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxDrawObject3d=void 0;var h,b=w("three"),D=w("./MxDrawObject"),U=w("three-orbitcontrols"),V=w("./MxNetData"),I=w("./MxMaterial"),g=w("./MxTools"),A=(v(M,h=D.MxDrawObject),M.prototype.mxWebAddEntity_Curve=function(N,F){var T,_=new V.MxNetData(N),Y=N.getInt32(32,!0)==0,k=_.getIsSketchEntity();if(!((T=Y?N.getInt32(20,!0)/4/3:N.getInt32(20,!0)/4/2)<2)){for(var S=new b.Geometry,G=F,C=0;C<T;C++){var B=N.getFloat32(G,!0);G+=4;var R=N.getFloat32(G,!0);G+=4;var u=0;Y&&(u=N.getFloat32(G,!0),G+=4),S.vertices.push(g.MxTools.AsThreeJsPoint(B,R,u))}var c=N.getInt32(28,!0),f=I.MxMaterial.GetCurveColorMaterial(c),O=new b.LineSegments(S,f),W=N.getInt32(4,!0);this.removeEntity(W),this.scene.add(O),k&&this.addEntity(W,O)}},M.prototype.mxWebAddEntity_3DChild=function(N){var F=new V.MxNetData(N),T=F.getId(),_=(F.getColorIndex(),F.getBufferType()==0),Y=F.getIsSketchEntity();this.removeEntity(T);var k=new b.Mesh(new b.Geometry),S=this.mxWebUpdateEntity_3DChild(k,N,_);return this.scene.add(k),Y&&this.addEntity(T,k),k.geometry.computeBoundingBox(),k.geometry.computeBoundingSphere(),S},M.prototype.mxWebUpdateEntity_3DChild=function(N,F,T){var _=new V.MxNetData(F),Y=_.getVertexBufferSize(),k=_.getIndexBufferSize(),S=_.getColorIndex();if(Y===0||k===0)return _.getDrawDataOffset();var G=_.getMateria(),C=void 0,B=!0,R=!1,u=!1;G.length!=0&&((C=JSON.parse(G)).computeFaceNonmal!=null&&(B=C.computeFaceNonmal),C.castShadow!=null&&(R=C.castShadow),C.receiveShadow!=null&&(u=C.receiveShadow)),N.material=I.MxMaterial.createMaterial(C),N.material==null&&(N.material=I.MxMaterial.GetColorMaterial(S)),N.castShadow=R,N.receiveShadow=u;var c,f=_.getDrawDataOffset();c=T?Y/4/8:Y/4/2;var O=N.geometry;O.vertices=[],O.faces=[];for(var W=0;W<c;W++){var X=F.getFloat32(f+0,!0),J=F.getFloat32(f+4,!0),te=0,ne=0,ue=0,be=0,je=0,ve=0;T?(te=F.getFloat32(f+8,!0),ne=F.getFloat32(f+12,!0),ue=F.getFloat32(f+16,!0),be=F.getFloat32(f+20,!0),je=F.getFloat32(f+24,!0),ve=F.getFloat32(f+28,!0),f+=32):f+=8;var Be=g.MxTools.AsThreeJsPoint(X,J,te);O.vertices.push(Be),O.vertices[W].normal=g.MxTools.AsThreeJsPoint(ne,ue,be),O.vertices[W].uv=new b.Vector2(je,ve)}var q=k/4;for(W=0;W<q;W+=3){var ge=F.getInt32(f,!0);f+=4;var oe=F.getInt32(f,!0);f+=4;var le=F.getInt32(f,!0);f+=4;var Pe=new b.Face3(ge,oe,le);B||Pe.vertexNormals.push(O.vertices[ge].normal,O.vertices[oe].normal,O.vertices[le].normal),O.faces.push(Pe),O.faceVertexUvs[0].push([O.vertices[ge].uv,O.vertices[oe].uv,O.vertices[le].uv])}return B&&O.computeFaceNormals(),f},M.prototype.updateUVs=function(N){N.faceVertexUvs[0]=[],N.faces.forEach(function(F){var T=["x","y","z"].sort(function(B,R){return Math.abs(F.normal[B])-Math.abs(F.normal[R])}),_=N.vertices[F.a],Y=N.vertices[F.b],k=N.vertices[F.c],S=new b.Vector2(_[T[0]],_[T[1]]),G=new b.Vector2(Y[T[0]],Y[T[1]]),C=new b.Vector2(k[T[0]],k[T[1]]);N.faceVertexUvs[0].push([S,G,C])}),N.uvsNeedUpdate=!0},M.prototype.onInitThreejs=function(){var N=this.getViewWidth(),F=this.getViewHeight(),T=(N=this.xzSize(N))/(F=this.xzSize(F))*50;this.camera=new b.OrthographicCamera(T/-2,T/2,25,-25,1,1e3),this.camera.position.set(-200,200,200),this.scene=new b.Scene,this.scene.background=new b.Color(this._viewcolor);var _=this.getUserCanvas();_==null?(this.renderer=new b.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(N,F),document.body.appendChild(this.renderer.domElement)):(this.renderer=new b.WebGLRenderer({canvas:_,antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio));var Y=this.getUserCanvas();Y==null&&(Y=this.renderer.domElement),this.controls=new U.OrbitControls(this.camera,Y)},M.prototype.onInitViewScene=function(){},M.prototype.onInitScene=function(){if(this.callInitSceneEvent(this.scene,this.controls,!1)==0){var N=new b.AmbientLight(2236962);N.integrity=1,this.scene.add(N);var F=new b.DirectionalLight(16777215,1);F.position.set(-2,2,3).normalize(),this.scene.add(F);var T=new b.GridHelper(2e3,100);T.position.y=-199,T.material.opacity=.25,T.material.transparent=!0,this.scene.add(T);var _=new b.AxesHelper(20);this.scene.add(_)}},M.prototype.onCreate=function(){this._is2d=!1,this.callEvent("initRenderer",this.renderer),this.mxdrawThreeJS.onInitScene()},M.prototype.getOrthographicCamera=function(){return this.camera instanceof b.OrthographicCamera?this.camera:null},M.prototype.onViewChange=function(){},M.prototype.callOnResizeImp=function(N,F){return!1},M.prototype.onResizeImp=function(N,F){var T=this.getViewWidth();N!=null&&(T=N);var _=this.getViewHeight();F!=null&&(_=F),T=this.xzSize(T),_=this.xzSize(_);var Y=this.getOrthographicCamera(),k=T/_;return Y.left=50*k/-2,Y.right=50*k/2,Y.top=25,Y.bottom=-25,Y.updateProjectionMatrix(),this.renderer.setSize(T,_),!0},M.prototype.zoomInitialStates=function(){},M.prototype.saveZoom=function(){},M.prototype.recoverZoom=function(){},M.prototype.zoomScale_call=function(N){},M.prototype.zoomW_call=function(N,F,T,_){},M.prototype.zoomCenter_call=function(N,F){},M.prototype.setViewAngle_call=function(N){this._viewangle=N},M.prototype.getFullDisplayRange=function(){return{}},M);function M(){var N=h.call(this,!1)||this;return N._viewcolor=15790320,N}o.MxDrawObject3d=A},{"./MxDrawObject":23,"./MxMaterial":30,"./MxNetData":31,"./MxTools":38,three:19,"three-orbitcontrols":17}],26:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxDrawObjectEvent=o.MxDrawObjectEventDefautProc=void 0;var a=w("./MxFun"),v=w("./Operate/MxJigCmdManager"),h=w("three"),b=w("./UI/MxUiVue"),D=w("./MxDrawData"),U=(V.prototype.onMousemove=function(A){if(b.MxUiVue.isNull())return 0;var M=this.mxObj.screenCoord2Doc(A.offsetX,A.offsetY,0);return M=this.mxObj.docCoord2Cad(M.x,M.y,M.z),b.MxUiVue.setTipCoord(a.MxFun.formatString("{0},{1},0.000",M.x.toFixed(3),M.y.toFixed(3))),0},V.prototype.isEnableIntelliSelect=function(){return!!D.MxDrawData.m_isEnableIntelliSelect&&!this.mxObj.is3DMode()},V.prototype.onTouchStart=function(A){if(!this.isEnableIntelliSelect()||v.MxJigCmdManager.isRunning()||this.mxObj.isPaningCommand()||A.touches.length!=1)return 0;var M=A.target.getBoundingClientRect(),N=A.touches[0].clientX-M.left,F=A.touches[0].clientY-M.top,T=this.mxObj,_=T.screenCoord2Current(N,F,0);if(T.getMxDatabase().getGripManager().onMouseLBDown(_)||T.isValidMcObject()&&T.getMcObject().getGripManager().onMouseLBDown(_))return 1;var Y=new h.Vector3(N,F,0);return a.MxFun.sendStringToExecute("Mx_FrontEndWebpageIntelliSel",{pt:Y}),1},V.prototype.onMousdown=function(A){if(A.button==v.MxJigCmdManager.MouseButton.kRight&&v.MxJigCmdManager.isRunning()&&!D.MxDrawData.m_isEnableCommandRightClickMenu&&!A.shiftKey)return v.MxJigCmdManager.OnEnter(-1),A.stopPropagation(),1;if(!this.isEnableIntelliSelect()||A.button!=v.MxJigCmdManager.MouseButton.kLeft||v.MxJigCmdManager.isRunning()||this.mxObj.isPaningCommand())return 0;var M=this.mxObj,N=M.screenCoord2Current(A.offsetX,A.offsetY,0);if(M.getMxDatabase().getGripManager().onMouseLBDown(N)||M.isValidMcObject()&&M.getMcObject().getGripManager().onMouseLBDown(N))return 1;var F=new h.Vector3(A.offsetX,A.offsetY,0);return a.MxFun.sendStringToExecute("Mx_FrontEndWebpageIntelliSel",{pt:F}),1},V.prototype.init=function(A,M){this.mxObj=A;var N=this;M.addEventListener("mousemove",function(F){return N.onMousemove(F)}),M.addEventListener("mousedown",function(F){return N.onMousdown(F)}),M.addEventListener("touchstart",function(F){return N.onTouchStart(F)})},V);function V(){}o.MxDrawObjectEventDefautProc=U;var I=(g.prototype.onMousedown=function(A,M){this.callEvent("mousedown",A,M)},g.prototype.onMousemove=function(A,M){this.callEvent("mousemove",A,M)},g.prototype.onMouseup=function(A,M){this.callEvent("mouseup",A,M)},g.prototype.registEvent=function(A){var M=A.getMxDrawThreeJs().getRegistEventObject();if(!M)return!1;var N=this;a.MxFun.isPC()?(M.addEventListener("mouseup",function(F){var T=A.getMxDrawThreeJs().getDomMousePos(F);N.onMouseup(F,T)},!0),M.addEventListener("mousemove",function(F){var T=A.getMxDrawThreeJs().getDomMousePos(F);A.setCurrentMousePostion(F),N.onMousemove(F,T)},!0),M.addEventListener("mousedown",function(F){var T=A.getMxDrawThreeJs().getDomMousePos(F);A.setCurrentMousePostion(F),N.onMousedown(F,T)},!0)):(M.addEventListener("touchstart",function(F){A.setCurrentMousePostion(F,!0),N.callEvent("touchstart",F)},!0),M.addEventListener("touchend",function(F){N.callEvent("touchend",F)},!0),M.addEventListener("touchmove",function(F){A.setCurrentMousePostion(F,!0),N.callEvent("touchmove",F)},!0)),this.defautProc.init(A,this)},g.prototype.getEventCall=function(A){var M;return A=="mousemove"?M=this.aryMousemoveEventCall:A=="mouseup"?M=this.aryMouseupEventCall:A=="mousedown"?M=this.aryMousedownEventCall:A=="touchstart"?M=this.aryTouchstartEventCall:A=="touchend"?M=this.aryTouchendEventCall:A=="touchmove"&&(M=this.aryTouchmoveEventCall),M},g.prototype.callEvent=function(A,M,N){var F=this.getEventCall(A);if(F){for(var T=F.slice(),_=0,Y=T.length;_<Y;_++){var k=T[_](M,N);if(k==1)return k}return 0}},g.prototype.addEventListener=function(A,M,N){N===void 0&&(N=!1);var F=this.getEventCall(A);return!!F&&(-1<F.indexOf(M)||(N?F.unshift(M):F.push(M)),!0)},g.prototype.removeEventListener=function(A,M){var N=this.getEventCall(A);if(!N)return!1;var F=N.indexOf(M);return-1<F&&(N.splice(F,1),!0)},g);function g(){this.aryMousedownEventCall=[],this.aryMouseupEventCall=[],this.aryMousemoveEventCall=[],this.aryTouchstartEventCall=[],this.aryTouchendEventCall=[],this.aryTouchmoveEventCall=[],this.defautProc=new U}o.MxDrawObjectEvent=I},{"./MxDrawData":22,"./MxFun":27,"./Operate/MxJigCmdManager":54,"./UI/MxUiVue":65,three:19}],27:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxFun=void 0;var a,v,h,b,D,U,V,I,g,A,M,N,F,T,_,Y=w("three"),k=w("./MxManager"),S=w("./MxDrawObject"),G=w("./MxDrawObject2d"),C=w("./MxDrawObject3d"),B=w("./UI/MxUiObjectMobile"),R=w("./UI/MxUiObjectPC"),u=w("./Operate/MxJigCmdManager"),c=w("./Operate/MxJigGetLine"),f=w("./Operate/MxCmdRunManager"),O=w("./UI/MxUiVue"),W=w("./MxThreeJS"),X=w("./MxWindowsEvent"),J=w("./MxTools"),te=w("./MxDrawCommands"),ne=w("./MxDrawData"),ue=w("./MxLocalFileLoad"),be=w("./TempTest/MxTestJig"),je=w("./MxVersion"),ve=w("./MrxDbgUtils");function Be(se){se.cmd&&Ye(se.cmd)}function q(se){var xe=new RegExp("(^|&)"+se+"=([^&]*)(&|$)"),De=window.location.href,tt=De.indexOf("?"),st=(De=tt==-1?"":De.substring(tt)).substr(1).match(xe);return st!=null?decodeURIComponent(st[2]):""}function ge(){return k.MxManager.currentMx()}function oe(se,xe){var De={};if(se!=null)if(se instanceof Array)De.is2d=!0;else{se.length==0&&(se="empty");var tt=se.substring(se.lastIndexOf(".")+1).toLowerCase();if(tt!="dwg"&&tt!="dxf"&&tt!="dwf"&&tt!="mwg"&&tt!="wgh"||(De.is2d=!0),xe!=1&&xe!=null&&tt!="wgh"){var st=void 0,mt=se.split("/");(st=mt.length==1?mt[0]:mt[mt.length-1])[0]=="$"&&(st=st.substring(1));for(var Rt=void 0,Ot=0;Ot<mt.length-1;Ot++)Rt=Ot==0?mt[Ot]:Rt+"/"+mt[Ot];se=Rt?Rt+"/$"+st+".mxb1.wgh":"$"+st+".mxb1.wgh"}}else se="empty_template.dwg";return De.sFileName=se,De}function le(se){if(typeof se=="string"){var xe=se.substring(se.lastIndexOf(".")+1).toLowerCase();if(xe!="dwg"&&xe!="wgh"){var De=se.lastIndexOf("?");if(De!=-1){var tt=se.substring(De,se.length);return{sFileName:se=se.substring(0,De),sUrlParam:tt}}}}return null}function Pe(){return u.MxJigCmdManager.stopCmd(u.MxJigCmdManager.DetailedResult.kUnknown)}function Ye(se,xe){if(se.length!=0){var De=ge();return f.MxCmdRunManager.runCmd(De,se,xe)}Pe()}function ze(se){se!=null&&(se.init(),O.MxUiVue.init(se)),M||(console.log("MxDraw Version:"+je.MxBulid.getVersion()),M=!0,T=new ue.MxLocalNodeJs,u.MxJigCmdManager.init(),X.MxWindowsEvent.registEvent(),te.MxDrawCommands.registerCommand(),window.mxConfig_isLoadTest&&be.MxTest.registerCommand(),F.sendStringToExecute=Be)}a=o.MxFun||(o.MxFun={}),v=".",A=null,M=!(g="ws://localhost:5090"),F={},T=N=I=U=h=void 0,_=V=D=b=-1,a.getUiObj=function(){return A},a.on=function(se,xe){k.MxManager.on(se,xe)},a.callEvent=function(se,xe){return k.MxManager.callEvent(se,xe)},a.getNodeJs=function(){return T},a.setMxServer=function(se){g=se},a.getMxServer=function(){return g},a.isPC=function(){return _==-1?function(){if(!/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){var se=navigator.userAgent.toLowerCase();return 0<=se.indexOf("win64")||0<=se.indexOf("wow64")||0<=se.indexOf("win32")||0<=se.indexOf("wow32")||/macintosh|mac os x/i.test(navigator.userAgent)||!("ontouchstart"in window||0<navigator.maxTouchPoints)}}()?(_=1,!0):(_=0,!1):_==1},a.getClientPlatform=function(){return navigator.platform},a.getClientInfo=function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},a.curPath=function(){return v},a.setCurPath=function(se){v=se},a.getQueryString=q,a.getLocationPageUrl=function(){var se=window.location.href,xe=se.lastIndexOf("?");return xe==-1?se:se.substring(0,xe)},a.getHostUrl=function(){var se=window.location.hostname;return se.substring(0,4)!="http"&&(se="http://"+se),se},a.isAbsoluteWebPath=function(se){return se.substring(0,4)=="http"},a.getUrlParams=function(){var se=window.location.search,xe=se.substr(1,se.length).split("&"),De=new Array;if(xe!=null)for(var tt=0;tt<xe.length;tt++){var st=xe[tt].replace(/[=|^==]/,"&").split("&");if(1<st.length){var mt=new Array;mt.push(decodeURIComponent(st[0])),mt.push(decodeURIComponent(st[1])),De.push(mt)}}return De},a.call=function(se,xe,De){xe==null?xe="{}":typeof xe=="string"?xe.length==0?xe="{}":xe[0]=="["&&xe[xe.length-1]=="]"||xe[0]=="{"&&xe[xe.length-1]=="}"||(xe='"'+(xe=xe.replace(/"/g,"'"))+'"'):xe=typeof xe=="object"?JSON.stringify(xe):"{}",k.MxManager.currentMx().call(se,xe,De)},a.loadCodeToServer=function(se,xe){k.MxManager.currentMx().loadCodeToServer(se,xe)},a.getCurrentMx=function(){return k.MxManager.currentMx()},a.isEnableSelect=function(){if(b!=-1)return b==1;var se=q("select");return b=0,se!=null&&se.toLowerCase()=="y"&&(b=1),b==1},a.is3DDwg=function(){if(V!=-1)return V==1;var se=q("3ddwg");return V=0,se!=null&&se.toLowerCase()=="y"&&(V=1),V==1},a.isStaticLoad=function(){if(D!=-1)return D==1;var se=q("static");return D=0,se!=null&&se.toLowerCase()=="y"&&(D=1),D==1},a.enableSelect=function(se){b=se?1:0},a.enablStaticLoad=function(se){D=se==null||se?1:0},a.dwgDir=function(){return U!=null||(U=q("dwgdir"))==null&&(U=""),U},a.setDwgDir=function(se){U=se},a.getStaticServer=function(){return I!=null||(I=q("staticServer"))==null&&(I=""),I},a.setStaticServer=function(se){I=se},a.is2dParam=function(){if(h!=null)return h;var se=q("file");if(h=!1,se!=null){var xe=se.substring(se.lastIndexOf(".")+1);xe.toLowerCase()!="dwg"&&xe.toLowerCase()!="dxf"&&xe.toLowerCase()!="dwf"&&xe.toLowerCase()!="mwg"||(h=!0)}return h},a.set2dParam=function(se){h=se},a.showLayer=function(se,xe){return k.MxManager.currentMx().showLayer(se,xe)},a.screenCoord2World=function(se,xe,De){return se instanceof Object?k.MxManager.currentMx().screenCoord2World(se.x,se.y,se.z):k.MxManager.currentMx().screenCoord2World(se,xe,De)},a.worldCoord2Screen=function(se,xe,De){return se instanceof Object?k.MxManager.currentMx().worldCoord2Screen(se.x,se.y,se.z):k.MxManager.currentMx().worldCoord2Screen(se,xe,De)},a.docCoord2Cad=function(se,xe,De){return se instanceof Object?k.MxManager.currentMx().docCoord2Cad(se.x,se.y,se.z):k.MxManager.currentMx().docCoord2Cad(se,xe,De)},a.cadCoord2Doc=function(se,xe,De){return se instanceof Object?k.MxManager.currentMx().cadCoord2Doc(se.x,se.y,se.z):k.MxManager.currentMx().cadCoord2Doc(se,xe,De)},a.docCoord2World=function(se,xe,De){return se instanceof Object?k.MxManager.currentMx().docCoord2World(se.x,se.y,se.z):k.MxManager.currentMx().docCoord2World(se,xe,De)},a.worldCoord2Doc=function(se,xe,De){return se instanceof Object?k.MxManager.currentMx().worldCoord2Doc(se.x,se.y,se.z):k.MxManager.currentMx().worldCoord2Doc(se,xe,De)},a.screenCoord2Doc=function(se,xe,De){return se instanceof Object?k.MxManager.currentMx().screenCoord2Doc(se.x,se.y,se.z):k.MxManager.currentMx().screenCoord2Doc(se,xe,De)},a.docCoord2Screen=function(se,xe,De){return se instanceof Object?k.MxManager.currentMx().docCoord2Screen(se.x,se.y,se.z):k.MxManager.currentMx().docCoord2Screen(se,xe,De)},a.docCoordLong2Cad=function(se){return k.MxManager.currentMx().docCoordLong2Cad(se)},a.cadCoordLong2Doc=function(se){return k.MxManager.currentMx().cadCoordLong2Doc(se)},a.viewCoordLong2Cad=function(se){return k.MxManager.currentMx().viewCoordLong2Cad(se)},a.cadCoordLong2View=function(se){return k.MxManager.currentMx().cadCoordLong2View(se)},a.zoomCenter=function(se,xe){k.MxManager.currentMx().is2D()&&(k.MxManager.currentMx().zoomCenter(se,xe),k.MxManager.currentMx().updateDisplay())},a.zoomW=function(se,xe,De,tt,st){k.MxManager.currentMx().is2D()&&(k.MxManager.currentMx().zoomW(new Y.Vector3(se,xe,0),new Y.Vector3(De,tt,0),st),k.MxManager.currentMx().updateDisplay())},a.zoomScale=function(se){k.MxManager.currentMx().is2D()&&(k.MxManager.currentMx().zoomScale(se),k.MxManager.currentMx().updateDisplay())},a.zoomAll=function(){k.MxManager.currentMx().is2D()&&(k.MxManager.currentMx().zoomAll(),k.MxManager.currentMx().updateDisplay())},a.deleteAll=function(){return k.MxManager.currentMx().deleteAll()},a.callCommand=function(se,xe,De){k.MxManager.currentMx().callCommand(se,xe,De)},a.getCurrentColor=function(){return k.MxManager.currentMx().getCurrentColor()},a.setCurrentColor=function(se){k.MxManager.currentMx().setCurrentColor(se)},a.showLoading=function(){A!=null&&A.ShowLoading()},a.hideLoading=function(){A!=null&&A.HideLoading()},a.showProp=function(se){A!=null&&A.ShowObjectProperty(se)},a.hideProp=function(){A!=null&&A.HideObjectProp()},a.getUiObject=function(){return A},a.getViewCenterDocCoord=function(){return k.MxManager.currentMx().is2D()?k.MxManager.currentMx().getViewCenterDocCoord():new Y.Vector3(0,0,0)},a.screenCoordLong2Doc=function(se){return k.MxManager.currentMx().is2D()?k.MxManager.currentMx().screenCoordLong2Doc(se):se},a.docCoordLong2Screen=function(se){return k.MxManager.currentMx().is2D()?k.MxManager.currentMx().docCoordLong2Screen(se):se},a.worldCoordLong2Doc=function(se){return k.MxManager.currentMx().is2D()?k.MxManager.currentMx().worldCoordLong2Doc(se):se},a.docCoordLong2World=function(se){return k.MxManager.currentMx().is2D()?k.MxManager.currentMx().docCoordLong2World(se):se},a.screenCoordLong2World=function(se){return k.MxManager.currentMx().is2D()?k.MxManager.currentMx().screenCoordLong2World(se):se},a.worldCoordLong2Screen=function(se){return k.MxManager.currentMx().is2D()?k.MxManager.currentMx().worldCoordLong2Screen(se):se},a.addSelectEvent=function(se){k.MxManager.addSelectEvent(se)},a.clearSelectEvent=function(){k.MxManager.clearSelectEvent()},a.removeThreejsObject=function(se,xe,De){se&&(se.traverse(function(tt){(tt instanceof Y.Mesh||tt instanceof Y.Line||tt instanceof Y.LineLoop)&&(tt.geometry.dispose(),De&&(tt.material instanceof Array?tt.material.forEach(function(st){st.dispose()}):tt.material.dispose()))}),xe.remove(se))},a.removeThreejsAllChildren=function se(xe){for(;0<xe.children.length;){var De=xe.children[0];xe.remove(De),0<De.children.length&&se(De),De.geometry&&De.geometry.dispose(),De.material instanceof Array?De.material.forEach(function(tt){tt.dispose()}):De.material.dispose(),De.texture&&De.texture.dispose()}},a.setOutServerDebugCall=function(se){k.MxManager.setOutDebugCall(se)},a.updateDisplay=function(){k.MxManager.updateDisplay()},a.getCurrentDraw=ge,a.formatString=function(se){for(var xe=[],De=1;De<arguments.length;De++)xe[De-1]=arguments[De];for(var tt=0;tt<xe.length;tt++)se=se.replace("{"+tt+"}",xe[tt]);return se},a.createMxUiObject=function(se){var xe;return xe=this.isPC()?new R.MxUiObjectPC:new B.MxUiObjectMobile,se(A=xe),xe.create(),xe},a.openFile=function(se,xe){var De="";if(typeof se=="string"){var tt=le(se);tt&&(De=tt.sUrlParam,se=tt.sFileName)}xe==null&&(xe=!1);var st=oe(se,xe);return st.is2d&&(h=st.is2d),se=st.sFileName,k.MxManager.currentMx().openFile(se,De)},a.createMxObject=function(se,xe,De,tt,st,mt,Rt,Ot){M||ze(),typeof se=="string"&&(se=se.length==0?void 0:document.getElementById(se));var He=null,Vt="";if(Ot)xe="",(He=new G.MxDrawObject2d).initRunMode(S.MxRunMode.kCPPMxCAD),He.setViewColor(0);else{if(xe==null)xe=a.getQueryString("file");else{var jt=le(xe);jt&&(Vt=jt.sUrlParam,xe=jt.sFileName)}var Ln=tt==null||tt;if(xe===void 0||xe.length==0||xe=="empty")Ln=!0,xe=xe=="empty"?"":"empty_template.dwg";else{var nn=oe(xe,mt);nn.is2d&&(Ln=nn.is2d),xe=nn.sFileName}st==1&&(xe=""),Ln?(He=new G.MxDrawObject2d).setViewColor(0):(He=new C.MxDrawObject3d).setViewColor(15790320)}return De!=null&&De(He),He.create(se,xe,Vt,Rt),He},a.getMxObjectFormElement=function(se){return k.MxManager.getMxObject(se)},a.initMxCpp=function(se){k.MxManager.initMxCpp(se)},a.isRunningCommand=function(){return u.MxJigCmdManager.isRunning()},a.getRunningCommand=function(){return u.MxJigCmdManager.getCurCmd()},a.stopRunCommand=Pe,a.runCommand=function(se){return u.MxJigCmdManager.runCmd(se)},a.getTHREE=function(){return Y},a.getLine=function(se){var xe=new c.MxJigGetLine;xe.setRetCall(se),u.MxJigCmdManager.runCmd(xe)},a.addCommand=function(se,xe,De){f.MxCmdRunManager.addCommand(se,xe,De)},a.sendStringToExecute=Ye,a.getMxEntity=function(se){var xe=ge();return xe?xe.getMxEntityUserObject(se):null},a.initUiDataObject=function(se){O.MxUiVue.isNull()&&(se.init(a),O.MxUiVue.init(se))},a.init=ze,a.addWindowsEvent=function(se){X.MxWindowsEvent.addEvent(se)},a.getCurrentMousePostion=function(){return ge().getCurrentMousePostion()},a.getMxThreeJS=function(){return W.MxThreeJS},a.getMxTools=function(){return J.MxTools},a.getMxCmdRunManager=function(){return f.MxCmdRunManager},a.getMxJigCmdManager=function(){return u.MxJigCmdManager},a.initQuickCommand=function(se){f.MxCmdRunManager.InitQuickCommand(se)},a.InitLanguageString=function(se){f.MxCmdRunManager.InitLanguageString(se)},a.getLanguageString=function(se,xe){return xe===void 0&&(xe=""),f.MxCmdRunManager.getLanguageString(se,xe)},a.Assert=function(se){se||console.log("MxAssert error")},a.setIniset=function(se){ne.MxDrawData.setIniset(se)},a.getIniSet=function(){return ne.MxDrawData.getIniSet()},a.setPostMessageToParentFrameFunction=function(se){N=se},a.postMessageToParentFrame=function(se){return N!=null&&(N(se),!0)},a.onParentFrameMessage=function(se){se!=null&&se.type!=null&&F[se.type]&&F[se.type](se)},a.acutPrintf=function(se){for(var xe=[],De=1;De<arguments.length;De++)xe[De-1]=arguments[De];if(!O.MxUiVue.isNull()){for(var tt=arguments,st=tt[0],mt=0;mt<tt.length-1;mt++){var Rt=new RegExp("\\{"+mt+"\\}","gm");st=st.replace(Rt,tt[mt+1])}O.MxUiVue.AcutPrintfNoFormat(st,!0)}},a.loadImageMaterial=function(se,xe){k.MxManager.getMxDbTextureManager().loadImage(se,xe)},a.loadSVG=function(se,xe,De,tt){k.MxManager.getMxDbSvgManager().loadSVG(se,xe,De,tt)},a.initMxDbEntityType=function(se){k.MxManager.getMxDbEntityClassHierarchy().init(se)},a.initDynamicCreate=function(se){k.MxManager.getMxDbEntityClassHierarchy().initDynamic(se)},a.ceneratecursor=function(se,xe,De,tt){se===void 0&&(se=128),xe===void 0&&(xe=10),De===void 0&&(De=!0);var st=document.createElement("canvas");st.width=st.height=se,st.style.background="transparent";var mt=st.getContext("2d"),Rt=se%2==0?-.5:0,Ot=xe%2==0?-.5:0;mt.strokeStyle=tt||"#fff",De&&(mt.beginPath(),mt.moveTo(st.width/2+Rt,Rt),mt.lineTo(st.width/2+Rt,st.height+Rt),mt.stroke(),mt.beginPath(),mt.moveTo(Rt,st.height/2+Rt),mt.lineTo(st.width+Rt,st.height/2+Rt),mt.stroke()),mt.beginPath(),mt.strokeRect(se/2-xe/2+Ot,se/2-xe/2+Ot,xe,xe),mt.stroke();var He=new Image;return He.src=st.toDataURL("image/png"),He.src},a.getMrxDbgUtilsClass=function(){return ve.MrxDbgUtils},a.getNumberColor=function(se){return se instanceof Object?se.getHex&&(se=se.getHex()):typeof se=="string"&&(se=parseInt(se)),se},a.setloadImageFuction=function(se){k.MxManager.setloadImageFuction(se)}},{"./MrxDbgUtils":20,"./MxDrawCommands":21,"./MxDrawData":22,"./MxDrawObject":23,"./MxDrawObject2d":24,"./MxDrawObject3d":25,"./MxLocalFileLoad":28,"./MxManager":29,"./MxThreeJS":37,"./MxTools":38,"./MxVersion":40,"./MxWindowsEvent":41,"./Operate/MxCmdRunManager":48,"./Operate/MxJigCmdManager":54,"./Operate/MxJigGetLine":55,"./TempTest/MxTestJig":61,"./UI/MxUiObjectMobile":63,"./UI/MxUiObjectPC":64,"./UI/MxUiVue":65,three:19}],28:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxLocalDwgFileLoad=o.MxLocalFileLoad=o.MxLocalNodeJs=void 0;var a=w("./MxFun"),v=(h.prototype.init=function(I){this.loadFileCall=I.loadFileFun},h.prototype.loadFile=function(I,g,A,M,N){this.loadFileCall!=null?this.loadFileCall(I,g,A,M,N):N(void 0)},h);function h(){this.loadFileCall=null}o.MxLocalNodeJs=v;var b=(D.prototype.setPath=function(I){this.path=I},D.prototype.setBinary=function(I){this.isBinary=I},D.prototype.load=function(I,g,A,M){a.MxFun.getNodeJs().loadFile(this.path+I,this.isBinary,g,A,M)},D);function D(){this.path="",this.isBinary=!1}o.MxLocalFileLoad=b;var U=(V.prototype.setShowloading=function(I){this._isShowLoading=I},V.prototype.load=function(I,g){var A="$"+g+".mxb1.wgh";this._path=I,this._filename=g;var M=this;this.getFile(this._path,A,!1,function(N){typeof N=="string"?M.net.onStaticHeadMessage(N):console.log("mx error h1")},function(){console.log("mx get "+A+" faild")})},V.prototype.getDatas=function(){if(this._iGet>=this._dataNum)this._isShowLoading&&a.MxFun.hideLoading();else{var I=this._dataType[this._iGet];this._iGet++;var g=this,A=this._iGet+1,M="$"+this._filename+".mxb"+A+".wgh",N=I!=0;this.getFile(this._path,M,N,function(F){g.net.onStaticMessage(F),g.getDatas()},function(){g._dataNum=0,g._iGet=0,g._isShowLoading&&a.MxFun.hideLoading(),console.log("mx get "+M+" faild")})}},V.prototype.onRenderHead=function(I){var g=JSON.parse(I);this._dataType=g.type,this._dataNum=g.count,this._iGet=0,this._isShowLoading&&a.MxFun.showLoading(),this.getDatas()},V.prototype.getFile=function(I,g,A,M,N){var F=new b;F.setPath(I),F.setBinary(A),F.load(g,M,function(){},N)},V);function V(I){this.net=null,this._dataNum=0,this._iGet=0,this._dataType=[],this._path="",this._filename="",this._isShowLoading=!0,this.net=I}o.MxLocalDwgFileLoad=U},{"./MxFun":27}],29:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxManager=o.MxCpp=o.MxData=void 0;var a,v=w("./View/MxDbEntity"),h=w("./View/MxDbTextureManager"),b=w("./SVGLoader/MxSVGLoader");(a=o.MxData||(o.MxData={})).iSelectRenderOrder=5,a.iCADMeshRenderOrder=10,a.iCADCurveRenderOrder=20,a.iMxEntityRenderOrder=30,a.iGripRenderOrder=110,a.iDynJigRenderOrder=120;var D,U,V,I,g,A,M,N,F,T,_,Y,k=(S.prototype.init=function(G){this.imp=G},S.prototype.getMxCAD_MxCpp=function(){return this.imp},S.prototype.getMxCAD_App=function(){return this.imp.App},S.prototype.newMcGePoint3d=function(G){return this.imp?this.imp.newMcGePoint3d(G):null},S.prototype.decodeFromGb2312=function(G){return this.imp.decodeFromGb2312(G)},S.prototype.encodeToGb2312=function(G){return this.imp.encodeToGb2312(G)},S.prototype.getMcDbCurve=function(G){if(this.imp.App.objectIdIsKindOf(G,"McDbCurve"))return this.imp.App.objectIdToObject(G)},S);function S(){}o.MxCpp=k,D=o.MxManager||(o.MxManager={}),U=[],V=null,g=[],A=void(I=0),M=new h.MxDbTextureManager,N=new b.MxSvgManager,F=new v.MxDbEntityClassHierarchy,T=new k,_={},Y=void 0,D.add=function(G){U.push(G)},D.setloadImageFuction=function(G){Y=G},D.getLoadImageFuction=function(){return Y},D.on=function(G,C){_[G]||(_[G]=[]),_[G].push(C)},D.callEvent=function(G,C){var B;if(_[G])return _[G].forEach(function(R){var u=R(C);B=B||u}),B},D.initMxCpp=function(G){T.init(G)},D.getMxCpp=function(){return T},D.allocId=function(){return++I},D.getMxDbEntityClassHierarchy=function(){return F},D.getMxDbTextureManager=function(){return M},D.getMxDbSvgManager=function(){return N},D.outDebugString=function(G){A==null?console.log(G):A(G)},D.setOutDebugCall=function(G){A=G},D.onLoad=function(){for(var G in U)U[G].onLoad("")},D.updateDisplay=function(){for(var G in U)U[G].updateDisplay()},D.currentMx=function(){return V},D.setCurrentMx=function(G){V=G},D.initResize=function(){for(var G in U)U[G].initResize()},D.addSelectEvent=function(G){g.push(G)},D.clearSelectEvent=function(){g=[]},D.callSelectObject=function(G){for(var C in g)if(g[C](G)==1)break},D.getMxObject=function(G){if(typeof G=="number"){for(var C in U)if(U[C].getId()===G)return U[C]}else for(var C in U)if(U[C].getCanvas()===G)return U[C];return null}},{"./SVGLoader/MxSVGLoader":59,"./View/MxDbEntity":69,"./View/MxDbTextureManager":74}],30:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxMaterial=void 0;var a=w("three");(function(v){v.shaderUniforms={crAmbient:{value:new a.Vector3(1,0,0)},crDiffuse:{value:new a.Vector3(1,0,0)},crSpecular:{value:new a.Vector3(1,0,0)}},v.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),v.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),v.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),v.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),v.m_selectMaterial=new a.MeshPhongMaterial({color:255,opacity:.2,transparent:!0,side:a.DoubleSide}),v.m_mouseMoveMaterial=new a.MeshPhongMaterial({color:16776960,side:a.DoubleSide}),v.m_lockedMaterial=new a.MeshPhongMaterial({color:197379,side:a.DoubleSide}),v.m_samplePoints=new a.PointsMaterial({color:255,depthTest:!1,size:8}),v.m_samplePointsMouseMove=new a.PointsMaterial({color:16711680,depthTest:!1,size:12});var h=new a.MeshBasicMaterial({color:16777215,transparent:!0,depthTest:!1,side:a.DoubleSide,opacity:1,stencilWrite:!1,colorWrite:!1});v.getStencilMaterial=function(){return h},v.GetColorByIndex=function(b){return v.m_arrSystemColors[b]},v.GetColorMaterial=function(b){var D=v.m_arrDefUseMaterials[b];return D===null&&(D=new a.MeshLambertMaterial({color:v.m_arrSystemColors[b],side:a.DoubleSide}),v.m_arrDefUseMaterials[b]=D),D},v.GetBaseColorMaterial=function(b){var D=v.m_arrDefUseBasicMaterials[b];return D===null&&(D=new a.MeshBasicMaterial({color:v.m_arrSystemColors[b],side:a.DoubleSide}),v.m_arrDefUseMaterials[b]=D),D},v.GetCurveColorMaterial=function(b){var D=v.m_arrDefUseCurveMaterials[b];return D===null&&(D=new a.LineBasicMaterial({color:v.m_arrSystemColors[b],linewidth:1}),v.m_arrDefUseCurveMaterials[b]=D),D},v.GetSelectMaterial=function(){return v.m_selectMaterial},v.GetMouseMoveMaterial=function(){return v.m_mouseMoveMaterial},v.GetLockedMaterial=function(){return v.m_lockedMaterial},v.GetSamplePointsMaterial=function(){return v.m_samplePoints},v.GetSamplePointsMouseMoveMaterial=function(){return v.m_samplePointsMouseMove},v.createMaterial=function(b){var D=void 0;if(b==null)return D;function U(V,I){if(I.map!=null){var g=I.map,A=new a.TextureLoader().load(g);A.wrapS=A.wrapT=a.RepeatWrapping,V.map=A,V.side=a.DoubleSide}}return b.transparent!=0?b.transparent=!0:b.transparent=!1,b.name=="MeshPhongMaterial"?U(D=new a.MeshPhongMaterial(b),b):b.name=="MeshBasicMaterial"?U(D=new a.MeshBasicMaterial(b),b):b.name=="MeshDepthMaterial"?U(D=new a.MeshDepthMaterial(b),b):b.name=="MeshNormalMaterial"?U(D=new a.MeshNormalMaterial(b),b):b.name=="MeshLambertMaterial"?U(D=new a.MeshLambertMaterial(b),b):b.name=="MeshStandardMaterial"&&U(D=new a.MeshStandardMaterial(b),b),D}})(o.MxMaterial||(o.MxMaterial={}))},{three:19}],31:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxHFileLoad=o.MxNet=o.MxNetBinMessageType=o.MxNetSend=o.MxNetMessage=o.MxNetMessageType=o.MxNetData=void 0;var a,v,h=w("three"),b=w("./MxFun"),D=w("pako"),U=w("./MxManager"),V=w("./MxDrawData"),I=(g.prototype.getId=function(){return this._dataView.getInt32(4,!0)},g.prototype.getVersion_MwBlobHead=function(){return this._dataView.getInt32(60,!0)},g.prototype.getVersion_MwBlobHeadDynLen=function(){return this._dataView.getInt32(4,!0)},g.prototype.getdPointCurveBuffersHead=function(){var C={};return C.ver=this._dataView.getInt32(4,!0),C.databaseIndex=this._dataView.getInt32(8,!0),C.zeroLayerIdIndex=this._dataView.getInt32(16,!0),C.datacount=this._dataView.getInt32(20,!0),C.datasize=this._dataView.getInt32(24,!0),C},g.prototype.getdPointMeshBuffersHead=function(){var C={};return C.ver=this._dataView.getInt32(4,!0),C.databaseIndex=this._dataView.getInt32(8,!0),C.id=this._dataView.getInt32(12,!0),C.zeroLayerIdIndex=this._dataView.getInt32(16,!0),C.datacount=this._dataView.getInt32(20,!0),C.datasize=this._dataView.getInt32(24,!0),C},g.prototype.getdPointTextureBuffersHead=function(){var C={};return C.ver=this._dataView.getInt32(4,!0),C.databaseIndex=this._dataView.getInt32(8,!0),C.zeroLayerIdIndex=this._dataView.getInt32(16,!0),C.datacount=this._dataView.getInt32(20,!0),C.datasize=this._dataView.getInt32(24,!0),C},g.prototype.getBlobHeadForMemorySectionsHead=function(C){var B={};return B.type=this._dataView.getInt32(C,!0),C+=4,B.ver=this._dataView.getInt32(C,!0),C+=4,B.databaseIndex=this._dataView.getInt32(C,!0),C+=4,B.nOffset=C,B},g.prototype.getMemorySectionsHead=function(){var C=this.getBlobHeadForMemorySectionsHead(0);return C.zeroLayerIdIndex=this._dataView.getInt32(C.nOffset,!0),C.nOffset+=4,C.datacount=this._dataView.getInt32(C.nOffset,!0),C.nOffset+=4,C.datasize=this._dataView.getInt32(C.nOffset,!0),C.nOffset+=4,C.datasize!=C.nOffset&&console.log("mx: sectionshead size assert(0)"),C},g.prototype.getMemorySectionHead=function(C){var B=this.getBlobHeadForMemorySectionsHead(C);return C=B.nOffset,B.pointCount=this._dataView.getInt32(C,!0),C+=4,B.layerId=this._dataView.getInt32(C,!0),C+=4,B.blkId=this._dataView.getInt32(C,!0),C+=4,B.memColor=this._dataView.getInt32(C,!0),C+=4,B.memId=this._dataView.getInt32(C,!0),C+=4,B.memType=this._dataView.getInt32(C,!0),C+=4,B.offset=C,B},g.prototype.getdPointTextureBufferDataHead=function(C){C+=4,C+=4,C+=4;var B={};return B.dataCount=this._dataView.getInt32(C,!0),C+=4,B.layerId=this._dataView.getInt32(C,!0),C+=4,B.blkId=this._dataView.getInt32(C,!0),C+=4,B.offset=C,B},g.prototype.getdPointCurveBufferDataHead=function(C){C+=4,C+=4,C+=4;var B={};return B.pointCount=this._dataView.getInt32(C,!0),C+=4,B.layerId=this._dataView.getInt32(C,!0),C+=4,B.blkId=this._dataView.getInt32(C,!0),C+=4,B.offset=C,B},g.prototype.getdPointMeshBufferDataHead=function(C){C+=4,C+=4,C+=4;var B={};return B.pointCount=this._dataView.getInt32(C,!0),C+=4,B.layerId=this._dataView.getInt32(C,!0),C+=4,B.blkId=this._dataView.getInt32(C,!0),C+=4,B.offset=C,B},g.prototype.getDatabaseIndex=function(){return this._dataView.getInt32(8,!0)},g.prototype.getColorIndex=function(){return this._dataView.getInt32(24,!0)},g.prototype.getBufferType=function(){return this._dataView.getInt32(32,!0)},g.prototype.getIsSketchEntity=function(){return this._dataView.getInt32(40,!0)},g.prototype.getLayerId=function(){return this._dataView.getInt32(44,!0)},g.prototype.getBlockId=function(){return this._dataView.getInt32(48,!0)},g.prototype.getVertexBufferSize=function(){return this._dataView.getInt32(12,!0)},g.prototype.getIndexBufferSize=function(){return this._dataView.getInt32(16,!0)},g.prototype.getZeroLayerId=function(){return this._dataView.getInt32(52,!0)},g.prototype.getSelectMark=function(){return this._dataView.getInt32(56,!0)},g.prototype.getMateria=function(){var C=this._dataView.getInt32(36,!0);if(C==0)return"";for(var B=[],R=0;R<C;R++){var u=String.fromCharCode(this._dataView.getUint8(80+R));B.push(u)}return B.join("")},g.prototype.getDrawDataOffset=function(){return this._dataView.getInt32(36,!0)+80},g.prototype.getMesh=function(){var C=this._dataView.getInt32(4,!0),B=this._dataView.getInt32(32,!0)==0,R={},u=this._dataView.getInt32(12,!0),c=this._dataView.getInt32(16,!0);if(u===0||c===0)return R.size=80,R;var f,O=new h.Geometry,W=80;f=B?u/4/8:u/4/2;for(var X=0;X<f;X++){var J=this._dataView.getFloat32(W+0,!0),te=this._dataView.getFloat32(W+4,!0),ne=0;B?(ne=this._dataView.getFloat32(W+8,!0),this._dataView.getFloat32(W+12,!0),this._dataView.getFloat32(W+16,!0),this._dataView.getFloat32(W+20,!0),this._dataView.getFloat32(W+24,!0),this._dataView.getFloat32(W+28,!0),W+=32):W+=8;var ue=new h.Vector3(J,te,ne);O.vertices.push(ue)}var be=c/4;for(X=0;X<be;X+=3){var je=this._dataView.getInt32(W,!0);W+=4;var ve=this._dataView.getInt32(W,!0);W+=4;var Be=this._dataView.getInt32(W,!0);W+=4;var q=new h.Face3(je,ve,Be);O.faces.push(q)}var ge=this.getIsSketchEntity();return R.size=W,R.geometry=O,R.id=C,R.isSketchEntity=ge,R.nColorIndex=this._dataView.getInt32(24,!0),R},g.prototype.getCurve=function(C){var B,R=this._dataView.getInt32(32,!0),u=this.getIsSketchEntity(),c=R==0,f={};if((B=c?this._dataView.getInt32(20,!0)/4/3:this._dataView.getInt32(20,!0)/4/2)<2)return f;for(var O=new h.Geometry,W=C,X=0;X<B;X++){var J=this._dataView.getFloat32(W,!0);W+=4;var te=this._dataView.getFloat32(W,!0);W+=4;var ne=0;c&&(ne=this._dataView.getFloat32(W,!0),W+=4),O.vertices.push(new h.Vector3(J,te,ne))}var ue=this._dataView.getInt32(4,!0);return f.size=W,f.geometry=O,f.id=ue,f.isSketchEntity=u,f.colorIndex=this._dataView.getInt32(28,!0),f},g);function g(C){this._dataView=C}o.MxNetData=I,(v=a=o.MxNetMessageType||(o.MxNetMessageType={})).kAddLayer="00000007",v.kClearLayer="00000008",v.kHideLayer="00000009",v.kShowLayer="00000010",v.kUpdateDisplayRange="00000011",v.kCallJsReturn="00000012",v.kLayerData="00000013",v.kSendDebugString="00000014",v.kShowLoading="00000015",v.kHideLoading="00000016",v.kSelectObject="00000017",v.kGlRenderHead="00000018",v.kUserLoginResult="00000019",v.kOpenFileResult="00000020",v.kServerReturn="00000021",v.kMxCADLayerData="00000056",v.kMxCADSystemVariable="00000057";var A=(M.prototype.setJsRetCall=function(C,B,R){this.serverJsRetCall.set(B+R,C)},M.prototype.onSocketErrort=function(){this.serverJsRetCall.forEach(function(C){C(void 0)}),this.serverJsRetCall=new Map},M.prototype.Do=function(C){var B=this.net.getCurrentDatabaseId();if(B==-1){var R=C.substring(0,4);B=parseInt(R)}var u=C.substring(4,12),c=C.substring(12);return this.messageCall[u]!=null&&(this.messageCall[u](c,B),!0)},M);function M(C,B){this.messageCall=new Map,this.serverJsRetCall=new Map,this.net=null,this.net=B;var R=this;this.messageCall[a.kUpdateDisplayRange]=function(u){if(!R.net.isTzDwgStaticFile()){u=u.replace(/\\/g,"\\\\");try{var c=JSON.parse(u);if(c!=null&&C.is2D()){C.initCAD2Doc(new h.Matrix4),c.newbrownermode?c.DToSMat?V.MxDrawData.m_isCorrectLargeCoordinates?(C.intiDoc2Wold(new h.Matrix4),C.initCAD2Doc(c.DToSMat)):C.intiDoc2Wold(c.DToSMat):C.intiDoc2Wold(new h.Matrix4):C.intiDoc2Wold(c.DToWMat),C.initializingObjectMatrix(),C.updateCameraDisplayRange(new h.Vector3(+c.pt1[0],+c.pt1[1],+c.pt1[2]),new h.Vector3(+c.pt2[0],+c.pt2[1],+c.pt2[2]),+c.viewangle),C.initAllLayoutName(c.layout),C.updateDisplay(!0);var f=b.MxFun.getUiObj();f!=null&&(f.SetLayoutData(c.layout),f.UpDisplayLayout())}}catch(O){console.log("UpdateDisplayRange exception")}}},this.messageCall[a.kCallJsReturn]=function(u){if(u.length!=0){var c=JSON.parse(u);c.cmd.length==0&&(c.cmd="__mx_loadcode");var f=c.cmd+c.count,O=R.serverJsRetCall.get(f);O&&(R.serverJsRetCall.delete(f),typeof c.ret=="string"&&(c.ret=c.ret.replace(/\'/g,'"')),O(c.ret))}else console.log("assert(0),kCallJsReturn return empty")},this.messageCall[a.kSendDebugString]=function(u){U.MxManager.outDebugString(u)},this.messageCall[a.kUserLoginResult]=function(u){C.userLoginResult(u)},this.messageCall[a.kOpenFileResult]=function(u){C.openFileResult(u)},this.messageCall[a.kServerReturn]=function(u){C.serverReturn(u)},this.messageCall[a.kShowLoading]=function(u){R.net.isTzDwgStaticFile()||b.MxFun.showLoading()},this.messageCall[a.kHideLoading]=function(u){R.net.isTzDwgStaticFile()||(b.MxFun.hideLoading(),C.callInitCompleteEvent())},this.messageCall[a.kSelectObject]=function(u){var c=JSON.parse(u);U.MxManager.callSelectObject(parseInt(c.id))},this.messageCall[a.kGlRenderHead]=function(u){C.isStaticLocalLoad()?C.getStaticLocalNet().onRenderHead(u):(R.net.isTzDwgStaticFile()?C.getStaticLoadTzNet():C.getStaticNet()).onRenderHead(u)},this.messageCall[a.kMxCADSystemVariable]=function(u,c){C.sysVariable().OnMessageMxCADSystemVariable(u)},this.messageCall[a.kLayerData]=function(u,c){if(c==0){if(C.addLayerInfoComplete(),(X=JSON.parse(u))!=null){if(!X.isSketch){var f=X.list;for(var O in f)C.addLayerInfo(f[O].id,f[O].colorvalue,f[O].name),f[O].zerolayer==1&&C.setZeroLayerId(f[O].id)}X.isSketch||C.callEvent("uiSetLayerData",X.list);var W=b.MxFun.getUiObj();W!=null&&(X.isSketch?W.SetSketchLayerData(X.list):W.SetLayerData(X.list),W.UpDisplayLayer())}}else{var X,J=C.getExtRefManager().getLayers(c);if(J.initComplete(),(X=JSON.parse(u))!=null)for(var O in f=X.list)J.add(f[O].id,f[O].colorvalue,f[O].name),f[O].zerolayer==1&&J.setZeroLayerId(f[O].id)}}}o.MxNetMessage=A;var N,F,T=(_.prototype.setWebSocket=function(C){this._webSocket=C},_.prototype.UndoMark=function(){this._webSocket!=null&&this._webSocket.send(this.SendType.kUndoMark+"")},_.prototype.DoCommand=function(C,B,R){this._webSocket!=null&&(R!=null?(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(R,C,this._callCount),B==null&&(B=""),this._webSocket.send(this.SendType.kCmdEx+","+C+","+this._callCount+","+B)):B==null?this._webSocket.send(this.SendType.kCmd+","+C):this._webSocket.send(this.SendType.kCmd+","+C+","+B))},_.prototype.OpenFile=function(C){this._webSocket!=null&&this._webSocket.send(this.SendType.kOpenFile+","+C)},_.prototype.UserLogin=function(C,B,R){if(this._webSocket!=null){var u={};u.IdentitySign=C,u.RandomToken=B==null?"":B,u.Init=R==null?"":R,this._webSocket.send(this.SendType.kUserLogin+","+JSON.stringify(u))}},_.prototype.Init=function(C){this._webSocket!=null&&this._webSocket.send(this.SendType.kInit+","+C)},_.prototype.CallServerJS=function(C,B,R){this._webSocket!=null&&(R==null?B==null||B==null||B.length==0?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+C+'","param":"{}"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+C+'","param":'+B+"}"):(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(R,C,this._callCount),B==null||B==null||B.length==0?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+C+'","param":"{}","count":"'+this._callCount+'"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+C+'","param":'+B+',"count":"'+this._callCount+'"}')))},_.prototype.CallLoadCodeToServer=function(C,B){this._webSocket!=null&&(this._msg.setJsRetCall(B,"__mx_loadcode",0),C!=null&&C!=null&&C.length!=0&&this._webSocket.send(this.SendType.kCallJS+","+C))},_.prototype.DeleteObject=function(C){this._webSocket!=null&&this._webSocket.send(this.SendType.kDelete+","+C)},_.prototype.SelectObject=function(C){this._webSocket!=null&&this._webSocket.send(this.SendType.kSelect+","+C)},_.prototype.QuitSelectObject=function(C){this._webSocket!=null&&this._webSocket.send(this.SendType.kQuitSelect+","+C)},_.prototype.SendDragDrawEntity=function(C){this._webSocket!=null&&this._webSocket.send(this.SendType.kAddDragDraw+","+C)},_.prototype.SendDragDrawRequest=function(){this._webSocket!=null&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kRequestDragDraw))},_.prototype.SendDragDrawDetermine=function(){this._webSocket!=null&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kDetermineDragDraw))},_.prototype.SendDragDrawCancel=function(){this._webSocket!=null&&this._webSocket.send(this.SendType.kCancelDragDraw)},_.prototype.SendMousePickRay=function(){this._webSocket},_);function _(C,B){this.SendType={},this._callCount=1,this._webSocket=C,this._msg=B,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}o.MxNetSend=T,(F=N=o.MxNetBinMessageType||(o.MxNetBinMessageType={})).eBlockRef=10,F.eEntitysData=14,F.eAddEntityFor2dPointTextureBuffers=15,F.eMxNewMemorySections=16,F.kMxCADBlockRef=56,F.kMxCADMemorySections=57,F.kMxCADMemorySectionsFromChange=59,F.kMxCADNotUseMemorySectionsForChage=61,F.kMxCADEntityDisplayDatas=62;var Y=(k.prototype.setCurrentDatabaseId=function(C){this._iCurrentDatabaseId=C},k.prototype.getMxDrawObject=function(){return this._mx},k.prototype.getCurrentDatabaseId=function(){return this._iCurrentDatabaseId},k.prototype.isTzDwgStaticFile=function(){return this._iCurrentDatabaseId!=-1},k.prototype.onBinMessage=function(C){var B=this._mx,R=D.inflate(C),u=new DataView(R.buffer),c=u.getInt32(0,!0);this._binMessageCall.has(c)?this._binMessageCall.get(c)(u,this._iCurrentDatabaseId):(this._iCurrentDatabaseId==-1&&(c==0?B.mxWebAddEntity(u):c==6?B.removeEntityFromServer(u):c==11&&B.getExtRefManager().createExternalReferences(u)),c==12?B.mxWebAddEntityFor2dPointCurveBuffers(u,this._iCurrentDatabaseId):c==13?B.mxWebAddEntityFor2dPointMeshBuffers(u,this._iCurrentDatabaseId):c==8?B.mxWebAddEntityFor2dPointCurveBuffer(u,this._iCurrentDatabaseId):c==9?B.mxWebAddEntityFor2dPointMeshBuffer(u,this._iCurrentDatabaseId):c==N.eBlockRef&&B.mxWebCreateAllBlocks(u,this._iCurrentDatabaseId))},k.prototype.socket_onErrort=function(){this._msg.onSocketErrort()},k.prototype.socket_onMessageImp=function(C,B){if(B===void 0&&(B=!1),typeof C=="string")this._msg.Do(C);else if(B)this.onBinMessage(C);else{var R=new FileReader;R.readAsArrayBuffer(C);var u=this;R.onload=function(c){u._mx.updateDisplay(),u.onBinMessage(R.result)}}this._mx.updateDisplay()},k.prototype.initBinMessage=function(){var C=this._mx;this._binMessageCall.set(N.eEntitysData,function(B,R){C.mxWebEntitysData(B,R)}),this._binMessageCall.set(N.eAddEntityFor2dPointTextureBuffers,function(B,R){C.mxWebAddEntityFor2dPointTextureBuffers(B,R)}),this._binMessageCall.set(N.eMxNewMemorySections,function(B,R){C.mxWebAddEntityForMemorySections(B,R)})},k.prototype.init=function(C,B){var R=this;this._mx=C,this._msg=new A(C,this),this.initBinMessage(),B&&(this._webSocket=new WebSocket(b.MxFun.getMxServer()),this._webSocket.onopen=function(){var u=R._mx.getIniParam();if(u.length!=0){for(var c="{",f=u.length,O=0;O<f;O++)c=O==0?c+'"'+u[O][0]+'":"'+u[O][1]+'"':c+',"'+u[O][0]+'":"'+u[O][1]+'"';c+="}",R._send.Init(c)}},this._webSocket.onmessage=function(u){R.socket_onMessageImp(u.data)},this._webSocket.onerror=function(){console.log("mx: socket error"),R.socket_onErrort()}),this._send=new T(this._webSocket,this._msg)},k.prototype.closeWebSocket=function(){this._webSocket&&(this._send.setWebSocket(null),this._webSocket.close(),this._webSocket=null)},k.prototype.getOnMessage=function(){return this._msg},k.prototype.getSend=function(){return this._send},k.prototype.onStaticMessage=function(C){try{return this.socket_onMessageImp(C,!0),!0}catch(B){return console.log("mx file data error!"),console.log(B),!1}},k.prototype.onStaticHeadMessage=function(C){return typeof C=="string"&&this._msg.Do(C)},k);function k(){this._webSocket=null,this._send=null,this._msg=null,this._mx=null,this._binMessageCall=new Map,this._iCurrentDatabaseId=-1}o.MxNet=Y;var S=(G.prototype.stopAllLoading=function(){this._isStopLoading||(this._isStopLoading=!0,this._isShowLoading&&b.MxFun.hideLoading())},G.prototype.setShowloading=function(C){this._isShowLoading=C},G.prototype.showLoading=function(){this._isShowLoading&&b.MxFun.showLoading()},G.prototype.hideLoading=function(C){this._isStopLoading||(this._isShowLoading&&b.MxFun.hideLoading(),this.net.getMxDrawObject().callInitCompleteEvent(),this.net.getMxDrawObject().callOpenFileComplete(C))},G.prototype.setRequestHeader=function(C){this._requestHeader=C},G.prototype.setUrlParam=function(C){this._urlParam=C},G.prototype.load=function(C,B){var R=b.MxFun.curPath(),u=b.MxFun.dwgDir(),c=b.MxFun.getStaticServer(),f="/buf/";if(C.substring(C.lastIndexOf(".")+1).toLowerCase()=="wgh"){f="/";var O=C.substring(0,C.indexOf(".mxb1.wgh")).split("/");(C=O.length==1?O[0]:(c=C.substring(0,C.lastIndexOf("/")),O[O.length-1]))[0]=="$"&&(C=C.substring(1))}var W="$"+(C=encodeURIComponent(C))+".mxb1.wgh";c.length!=0?R=c+f:u.length!=0?R=R+"/"+u+f:R+=f,this._path=R,this._filename=C,1<(this._staticLoadingOpenFiles=B).length&&(W=B[0],this._path=void 0);var X=this;this.getFile(this._path,W,function(J){if(!X._isStopLoading)return typeof J!="string"?(console.log("mx error h1"),void X.hideLoading(4)):X.net.onStaticHeadMessage(J)?void 0:(console.log("mx error h1:"+J),void X.hideLoading(2))},function(){X.hideLoading(3),console.log("mx get "+W+" faild")})},G.prototype.getData=function(){if(this._isStopLoading)this.hideLoading(5);else if(this._iGet>=this._dataNum)this.hideLoading(0);else{var C=this._dataType[this._iGet];this._iGet++;var B=this,R=this._iGet+1,u="$"+this._filename+".mxb"+R+".wgh";if(1<this._staticLoadingOpenFiles.length){if(this._iGet>=this._staticLoadingOpenFiles.length)return console.log("Mx staticLoadingOpenFiles error!"),void this.hideLoading(7);u=this._staticLoadingOpenFiles[this._iGet]}var c=u;this._path&&(c=this._path+u);var f=c.substring(0,c.lastIndexOf("/")+1);if(this.net.getMxDrawObject().setCurrentLoadUrl(f),C==0)this.getFile(this._path,u,function(X){B._isStopLoading||(B.net.onStaticMessage(X)||(console.log(this._path),console.log(u)),B.getData())},function(){B._dataNum=0,B._iGet=0,B.hideLoading(8),console.log("mx get "+u+" faild")});else{var O=new XMLHttpRequest,W=u;this._path&&(W=this._path+u),this._urlParam.length!=0?O.open("GET",W+this._urlParam):O.open("GET",W),V.MxDrawData.m_isRequestHeaderCacheControl&&O.setRequestHeader("Cache-Control","max-age=7200"),this._requestHeader.length!=0&&O.setRequestHeader("usertoken",this._requestHeader),O.responseType="arraybuffer",O.onload=function(){B._isStopLoading||(B.net.onStaticMessage(O.response)||console.log(W),B.getData())},O.addEventListener("error",function(X){B._dataNum=0,B._iGet=0,B.hideLoading(9),console.log("mx get "+u+" faild")},!1),O.send()}}},G.prototype.onRenderHead=function(C){if(!this._isStopLoading){var B=JSON.parse(C);this._dataType=B.type,this._dataNum=B.count,this._iGet=0,this.showLoading(),this.getData()}},G.prototype.getFile=function(C,B,R,u){var c=new h.FileLoader(this.manager);c.setPath(C);var f=B;this._urlParam.length!=0&&(f=B+this._urlParam),this._requestHeader.length!=0&&(c.requestHeader={usertoken:this._requestHeader}),c.load(f,R,function(){},u)},G);function G(C,B){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=C,this.manager=B!==void 0?B:h.DefaultLoadingManager}o.MxHFileLoad=S},{"./MxDrawData":22,"./MxFun":27,"./MxManager":29,pako:1,three:19}],32:[function(w,r,o){var a;Object.defineProperty(o,"__esModule",{value:!0}),o.MxShader=void 0,(a=o.MxShader||(o.MxShader={})).VSHADER_COLOR_POINT=` precision highp float;
|
|
uniform mat4 modelViewMatrix;
|
|
uniform mat4 projectionMatrix;
|
|
attribute vec2 position;
|
|
attribute vec3 color;
|
|
attribute vec4 tran1;
|
|
attribute vec4 tran2;
|
|
attribute vec4 tran3;
|
|
attribute vec4 tran4;
|
|
attribute float ishide;
|
|
varying vec4 vColor;
|
|
void main(){
|
|
mat4 tran;
|
|
tran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w;
|
|
tran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w;
|
|
tran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w;
|
|
tran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w;
|
|
if(ishide > 0.1)
|
|
vColor = vec4(color,0.0);
|
|
else
|
|
vColor = vec4(color,1.0);
|
|
gl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 );
|
|
}
|
|
`,a.VSHADER_COLOR_POINT_BYLAYER=` precision highp float;
|
|
uniform mat4 modelViewMatrix;
|
|
uniform mat4 projectionMatrix;
|
|
uniform vec3 color;
|
|
attribute vec2 position;
|
|
attribute vec4 tran1;
|
|
attribute vec4 tran2;
|
|
attribute vec4 tran3;
|
|
attribute vec4 tran4;
|
|
attribute float ishide;
|
|
varying vec4 vColor;
|
|
void main(){
|
|
mat4 tran;
|
|
tran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w;
|
|
tran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w;
|
|
tran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w;
|
|
tran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w;
|
|
if(ishide > 0.1)
|
|
vColor = vec4(color,0.0);
|
|
else
|
|
vColor = vec4(color,1.0);
|
|
gl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 );
|
|
}
|
|
`,a.FSHADER_COLOR_POINT=` precision highp float;
|
|
varying vec4 vColor;
|
|
void main() {
|
|
gl_FragColor = vColor;
|
|
}
|
|
`,a.VSHADER_COLOR_POINT_TEXTURE=` precision highp float;
|
|
uniform mat4 modelViewMatrix;
|
|
uniform mat4 projectionMatrix;
|
|
attribute vec2 position;
|
|
attribute vec2 uv;
|
|
attribute vec4 tran1;
|
|
attribute vec4 tran2;
|
|
attribute vec4 tran3;
|
|
attribute vec4 tran4;
|
|
varying vec2 vUv;
|
|
void main(){
|
|
vUv = uv;
|
|
mat4 tran;
|
|
tran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w;
|
|
tran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w;
|
|
tran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w;
|
|
tran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w;
|
|
gl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 );
|
|
}
|
|
`,a.FSHADER_COLOR_POINT_TEXTURE=` precision highp float;
|
|
varying vec2 vUv;
|
|
uniform sampler2D texture;
|
|
void main() {
|
|
gl_FragColor = texture2D( texture, vUv );
|
|
}
|
|
`,a.VSHADER_COLOR_POINT_CLIP=` precision highp float;
|
|
uniform mat4 modelViewMatrix;
|
|
uniform mat4 projectionMatrix;
|
|
uniform vec2 clippt1;
|
|
uniform vec2 clippt2;
|
|
uniform float vieww;
|
|
uniform float viewh;
|
|
attribute vec2 position;
|
|
attribute vec3 color;
|
|
attribute vec4 tran1;
|
|
attribute vec4 tran2;
|
|
attribute vec4 tran3;
|
|
attribute vec4 tran4;
|
|
attribute float ishide;
|
|
varying vec4 vColor;
|
|
varying vec2 vCp1;
|
|
varying vec2 vCp2;
|
|
void main(){
|
|
mat4 tran;
|
|
tran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w;
|
|
tran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w;
|
|
tran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w;
|
|
tran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w;
|
|
vec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 );
|
|
vec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 );
|
|
vCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh);
|
|
vCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh);
|
|
if(ishide > 0.1)
|
|
vColor = vec4(color,0.0);
|
|
else
|
|
vColor = vec4(color,1.0);
|
|
gl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 );
|
|
}
|
|
`,a.VSHADER_COLOR_POINT_BYLAYER_CLIP=` precision highp float;
|
|
uniform mat4 modelViewMatrix;
|
|
uniform mat4 projectionMatrix;
|
|
uniform vec3 color;
|
|
uniform vec2 clippt1;
|
|
uniform vec2 clippt2;
|
|
uniform float vieww;
|
|
uniform float viewh;
|
|
attribute vec2 position;
|
|
attribute vec4 tran1;
|
|
attribute vec4 tran2;
|
|
attribute vec4 tran3;
|
|
attribute vec4 tran4;
|
|
attribute float ishide;
|
|
varying vec4 vColor;
|
|
varying vec2 vCp1;
|
|
varying vec2 vCp2;
|
|
void main(){
|
|
mat4 tran;
|
|
tran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w;
|
|
tran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w;
|
|
tran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w;
|
|
tran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w;
|
|
vec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 );
|
|
vec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 );
|
|
vCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh);
|
|
vCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh);
|
|
if(ishide > 0.1)
|
|
vColor = vec4(color,0.0);
|
|
else
|
|
vColor = vec4(color,1.0);
|
|
gl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 );
|
|
}
|
|
`,a.FSHADER_COLOR_POINT_CLIP=`precision highp float;
|
|
varying vec4 vColor;
|
|
varying vec2 vCp1;
|
|
varying vec2 vCp2;
|
|
void main() {
|
|
if(gl_FragCoord.x > vCp1.x && gl_FragCoord.x < vCp2.x && gl_FragCoord.y > vCp1.y && gl_FragCoord.y < vCp2.y)
|
|
gl_FragColor = vColor;
|
|
else
|
|
discard;
|
|
}
|
|
`,a.VSHADER_COLOR_POINT_FORMXCAD=` precision highp float;
|
|
uniform mat4 modelViewMatrix;
|
|
uniform mat4 projectionMatrix;
|
|
uniform vec3 color;
|
|
attribute vec2 position;
|
|
attribute vec4 tran1;
|
|
attribute vec4 tran2;
|
|
attribute vec4 tran3;
|
|
attribute vec4 tran4;
|
|
attribute float ishide;
|
|
varying vec4 vColor;
|
|
void main(){
|
|
mat4 tran;
|
|
tran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w;
|
|
tran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w;
|
|
tran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w;
|
|
tran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w;
|
|
gl_PointSize = 1.0;
|
|
if(ishide > 0.1)
|
|
vColor = vec4(color,0.0);
|
|
else
|
|
vColor = vec4(color,1.0);
|
|
gl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 );
|
|
}
|
|
`,a.FSHADER_COLOR_POINT_FORMXCAD=` precision highp float;
|
|
varying vec4 vColor;
|
|
void main() {
|
|
gl_FragColor = vColor;
|
|
}
|
|
`,a.VSHADER_COLOR_POINT_CLIP_FORMXCAD=` precision highp float;
|
|
uniform mat4 modelViewMatrix;
|
|
uniform mat4 projectionMatrix;
|
|
uniform vec3 color;
|
|
uniform vec2 clippt1;
|
|
uniform vec2 clippt2;
|
|
uniform float vieww;
|
|
uniform float viewh;
|
|
attribute vec2 position;
|
|
attribute vec4 tran1;
|
|
attribute vec4 tran2;
|
|
attribute vec4 tran3;
|
|
attribute vec4 tran4;
|
|
attribute float ishide;
|
|
varying vec4 vColor;
|
|
varying vec2 vCp1;
|
|
varying vec2 vCp2;
|
|
void main(){
|
|
mat4 tran;
|
|
tran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w;
|
|
tran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w;
|
|
tran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w;
|
|
tran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w;
|
|
vec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 );
|
|
vec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 );
|
|
vCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh);
|
|
vCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh);
|
|
if(ishide > 0.1)
|
|
vColor = vec4(color,0.0);
|
|
else
|
|
vColor = vec4(color,1.0);
|
|
gl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 );
|
|
}
|
|
`,a.FSHADER_COLOR_POINT_CLIP_FORMXCAD=`precision highp float;
|
|
varying vec4 vColor;
|
|
varying vec2 vCp1;
|
|
varying vec2 vCp2;
|
|
void main() {
|
|
if(gl_FragCoord.x > vCp1.x && gl_FragCoord.x < vCp2.x && gl_FragCoord.y > vCp1.y && gl_FragCoord.y < vCp2.y)
|
|
gl_FragColor = vColor;
|
|
else
|
|
discard;
|
|
}
|
|
`},{}],33:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxStencilObject=void 0;var a=w("three"),v=w("./MxMaterial"),h=(b.prototype.object_onAfterRender=function(D){var U=this.aryMeshStencil;if(U&&0<U.length){D.getContext();var V=D.state.buffers;V.stencil.setLocked(!1),V.depth.setTest(!0),V.stencil.setTest(!1)}},b.prototype.object_onBeforeRender=function(D,U,V){var I=this.aryMeshStencil;if(I&&0<I.length){var g=D.getContext(),A=D.state.buffers;A.color.setMask(!1),A.color.setLocked(!0),A.depth.setTest(!1),A.stencil.setTest(!0),A.stencil.setMask(255),A.stencil.setClear(0),D.clearStencil(),A.stencil.setLocked(!0);var M=1,N=!0;I.forEach(function(F){N?(N=!1,A.stencil.setFunc(g.ALWAYS,M,255),A.stencil.setOp(g.KEEP,g.KEEP,g.REPLACE)):(A.stencil.setFunc(g.EQUAL,M,255),A.stencil.setOp(g.KEEP,g.KEEP,g.INCR),M++),D.mxRenderObject(F,U,V,F.material,null)}),A.color.setLocked(!1),A.color.setMask(!0),A.stencil.setMask(0),A.stencil.setFunc(g.EQUAL,M,255)}},b.prototype.associateObject=function(D,U){var V=this;U.forEach(function(g){if(3<=g.length){var A=new a.Shape(g),M=new a.ShapeGeometry(A),N=new a.Mesh(M,v.MxMaterial.getStencilMaterial());V.aryMeshStencil.push(N)}});var I=this;D.onBeforeRender=function(g,A,M){I.object_onBeforeRender(g,A,M)},D.onAfterRender=function(g){I.object_onAfterRender(g)}},b);function b(){this.aryMeshStencil=[]}o.MxStencilObject=h},{"./MxMaterial":30,three:19}],34:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxString=void 0;var a=(v.prototype.Find=function(h){return this.m_val.indexOf(h)},v.prototype.Left=function(h){return this.m_val.substring(0,h)},v.prototype.Right=function(h){return this.m_val.substring(this.m_val.length-h,this.m_val.length)},v.prototype.TrimLeft=function(h){for(;0<this.m_val.length&&this.m_val[0]==h;)this.m_val=this.m_val.slice(1)},v.prototype.TrimRight=function(h){for(;0<this.m_val.length&&this.m_val[this.m_val.length-1]==h;)this.m_val=this.m_val.slice(0,-1)},v.prototype.AnalyzeString=function(h){return this.m_val.split(h)},v.prototype.IsEmpty=function(){return this.m_val.length==0},v.prototype.MakeUpper=function(){this.m_val=this.m_val.toUpperCase()},v.prototype.MakeLower=function(){this.m_val=this.m_val.toLowerCase()},v.prototype.GetLength=function(){return this.m_val.length},v);function v(h){this.m_val="",h!=null&&(this.m_val=h)}o.MxString=a},{}],35:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxSystemVariable=void 0;var a=w("three"),v=w("./Operate/McEdJigOsnap"),h=(b.prototype.init=function(D){this.m_mxObj=D},b.prototype.getAllLinetypeName=function(){return this.m_vecLinetype},b.prototype.getSysVarBool=function(D){return this.m_data[D]!=null&&this.m_data[D]},b.prototype.setSysVarBool=function(D,U){this.m_data[D]=U},b.prototype.setSysVarPoint=function(D,U){this.m_data[D]=U},b.prototype.OnMessageMxCADSystemVariable=function(D){this.m_vecLinetype=[];var U=JSON.parse(D);if(U!=null){var V=U.vecLinetypeName;for(var I in V)this.m_vecLinetype.push(V[I]);this.m_data.CELTYPE=U.curLinetypeName,this.m_data.CLAYER=U.clayer,this.m_data.CECOLOR=U.cecolor,this.m_data.CECOLORINDEX=U.cecolorindex}this.m_mxObj.callEvent("loadSystmeVariableComplete")},b.prototype.getSysVarPoint=function(D){return this.m_data[D]==null?new a.Vector3(0,0,0):this.m_data[D]},b.prototype.setSysVarNumber=function(D,U){this.m_data[D]=U},b.prototype.getSysVarNumber=function(D){return this.m_data[D]==null?0:this.m_data[D]},b.prototype.getSysVar=function(D){return this.m_data[D]},b.prototype.setSysVar=function(D,U){this.m_data[D]=U},b);function b(){this.m_data={},this.m_mxObj=null,this.m_vecLinetype=[],this.m_data.GETPOINTSTATUS=0,this.m_data.LASTPOINT=void 0,this.m_data.LASTMOVEPOINT=void 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=v.MxOsnapDefine.OsModeAll}o.MxSystemVariable=h},{"./Operate/McEdJigOsnap":43,three:19}],36:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxTempMarkDraw=void 0;var a=w("three"),v=w("./MxFun"),h=w("./MxThreeJS"),b=(D.prototype.init=function(U){this.threeObjectGroup=new a.Object3D,U.addObject(this.threeObjectGroup)},D.prototype.clear=function(U){U||v.MxFun.removeThreejsAllChildren(this.threeObjectGroup)},D.prototype.drawLine=function(U,V,I,g){I===void 0&&(I=16777215),g===void 0&&(g=1),this.threeObjectGroup.add(h.MxThreeJS.createLine(U,V,I,g))},D.prototype.drawCircle=function(U,V,I){this.threeObjectGroup.add(h.MxThreeJS.createCircle(U,V,I))},D.prototype.drawEntity=function(U){this.threeObjectGroup.add(U)},D.prototype.drawCircleMark=function(U,V,I){this.drawCircle(U,V,I);var g=new a.Vector3(.3*V,0,0);g.applyAxisAngle(new a.Vector3(0,0,1),60*Math.PI/180);var A=new a.Vector3(.3*V,0,0);A.applyAxisAngle(new a.Vector3(0,0,1),30*Math.PI/180);var M=new a.Vector3(V,0,0);M.applyAxisAngle(new a.Vector3(0,0,1),45*Math.PI/180);var N=U.clone().add(g),F=U.clone().add(A),T=U.clone().add(M);this.drawLine(U,N,I),this.drawLine(U,F,I),this.drawLine(U,T,I)},D);function D(){this.threeObjectGroup=null}o.MxTempMarkDraw=b},{"./MxFun":27,"./MxThreeJS":37,three:19}],37:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxThreeJS=void 0;var a,v=w("three"),h=w("./MxFun");function b(D){return Math.pow(2,Math.floor(Math.log(D)/Math.LN2))}(a=o.MxThreeJS||(o.MxThreeJS={})).createLine=function(D,U,V,I){var g,A=new v.Geometry;return g=I&&I!=1||I==0?new v.LineBasicMaterial({color:V,transparent:!0,depthTest:!1,opacity:I}):new v.LineBasicMaterial({color:V,transparent:!0,depthTest:!1}),A.vertices.push(D,U),new v.Line(A,g)},a.createSolid=function(D,U,V){if(D.length<3)return null;var I,g=new v.Shape(D.map(function(M){var N=M.x,F=M.y;return new v.Vector2(N,F)})),A=new v.ShapeGeometry(g);return I=V&&V!=1||V==0?new v.MeshPhongMaterial({color:U,side:v.DoubleSide,transparent:!0,depthTest:!1,opacity:V}):new v.MeshPhongMaterial({color:U,side:v.DoubleSide,transparent:!0,depthTest:!1}),new v.Mesh(A,I)},a.createPoint=function(D,U,V){V===void 0&&(V=3);var I=new v.Geometry;I.vertices.push(D);var g=new v.PointsMaterial({color:U,size:V});return new v.Points(I,g)},a.createDashedLine=function(D,U,V,I,g){var A=new v.Geometry;A.vertices.push(D,U);var M=new v.Line(A,new v.LineDashedMaterial({color:V,dashSize:I,gapSize:g,transparent:!0,depthTest:!1}));return M.computeLineDistances(),M},a.createCircle=function(D,U,V){var I=new v.CircleGeometry(U,64,3,2*Math.PI),g=new v.LineBasicMaterial({color:V,transparent:!0,depthTest:!1});I.vertices.shift();var A=new v.LineLoop(I,g);return A.position.x=D.x,A.position.y=D.y,A.position.z=D.z,A},a.createSolidCircle=function(D,U,V){var I=new v.MeshBasicMaterial({color:V,transparent:!0,depthTest:!1}),g=new v.CircleGeometry(U,64,3,2*Math.PI),A=new v.Mesh(g,I);return A.position.x=D.x,A.position.y=D.y,A.position.z=D.z,A},a.clacTextSize=function(D,U){var V=document.createElement("canvas").getContext("2d");if(V==null)return U;var I=h.MxFun.formatString("normal {0}px Arial","256");return V.font=I,V.measureText(D).width*U/256},a.clacTextSpriteSize=function(D,U,V){U<=1e-8&&(U=1);var I=document.createElement("canvas"),g=I.getContext("2d"),A=h.MxFun.formatString("normal {0}px Arial","256");g.font=A;var M=U/256,N=0,F=[],T=!0,_=0;if(V){N=V;for(var Y=0,k=0,S=0;k<D.length;k++)(G=g.measureText(D.substring(Y,k+1))).width*M>N&&(_+=(G.fontBoundingBoxAscent+G.fontBoundingBoxDescent)*M,F.push(D.substring(Y,k)),Y=k,S++);if(Y<k){var G=g.measureText(D.substring(Y,k));F.push(D.substring(Y,k)),_+=(G.fontBoundingBoxAscent+G.fontBoundingBoxDescent)*M,S++}T=S<=1}else _=U,N=(G=g.measureText(D)).width*M,F.push(D),T=!1;var C=_/N*(I.width=1024);return I.height=b(C),I.height<C&&(I.height*=2),I.height==0&&(I.height=512),{spritewidth:N,spriteheight:N*I.height/I.width,textwidth:N,allTextHeight:_,singleline:T}},a.creatTextSprite=function(D,U,V,I,g,A,M){V<=1e-8&&(V=1);var N=document.createElement("canvas"),F=N.getContext("2d");M?(F.font=M(256),F.font.length==0&&(F.font=h.MxFun.formatString("normal {0}px Arial","256"))):F.font=h.MxFun.formatString("normal {0}px Arial","256");var T=V/256,_=0,Y=[],k=[],S=0;if(A){_=A;for(var G=0,C=0;C<D.length;C++)(R=F.measureText(D.substring(G,C+1))).width*T>_&&(S+=B=(R.fontBoundingBoxAscent+R.fontBoundingBoxDescent)*T,Y.push(D.substring(G,C)),k.push(B),G=C);if(G<C){var B,R=F.measureText(D.substring(G,C));Y.push(D.substring(G,C)),S+=B=(R.fontBoundingBoxAscent+R.fontBoundingBoxDescent)*T,k.push(B)}}else S=V,_=(R=F.measureText(D)).width*T,Y.push(D),k.push(S);var u=S/_*(N.width=1024);N.height=b(u),N.height<u&&(N.height*=2),N.height==0&&(N.height=512);var c=1024/_,f=c*V;M?(F.font=M(f),F.font.length==0&&(F.font=h.MxFun.formatString("normal {0}px Arial",""+f))):F.font=h.MxFun.formatString("normal {0}px Arial",""+f);var O=h.MxFun.formatString("rgba({0}, {1}, {2}, 1.0)",(g>>16&255)+"",(g>>8&255)+"",(255&g)+"");F.fillStyle=O,F.textAlign="left",F.textBaseline="bottom";for(var W=0,X=0;W<Y.length;W++)X+=c*k[W];for(W=0,X=.5*(N.height-X);W<Y.length;W++)X+=c*k[W],F.fillText(Y[W],0,X);var J=new v.Texture(N);J.needsUpdate=!0;var te=new v.SpriteMaterial({transparent:!0,depthTest:!1,map:J});te.rotation=I;var ne=new v.Sprite(te);return ne.scale.set(_,_/N.width*N.height,1),ne.position.set(U.x,U.y,U.z),ne},a.createTriangle=function(D,U,V){if(!(D.length<3)){for(var I=D.length,g=new v.Geometry,A=0;A+2<I;A+=3){g.vertices.push(D[A]),g.vertices.push(D[A+1]),g.vertices.push(D[A+2]);var M=new v.Face3(A,A+1,A+2);g.faces.push(M)}g.computeFaceNormals(),g.computeVertexNormals(),V==null&&(V=1);var N=new v.MeshBasicMaterial({color:U,transparent:!0,depthTest:!1,side:v.DoubleSide,opacity:V});return new v.Mesh(g,N)}},a.createLines=function(D,U,V){var I,g=new v.Geometry;return g.vertices=D,I=V&&V!=1||V==0?new v.LineBasicMaterial({color:U,transparent:!0,depthTest:!1,opacity:V}):new v.LineBasicMaterial({color:U,transparent:!0,depthTest:!1}),new v.Line(g,I)},a.createDashedArc=function(D,U,V,I,g,A,M){var N=new v.CircleGeometry(U,64,V,I),F=new v.LineDashedMaterial({color:g,dashSize:A,gapSize:M,transparent:!0,depthTest:!1});N.vertices.shift();var T=new v.Line(N,F);return T.position.x=D.x,T.position.y=D.y,T.position.z=D.z,T},a.createDashedLines=function(D,U,V,I){var g=new v.Geometry;return g.vertices=D,new v.Line(g,new v.LineDashedMaterial({color:U,dashSize:V,gapSize:I,transparent:!0,depthTest:!1}))}},{"./MxFun":27,three:19}],38:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxPair=o.MxTools=void 0;var a,v=w("three");(a=o.MxTools||(o.MxTools={})).AsMxWebPoint=function(h,b,D){return new v.Vector3(-h,D,b)},a.AsMxWebPoint_pt=function(h){return new v.Vector3(-h.x,h.z,h.y)},a.AsThreeJsPoint=function(h,b,D){return new v.Vector3(-h,D,b)},a.stringTrimLeftSpace=function(h){return h.replace(/^\s*/g,"")},a.stringDeleteAllSpace=function(h){return h.replace(/\s*/g,"")},a.stringTrimLeftRightSpace=function(h){return h.replace(/^\s*|\s*$/g,"")},a.stringTrimRightSpace=function(h){return h.replace(/(\s*$)/g,"")},a.IsNumerical=function(h){if(typeof h=="string"){var b=/^(-(([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(h)&&!b.test(h))}var D=h.m_val;return b=/^(-(([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(D)&&!b.test(D))},a.formatString=function(h){for(var b=[],D=1;D<arguments.length;D++)b[D-1]=arguments[D];for(var U=0;U<b.length;U++)h=h.replace("{"+U+"}",b[U]);return h},a._tstof=function(h){return parseFloat(h)},a._tstoi=function(h){return parseInt(h)},a.IsZero=function(h){return-1e-7<h&&h<1e-7},a.MillimeterToPixels=function(h){return 10*h},a.getXYPlanDistance=function(h,b){var D=new v.Vector2(h.x,h.y),U=new v.Vector2(b.x,b.y);return D.distanceTo(U)},a.MxASSERT=function(h,b){h||console.log("MxASSERT(0):"+b)},a.generateUUID=function(){return v.MathUtils.generateUUID()},a.MxMax=function(h,b){return b<h?h:b},a.getOpacity=function(h){var b=(4278190080&h)>>24&255;return b<=0&&(b=255),b/255},a.getColor=function(h){return 16777215&h},o.MxPair=function(h,b){this.first=h,this.second=b}},{three:19}],39:[function(w,r,o){var a,v,h;Object.defineProperty(o,"__esModule",{value:!0}),o.MxType=void 0,(v=(a=o.MxType||(o.MxType={})).MxCommandFlag||(a.MxCommandFlag={}))[v.MCRX_CMD_MODAL=0]="MCRX_CMD_MODAL",v[v.MCRX_CMD_TRANSPARENT=1]="MCRX_CMD_TRANSPARENT",v[v.MCRX_CMD_NO_UNDO_MARKER=2]="MCRX_CMD_NO_UNDO_MARKER",v[v.MCRX_CMD_NOPRV=4]="MCRX_CMD_NOPRV",v[v.MCRX_CMD_NO_RECORD_PRVCMD=8]="MCRX_CMD_NO_RECORD_PRVCMD",v[v.MCRX_CMD_NO_CLEAR_SELECT=16]="MCRX_CMD_NO_CLEAR_SELECT",(h=a.MxCloneType||(a.MxCloneType={}))[h.kClone=1]="kClone",h[h.kDragClone=2]="kDragClone",h[h.kMxFileClone=3]="kMxFileClone",h[h.kSaveDwgClone=4]="kSaveDwgClone"},{}],40:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxBulid=void 0,window.MxDrawVersion="1.0(2025-02-21 21:21)",(o.MxBulid||(o.MxBulid={})).getVersion=function(){return window.MxDrawVersion?window.MxDrawVersion:"inalid version"}},{}],41:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxWindowsEvent=void 0;var a,v,h,b=w("./MxFun"),D=w("./Operate/MxJigCmdManager"),U=w("./MxDrawData"),V=w("./UI/MxUiVue");function I(T,_){for(var Y=0,k=h.length;Y<k;Y++){var S=h[Y](T,_);if(S!=0)return S}}function g(T){I("mousemove",T)}function A(T){I("mouseup",T)}function M(T){I("dblclick",T)}function N(T){I("mousedown",T)}function F(T){var _=T||window.event||arguments.callee.caller.arguments[0];if(_&&_.keyCode==27){var Y=b.MxFun.getCurrentMx();if(Y.isPaningCommand())return void Y.endPanCommand();if(D.MxJigCmdManager.isRunning()){if(D.MxJigCmdManager.getCurCmd().getDynImput().onKeyEcsDown()!=0)return;D.MxJigCmdManager.stopCmd(D.MxJigCmdManager.DetailedResult.kEcsIn)}else{var k=!1;if(U.MxDrawData.m_isEnableIntelliSelect){var S=!1;Y.getMxDatabase().getGripManager().removeAllGrips()&&(S=!0),Y.getMxDatabase().getSelectManager().removeAllEntity()&&(S=!0),Y.isValidMcObject()&&Y.getMcObject().getGripManager().clearAll()&&(S=!0),S&&(Y.updateDisplay(),Y.getMxDatabase().getGripManager().fireMxEntitySelectChange(),k=!0)}k||V.MxUiVue.acutPrintf(` *取消*
|
|
命令:`)}}}a=o.MxWindowsEvent||(o.MxWindowsEvent={}),v=!1,h=new Array,a.addEvent=function(T){h.push(T)},a.registEvent=function(){v||(v=!0,b.MxFun.isPC()&&(document.addEventListener("mousemove",g,!1),document.addEventListener("mouseup",A,!1),document.addEventListener("mousedown",N,!1),document.addEventListener("dblclick",M,!1),document.onkeydown=F))}},{"./MxDrawData":22,"./MxFun":27,"./Operate/MxJigCmdManager":54,"./UI/MxUiVue":65}],42:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.McEdJigDynamicTrace=void 0;var a=w("three"),v=w("./MxJigCmdManager"),h=w("../MxFun"),b=w("../MxDrawData"),D=w("../MxTools"),U=w("../MxManager"),V=w("../MxThreeJS"),I=w("./McEdJigOsnap"),g=(A.prototype.IsEqual=function(_){return this.m_snapObjectId==_.m_snapObjectId&&this.m_pt.distanceTo(_.m_pt)<1e-6},A.prototype.drawLine=function(_,Y,k){var S=V.MxThreeJS.createLine(new a.Vector3(_.x,_.y,_.z),new a.Vector3(Y.x,Y.y,Y.z),this.m_iColor);k.add(S),this.m_aryDynDrawObject.push(S)},A.prototype.clearDraw=function(_){for(var Y=this.m_aryDynDrawObject.length,k=0;k<Y;k++)h.MxFun.removeThreejsObject(this.m_aryDynDrawObject[k],_);this.m_aryDynDrawObject=[]},A.prototype.draw=function(_,Y){var k=_.toSmallcoord(this.m_pt),S=new a.Vector3(k.x,k.y+this.m_iGripWidth,0),G=new a.Vector3(k.x,k.y-this.m_iGripWidth,0);this.drawLine(S,G,Y);var C=new a.Vector3(k.x+this.m_iGripWidth,k.y,0),B=new a.Vector3(k.x-this.m_iGripWidth,k.y,0);this.drawLine(C,B,Y)},A);function A(){this.m_snapObjectId=0,this.m_pt=new a.Vector3,this.m_osmode=0,this.m_iColor=16760703,this.m_iGripWidth=10,this.m_aryDynDrawObject=new Array}var M=(N.prototype.clearDraw=function(_){for(var Y=this.m_aryDynDrawObject.length,k=0;k<Y;k++)h.MxFun.removeThreejsObject(this.m_aryDynDrawObject[k],_);this.m_aryDynDrawObject=[]},N.prototype.draw=function(_,Y){this.m_draw.setWidth(this.m_iGripWidth),this.m_draw.draw(_.toSmallcoord(this.m_pt),this.m_ostype,Y)},N);function N(_,Y){var k=this;this.m_aryDynDrawObject=new Array,this.m_iGripWidth=10,this.m_draw=new I.McEdJigOsnapDraw,this.m_pt=_,this.m_ostype=Y,this.m_draw.setAddDynDrawObject_call(function(S){k.m_aryDynDrawObject.push(S)})}var F=(T.prototype.DynamicTraceTimeCall=function(_){if(!this.m_mxJig.isExit()&&this.m_iTimeCallId==_&&this.m_isDynTrace&&this.m_snapObjectId!=0){var Y=new g;Y.m_osmode=this.m_osmode,Y.m_snapObjectId=this.m_snapObjectId,Y.m_pt=this.m_ptSnapPoint,Y.m_iGripWidth=.5*this.m_mxJig.getMxObject().screenCoordLong2Doc(b.MxDrawData.m_dInputRectWidth);for(var k=this.m_aryTraceObject.length,S=this.m_mxJig.getMxObject().getTheTempDrawContainer_SmallCoord(),G=0;G<k;G++)if(this.m_aryTraceObject[G].IsEqual(Y))return this.m_aryTraceObject[G].clearDraw(S),void this.m_aryTraceObject.splice(G,1);this.m_aryTraceObject.push(Y),Y.draw(this.m_mxJig.getMxObject(),S),this.m_mxJig.getMxObject().updateDisplay()}},T.prototype.OnDynamicTrace=function(_,Y,k){if(this.m_isDynTrace)if(_==0)this.m_iTimeCallId++,this.m_snapObjectId=0;else{if(k==v.MxJigCmdManager.OsnapMode.kOsModeNear)return;var S=.5*this.m_mxJig.getMxObject().screenCoordLong2Doc(b.MxDrawData.m_dInputRectWidth);if(this.m_snapObjectId!=0&&this.m_ptSnapPoint.distanceTo(Y)<S)return;var G=this.m_iTimeCallId,C=this;setTimeout(function(){C.DynamicTraceTimeCall(G)},400),this.m_snapObjectId=_,this.m_ptSnapPoint=Y,this.m_osmode=k}},T.prototype.ClearOsmodeObjectDisplay=function(){for(var _=this.m_mxJig.getMxObject().getTheTempDrawContainer_SmallCoord(),Y=this.m_aryTraceOsmodeObject.length,k=0;k<Y;k++)this.m_aryTraceOsmodeObject[k].clearDraw(_);this.m_aryTraceOsmodeObject=[]},T.prototype.ClearTraceObject=function(){for(var _=this.m_mxJig.getMxObject().getTheTempDrawContainer_SmallCoord(),Y=this.m_aryTraceObject.length,k=0;k<Y;k++)this.m_aryTraceObject[k].clearDraw(_);this.m_aryTraceObject=[]},T.prototype.ClearDisplay=function(){this.ClearTraceObject(),this.ClearOsmodeObjectDisplay(),this.ClearDynDrawEntity()},T.prototype.GetTraceLine=function(_,Y,k,S){var G=Y.m_pt;if(G.distanceTo(_)<2*k)return[];var C={pt1:new a.Vector3(G.x-S,G.y),pt2:new a.Vector3(G.x+S,G.y)},B={pt1:new a.Vector3(G.x,G.y-S),pt2:new a.Vector3(G.x,G.y+S)},R=[];R.push(C),R.push(B);for(var u=U.MxManager.getMxCpp().getMcDbCurve(Y.m_snapObjectId);u;){var c=u.getFirstDeriv(U.MxManager.getMxCpp().newMcGePoint3d(G));if(c.ret!=0||c.val.isZeroLength())break;c.val.normalize(),c.val.mult(S);var f={pt1:new a.Vector3(G.x-c.val.x,G.y-c.val.y),pt2:new a.Vector3(G.x+c.val.x,G.y+c.val.y)};R.push(f),c.val.rotateBy(Math.PI/2);var O={pt1:new a.Vector3(G.x-c.val.x,G.y-c.val.y),pt2:new a.Vector3(G.x+c.val.x,G.y+c.val.y)};R.push(O);break}return R},T.prototype.ClearDynDrawEntity=function(){for(var _=this.m_mxJig.getMxObject().getTheTempDrawContainer_SmallCoord(),Y=this.m_vecDynDrawEntity.length,k=0;k<Y;k++)h.MxFun.removeThreejsObject(this.m_vecDynDrawEntity[k],_);this.m_vecDynDrawEntity=[]},T.prototype.DoMouseMove=function(_){if(this.ClearDynDrawEntity(),this.ClearOsmodeObjectDisplay(),this.m_isValidTracePoint=!1,!this.m_isDynTrace)return[];if(this.m_aryTraceObject.length==0)return[];for(var Y=[],k=this.m_mxJig.getMxObject(),S=k.viewCoordLong2Cad(b.MxDrawData.m_dInputRectWidth),G=2*S,C=k.viewCoordLong2Cad(k.getViewWidth()),B=k.viewCoordLong2Cad(k.getViewHeight()),R=D.MxTools.MxMax(C,B),u=U.MxManager.getMxCpp().getMxCAD_App(),c=this.m_mxJig.getMxObject().getTheTempDrawContainer_SmallCoord(),f=this.m_mxJig.getMxObject().viewCoordLong2Cad(this.m_dashedLineLen),O=0;O<this.m_aryTraceObject.length-1;O++){var W=this.m_aryTraceObject[O],X=W.m_pt,J=this.GetTraceLine(_,W,G,R);if(J.length!=0)for(var te=O+1;te<this.m_aryTraceObject.length&&!this.m_isValidTracePoint;te++){var ne=this.m_aryTraceObject[O],ue=ne.m_pt,be=this.GetTraceLine(_,ne,G,R);if(J.length!=0)for(var je=0;je<be.length&&!this.m_isValidTracePoint;je++)for(var ve=be[je],Be=0;Be<J.length&&!this.m_isValidTracePoint;Be++){var q=J[Be],ge=u.MxCADAssist.IntersectWith(q.pt1.x,q.pt1.y,q.pt2.x,q.pt2.y,ve.pt1.x,ve.pt1.y,ve.pt2.x,ve.pt2.y,3);if(0<ge.length()){var oe=ge.at(0),le=new a.Vector3(oe.x,oe.y,oe.z);if(le.distanceTo(_)<G){var Pe=V.MxThreeJS.createDashedLine(k.toSmallcoord(q.pt1),k.toSmallcoord(q.pt2),this.m_iDashedLineLenColor,f,f);c.add(Pe),this.m_vecDynDrawEntity.push(Pe);var Ye=V.MxThreeJS.createDashedLine(k.toSmallcoord(ve.pt1),k.toSmallcoord(ve.pt2),this.m_iDashedLineLenColor,f,f);c.add(Ye),this.m_vecDynDrawEntity.push(Ye),je=be.length,this.m_isValidTracePoint=!0,this.m_ptTracePoint=le,this.CreteTracePoint(le,S),Y.push({pt:X,ostype:W.m_osmode}),Y.push({pt:ue,ostype:ne.m_osmode});break}}}}}if(this.m_isValidTracePoint||this.TracekPerpLine(_,Y,G,R,S)||this.TracekTangLine(_,Y,G,R,S))return Y;for(O=0;O<this.m_aryTraceObject.length;O++)if(X=this.m_aryTraceObject[O].m_pt,this.m_aryTraceObject[O].m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModePerp&&!(X.distanceTo(_)<2*G)){var ze={pt1:new a.Vector3(X.x-R,X.y),pt2:new a.Vector3(X.x+R,X.y)};if(0<(De=u.MxCADAssist.GetClosestPointTo(ze.pt1.x,ze.pt1.y,ze.pt2.x,ze.pt2.y,_.x,_.y,!0)).length()){var se=De.at(0);if((tt=new a.Vector3(se.x,se.y,se.z)).distanceTo(_)<G){var xe=V.MxThreeJS.createDashedLine(k.toSmallcoord(ze.pt1),k.toSmallcoord(ze.pt2),this.m_iDashedLineLenColor,f,f);c.add(xe),this.m_vecDynDrawEntity.push(xe),this.m_isValidTracePoint=!0,this.m_ptTracePoint=tt,Y.push({pt:X,ostype:this.m_aryTraceObject[O].m_osmode}),this.CreteTracePoint(tt,S);break}}var De,tt,st={pt1:new a.Vector3(X.x,X.y-R),pt2:new a.Vector3(X.x,X.y+R)};if(0<(De=u.MxCADAssist.GetClosestPointTo(st.pt1.x,st.pt1.y,st.pt2.x,st.pt2.y,_.x,_.y,!0)).length()&&(se=De.at(0),(tt=new a.Vector3(se.x,se.y,se.z)).distanceTo(_)<G)){xe=V.MxThreeJS.createDashedLine(k.toSmallcoord(st.pt1),k.toSmallcoord(st.pt2),this.m_iDashedLineLenColor,f,f),c.add(xe),this.m_vecDynDrawEntity.push(xe),this.m_isValidTracePoint=!0,this.m_ptTracePoint=tt,Y.push({pt:X,ostype:this.m_aryTraceObject[O].m_osmode}),this.CreteTracePoint(tt,S);break}}return Y},T.prototype.MouseMove=function(_){var Y=this.DoMouseMove(_);if(this.m_isValidTracePoint)for(var k=this.m_mxJig.getMxObject().getTheTempDrawContainer_SmallCoord(),S=this.m_mxJig.getMxObject().screenCoordLong2Doc(b.MxDrawData.m_dInputRectWidth),G=0;G<Y.length;G++){var C=new M(Y[G].pt,Y[G].ostype);C.m_iGripWidth=S,C.draw(this.m_mxJig.getMxObject(),k),this.m_aryTraceOsmodeObject.push(C)}},T.prototype.Init=function(){var _=this.m_mxJig.getMxObject();_.getMcObject().isValid()?(this.m_isDynTrace=_.getSysVarLong("DYNTRACE")!=0,_.sysVariable().getSysVarNumber("GETPOINTSTATUS")&v.MxJigCmdManager.GETPOINTSTATUS.OsModeDynTraceTempDisable&&(this.m_isDynTrace=!1),this.m_mxJig.isDisableDynamicTrace()&&(this.m_isDynTrace=!1),this.m_isDynTrace):this.m_isDynTrace=!1},T.prototype.GetTracePoint=function(){if(this.m_isDynTrace)return this.m_isValidTracePoint?this.m_ptTracePoint:void 0},T.prototype.ReSetTempDisplay=function(){this.ClearDynDrawEntity(),this.ClearOsmodeObjectDisplay(),this.m_isValidTracePoint=!1},T.prototype.CreteTracePoint=function(_,Y){var k=this.m_mxJig.getMxObject(),S=k.getTheTempDrawContainer_SmallCoord();Y/=2;var G=V.MxThreeJS.createLine(k.toSmallcoord2(_.x+Y,_.y+Y,0),k.toSmallcoord2(_.x-Y,_.y-Y,0),16711680);S.add(G),this.m_vecDynDrawEntity.push(G);var C=V.MxThreeJS.createLine(k.toSmallcoord2(_.x-Y,_.y+Y,0),k.toSmallcoord2(_.x+Y,_.y-Y,0),16711680);S.add(C),this.m_vecDynDrawEntity.push(C)},T.prototype.TracekPerpLine=function(_,Y,k,S,G){for(var C=this.m_aryTraceObject,B=C.length,R=U.MxManager.getMxCpp().getMxCAD_App(),u=this.m_mxJig.getMxObject(),c=u.getTheTempDrawContainer_SmallCoord(),f=u.viewCoordLong2Cad(this.m_dashedLineLen),O=0;O<B;O++){var W=C[O].m_pt;if(!(W.distanceTo(_)<2*k)){var X=U.MxManager.getMxCpp().getMcDbCurve(C[O].m_snapObjectId);if(X){var J=X.getFirstDeriv(U.MxManager.getMxCpp().newMcGePoint3d(W));if(J.ret==0&&!J.val.isZeroLength()){J.val.normalize(),J.val.rotateBy(Math.PI/2),J.val.mult(S);var te={pt1:new a.Vector3(W.x-J.val.x,W.y-J.val.y),pt2:new a.Vector3(W.x+J.val.x,W.y+J.val.y)},ne=R.MxCADAssist.GetClosestPointTo(te.pt1.x,te.pt1.y,te.pt2.x,te.pt2.y,_.x,_.y,!0);if(0<ne.length()){var ue=ne.at(0),be=new a.Vector3(ue.x,ue.y,ue.z);if(be.distanceTo(_)<k){var je=V.MxThreeJS.createDashedLine(u.toSmallcoord2(W.x-J.val.x,W.y-J.val.y,0),u.toSmallcoord2(W.x+J.val.x,W.y+J.val.y,0),this.m_iDashedLineLenColor,f,f);c.add(je),this.m_vecDynDrawEntity.push(je),this.m_isValidTracePoint=!0,this.m_ptTracePoint=be,Y.push({pt:W,ostype:C[O].m_osmode}),this.CreteTracePoint(be,G);break}}}}}}return this.m_isValidTracePoint},T.prototype.TracekTangLine=function(_,Y,k,S,G){for(var C=this.m_aryTraceObject,B=C.length,R=U.MxManager.getMxCpp().getMxCAD_App(),u=this.m_mxJig.getMxObject(),c=u.getTheTempDrawContainer_SmallCoord(),f=u.viewCoordLong2Cad(this.m_dashedLineLen),O=0;O<B;O++){var W=C[O].m_pt;if(!(W.distanceTo(_)<2*k)){var X=U.MxManager.getMxCpp().getMcDbCurve(C[O].m_snapObjectId);if(X){var J=X.getFirstDeriv(U.MxManager.getMxCpp().newMcGePoint3d(W));if(J.ret==0&&!J.val.isZeroLength()){J.val.normalize(),J.val.mult(S);var te={pt1:new a.Vector3(W.x-J.val.x,W.y-J.val.y),pt2:new a.Vector3(W.x+J.val.x,W.y+J.val.y)},ne=R.MxCADAssist.GetClosestPointTo(te.pt1.x,te.pt1.y,te.pt2.x,te.pt2.y,_.x,_.y,!0);if(0<ne.length()){var ue=ne.at(0),be=new a.Vector3(ue.x,ue.y,ue.z);if(be.distanceTo(_)<k){var je=V.MxThreeJS.createDashedLine(u.toSmallcoord2(W.x-J.val.x,W.y-J.val.y),u.toSmallcoord2(W.x+J.val.x,W.y+J.val.y),this.m_iDashedLineLenColor,f,f);c.add(je),this.m_vecDynDrawEntity.push(je),this.m_isValidTracePoint=!0,this.m_ptTracePoint=be,Y.push({pt:W,ostype:C[O].m_osmode}),this.CreteTracePoint(be,G);break}}}}}}return this.m_isValidTracePoint},T);function T(_){this.m_snapObjectId=0,this.m_ptSnapPoint=new a.Vector3,this.m_osmode=0,this.m_ptTracePoint=new a.Vector3,this.m_isValidTracePoint=!1,this.m_isDynTrace=!1,this.m_iTimeCallId=0,this.m_mxJig=null,this.m_aryTraceObject=[],this.m_aryTraceOsmodeObject=[],this.m_vecDynDrawEntity=[],this.m_dashedLineLen=1.5,this.m_iDashedLineLenColor=11184810,this.m_mxJig=_}o.McEdJigDynamicTrace=F},{"../MxDrawData":22,"../MxFun":27,"../MxManager":29,"../MxThreeJS":37,"../MxTools":38,"./McEdJigOsnap":43,"./MxJigCmdManager":54,three:19}],43:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.McEdJigOsnap=o.McEdJigOsnapDraw=o.McEdJigOrtho=o.McEdImpJigGlobalData=o.MxOsnapDefine=void 0;var a,v,h,b,D,U,V,I,g,A,M=w("three"),N=w("../MxDrawObject"),F=w("../MxFun"),T=w("./MxJigCmdManager"),_=w("../MxTools"),Y=w("../MxDrawData");(v=a=o.MxOsnapDefine||(o.MxOsnapDefine={}))[v.OsModeInvalid=0]="OsModeInvalid",v[v.OsModeEnd=1]="OsModeEnd",v[v.OsModeMid=2]="OsModeMid",v[v.OsModeCen=4]="OsModeCen",v[v.OsModeNode=8]="OsModeNode",v[v.OsModeQuad=16]="OsModeQuad",v[v.OsModeInt=32]="OsModeInt",v[v.OsModeIns=64]="OsModeIns",v[v.OsModePerp=128]="OsModePerp",v[v.OsModeTan=256]="OsModeTan",v[v.OsModeNear=512]="OsModeNear",v[v.OsModeApp=2048]="OsModeApp",v[v.OsModeExt=4096]="OsModeExt",v[v.OsModePar=8192]="OsModePar",v[v.OsModeOff=16384]="OsModeOff",v[v.OsModeAll=16383]="OsModeAll",b=h=o.McEdImpJigGlobalData||(o.McEdImpJigGlobalData={}),D=!1,U=new M.Vector3,V=new M.Vector3,g=I=!1,A=new Array,b.setPrvPoint=function(u){U=u,g=!0},b.isOsnapZValue=function(){return!1},b.setIsValidPrvpoint=function(u){g=u},b.isValidPrvpoint=function(){return g},b.getPrvPoint=function(){return U},b.setIsValidBasepoint=function(u){D=u},b.isValidBasepoint=function(){return D},b.setBasepoint=function(u){D=!0,V=u},b.getBasepoint=function(){return V},b.initStartCommand=function(){I=D=!1},b.setIsTmpDisableOsmode=function(u){I=u},b.isTmpDisableOsmode=function(){return I},b.addDynDrawObject=function(u){A.push(u)},b.clearDisplay=function(u){for(var c=A.length,f=0;f<c;f++)F.MxFun.removeThreejsObject(A[f],u);A=[]};var k=(S.prototype.Init=function(){this.m_isTrace=!this.m_mxJig.isDisableOrthoTrace(),this.m_isValid=!1},S.prototype.OnViewMouseMove=function(u){if(this.m_isTrace){var c=this.m_mxJig.getMxObject(),f=c.sysVariable().getSysVarNumber("GETPOINTSTATUS");if(!(c.getSysVarLong("ORTHOMODE")==0||f&T.MxJigCmdManager.GETPOINTSTATUS.OsModeOrthoTempDisable)&&f&T.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint){var O=c.sysVariable().getSysVarPoint("LASTPOINT");Math.abs(u.x-O.x)>Math.abs(u.y-O.y)?(this.m_ptOrtho.x=u.x,this.m_ptOrtho.y=O.y):(this.m_ptOrtho.x=O.x,this.m_ptOrtho.y=u.y),this.m_isValid=!0}else this.m_isValid=!1}},S.prototype.GetCurOrthoPoint=function(){return{pt:this.m_ptOrtho,isValid:this.m_isValid}},S);function S(u){this.m_mxJig=null,this.m_ptOrtho=new M.Vector3,this.m_isValid=!1,this.m_isTrace=!0,this.m_mxJig=u}o.McEdJigOrtho=k;var G=(C.prototype.setAddDynDrawObject_call=function(u){this.m_addDynDrawObject_call=u},C.prototype.addDynDrawObject=function(u){this.m_addDynDrawObject_call?this.m_addDynDrawObject_call(u):h.addDynDrawObject(u)},C.prototype.drawLine=function(u,c,f){var O=new M.Geometry,W=new M.LineBasicMaterial({color:this.m_iColor});O.vertices.push(new M.Vector3(u.x,u.y,u.z),new M.Vector3(c.x,c.y,c.z));var X=new M.Line(O,W);f.add(X),this.addDynDrawObject(X)},C.prototype.drawPolyline=function(u,c){for(var f=new M.Geometry,O=new M.LineBasicMaterial({color:this.m_iColor}),W=u.length,X=0;X<W;X++)f.vertices.push(new M.Vector3(u[X].x,u[X].y,u[X].z));var J=new M.Line(f,O);c.add(J),this.addDynDrawObject(J)},C.prototype.setWidth=function(u){this.m_dOsmodeWdith=u},C.prototype.GetDrawRect=function(){var u=.5*this.m_dOsmodeWdith,c={};return c.left=this.m_pt.x-u,c.right=this.m_pt.x+u,c.top=this.m_pt.y-u,c.bottom=this.m_pt.y+u,c},C.prototype.DrawNear=function(u){var c=this.GetDrawRect(),f=[new M.Vector3,new M.Vector3];f[0].x=c.left,f[0].y=c.top,f[1].x=c.right,f[1].y=c.top,this.drawLine(f[0],f[1],u),f[0].x=c.left,f[0].y=c.bottom,f[1].x=c.right,f[1].y=c.bottom,this.drawLine(f[0],f[1],u),f[0].x=c.right,f[0].y=c.top,f[1].x=c.left,f[1].y=c.bottom,this.drawLine(f[0],f[1],u),f[0].x=c.right,f[0].y=c.bottom,f[1].x=c.left,f[1].y=c.top,this.drawLine(f[0],f[1],u)},C.prototype.DrawEnd=function(u){var c=this.GetDrawRect(),f=[new M.Vector3,new M.Vector3,new M.Vector3,new M.Vector3];f[0].x=c.left,f[0].y=c.top,f[1].x=c.right,f[1].y=c.top,f[2].x=c.right,f[2].y=c.bottom,f[3].x=c.left,f[3].y=c.bottom,this.drawLine(f[0],f[1],u),this.drawLine(f[1],f[2],u),this.drawLine(f[2],f[3],u),this.drawLine(f[3],f[0],u)},C.prototype.DrawMid=function(u){var c=this.GetDrawRect(),f=1.2*(c.right-c.left),O=f/2/Math.sin(60*3.14159265/180),W=O*Math.sin(.5235987750000001),X=new M.Vector3(this.m_pt.x,this.m_pt.y,this.m_pt.z);X.y-=O;var J=new M.Vector3;J.x=this.m_pt.x+f/2,J.y=this.m_pt.y+W;var te=new M.Vector3;te.x=this.m_pt.x-f/2,te.y=this.m_pt.y+W;var ne=[new M.Vector3,new M.Vector3,new M.Vector3,new M.Vector3];ne[0].x=X.x,ne[0].y=X.y,ne[1].x=J.x,ne[1].y=J.y,ne[2].x=te.x,ne[2].y=te.y,ne[3].x=X.x,ne[3].y=X.y,this.drawLine(ne[0],ne[1],u),this.drawLine(ne[1],ne[2],u),this.drawLine(ne[2],ne[3],u)},C.prototype.DrawPerp=function(u){var c=this.GetDrawRect(),f=[new M.Vector3,new M.Vector3,new M.Vector3];f[0].x=c.left,f[0].y=c.top,f[1].x=c.left,f[1].y=c.bottom,f[2].x=c.right,f[2].y=c.bottom,this.drawPolyline(f,u),f[0].x=c.left,f[0].y=this.m_pt.y,f[1].x=this.m_pt.x,f[1].y=this.m_pt.y,f[2].x=this.m_pt.x,f[2].y=c.bottom,this.drawPolyline(f,u)},C.prototype.DrawCircle=function(u,c,f){f==null&&(f=.5*this.m_dOsmodeWdith);for(var O=[],W=0,X=3.14159265/180;W<=360;W+=15){var J=f*Math.cos(W*X)+u.x,te=f*Math.sin(W*X)+u.y;O.push(new M.Vector3(J,te))}this.drawPolyline(O,c)},C.prototype.DrawInt=function(u){var c=this.GetDrawRect(),f=[new M.Vector3,new M.Vector3];f[0].x=c.right,f[0].y=c.top,f[1].x=c.left,f[1].y=c.bottom,this.drawLine(f[0],f[1],u),f[0].x=c.right,f[0].y=c.bottom,f[1].x=c.left,f[1].y=c.top,this.drawLine(f[0],f[1],u)},C.prototype.DrawCen=function(u){this.DrawInt(u),this.DrawCircle(this.m_pt,u)},C.prototype.DrawTan=function(u){this.DrawEnd(u)},C.prototype.DrawIns=function(u){var c=this.GetDrawRect(),f={},O=(c.right-c.left)/1.5;f.left=this.m_pt.x-O,f.right=this.m_pt.x+O,f.top=this.m_pt.y-O,f.bottom=this.m_pt.y+O;var W=this.m_pt.x,X=this.m_pt.y,J=[new M.Vector3,new M.Vector3,new M.Vector3,new M.Vector3,new M.Vector3,new M.Vector3,new M.Vector3,new M.Vector3,new M.Vector3];J[0].x=f.left,J[0].y=f.top,J[1].x=f.left,J[1].y=X+2,J[2].x=W,J[2].y=X+2,J[3].x=W,J[3].y=f.bottom,J[4].x=f.right,J[4].y=f.bottom,J[5].x=f.right,J[5].y=X-2,J[6].x=W,J[6].y=X-2,J[7].x=W,J[7].y=f.top,J[8].x=f.left,J[8].y=f.top,this.drawPolyline(J,u)},C.prototype.DrawNode=function(u){var c=this.GetDrawRect(),f={},O=(c.right-c.left)/1.5;f.left=this.m_pt.x-O,f.right=this.m_pt.x+O,f.top=this.m_pt.y-O,f.bottom=this.m_pt.y+O;var W=this.m_dOsmodeWdith/1.3;this.m_pt.x,this.m_pt.x,this.m_pt.y,this.m_pt.y;var X=[new M.Vector3,new M.Vector3,new M.Vector3,new M.Vector3];X[0].x=f.left,X[0].y=f.top,X[1].x=f.right,X[1].y=f.bottom,X[2].x=f.left,X[2].y=f.bottom,X[3].x=f.right,X[3].y=f.top,this.drawLine(X[0],X[1],u),this.drawLine(X[2],X[3],u),this.DrawCircle(this.m_pt,u,W)},C.prototype.draw=function(u,c,f){this.m_pt=u,this.m_osmode=c;var O=.5*this.m_dOsmodeWdith;if(this.m_osmode!=T.MxJigCmdManager.OsnapMode.kOsModekInValid)if(this.m_osmode==T.MxJigCmdManager.OsnapMode.kOsModeNear)this.DrawNear(f);else if(this.m_osmode==T.MxJigCmdManager.OsnapMode.kOsModeEnd)this.DrawEnd(f);else if(this.m_osmode==T.MxJigCmdManager.OsnapMode.kOsModeMid)this.DrawMid(f);else if(this.m_osmode==T.MxJigCmdManager.OsnapMode.kOsModePerp)this.DrawPerp(f);else if(this.m_osmode==T.MxJigCmdManager.OsnapMode.kOsModeInt)this.DrawInt(f);else if(this.m_osmode==T.MxJigCmdManager.OsnapMode.kOsModeCen)this.DrawCen(f);else if(this.m_osmode==T.MxJigCmdManager.OsnapMode.kOsModeTan)this.DrawTan(f);else if(this.m_osmode==T.MxJigCmdManager.OsnapMode.kOsModeIns)this.DrawIns(f);else if(this.m_osmode==T.MxJigCmdManager.OsnapMode.kOsModeNode)this.DrawNode(f);else{var W=new M.Vector3(u.x-O,u.y-O,0),X=new M.Vector3(u.x+O,u.y+O,0);this.drawLine(W,X,f);var J=new M.Vector3(u.x-O,u.y+O,0),te=new M.Vector3(u.x+O,u.y-O,0);this.drawLine(J,te,f)}},C.prototype.upDisplay=function(u,c,f){this.clearDisplay(f);var O=f.getMxObject();this.setWidth(O.screenCoordLong2Doc(Y.MxDrawData.m_dInputRectWidth)),u=O.toSmallcoord(u),this.draw(u,c,O.getTheTempDrawContainer_SmallCoord())},C.prototype.clearDisplay=function(u){var c=u.getMxObject().getTheTempDrawContainer_SmallCoord();h.clearDisplay(c)},C);function C(){this.m_iColor=16711935,this.m_addDynDrawObject_call=void 0,this.m_pt=new M.Vector3,this.m_osmode=T.MxJigCmdManager.OsnapMode.kOsModekInValid,this.m_dOsmodeWdith=10}o.McEdJigOsnapDraw=G;var B=(R.prototype.setSpecificOsMode=function(u){this.m_lSpecificOsMode=u},R.prototype.resetData=function(){this.m_osmode=T.MxJigCmdManager.OsnapMode.kOsModekInValid,this.m_isValidPrvInputPoint=!1,this.m_lOSmode=0,this.m_vecOffset.set(0,0,0),this.m_isValid=!1,this.m_iLongprogressStatus=-1,this.m_lSpecificOsMode=0,this.reComputeOffset()},R.prototype.notifyOsnapToServer=function(){var u=this;if(this.m_isRuning){var c={ptx:this.m_pt.x,pty:this.m_pt.y,osmode:this.m_lOSmode,isValidPrvInputPoint:this.m_isValidPrvInputPoint};this.m_isValidPrvInputPoint&&(c.prvPtx=this.m_prvInputPoint.x,c.prvPty=this.m_prvInputPoint.y);var f=this.m_mxJig.getMxObject();if(f.getRunMode()==N.MxRunMode.kBrowse){var O=this,W=f.getCurrentMousePostion();f.getObjectOsnap().getOsnapData(W,function(te,ne){te=f.worldCoord2Doc(te.x,te.y,te.z),O.m_ptSnapPoint.x=te.x,O.m_ptSnapPoint.y=te.y,O.m_ptSnapPoint.z=0,O.m_ptSnapSrcPoint.x=O.m_pt.x,O.m_ptSnapSrcPoint.y=O.m_pt.y,O.m_ptSnapSrcPoint.z=0,O.m_osmode=ne,O.m_draw.upDisplay(new M.Vector3(te.x,te.y,0),ne,O.m_mxJig)})}else if(f.getRunMode()==N.MxRunMode.kCPPMxCAD){var X=this;c.SearchRnge=f.viewCoordLong2Cad(Y.MxDrawData.m_dInputRectWidth),f.getMcObject().onNotifyOsnap(c,function(te){X.m_ptSnapPoint.x=te.ptsx,X.m_ptSnapPoint.y=te.ptsy,X.m_ptSnapPoint.z=te.ptsz,X.m_ptSnapSrcPoint.x=te.ptx,X.m_ptSnapSrcPoint.y=te.pty,X.m_ptSnapSrcPoint.z=0,X.m_osmode=te.osmode,X.m_snapObjectId=te.id,X.m_draw.upDisplay(new M.Vector3(te.ptsx,te.ptsy,te.ptsz),te.osmode,X.m_mxJig),X.m_mxJig.onGetOsnapData(te)})}else{c.SearchRnge=f.viewCoordLong2Cad(Y.MxDrawData.m_dInputRectWidth);var J=this;f.callCommand("MxCAD_NotifyOsnap",JSON.stringify(c),function(te){if(!(typeof te!="string"||te.length<1)&&J.m_isRuning){var ne=JSON.parse(te);u.m_ptSnapPoint.x=ne.ptsx,u.m_ptSnapPoint.y=ne.ptsy,u.m_ptSnapPoint.z=ne.ptsz,u.m_ptSnapSrcPoint.x=ne.ptx,u.m_ptSnapSrcPoint.y=ne.pty,u.m_ptSnapSrcPoint.z=0,u.m_osmode=ne.osmode,J.m_draw.upDisplay(new M.Vector3(ne.ptsx,ne.ptsy,ne.ptsz),ne.osmode,J.m_mxJig)}})}}},R.prototype.startDrag=function(u,c){this.m_mxJig=c;var f,O,W=this.m_mxJig.getMxObject();function X(){f.notifyOsnapToServer()}return c.isDisableOsnap()?this.m_isEnable=!1:this.m_isEnable=W.getInisetValue(N.IniSetName.kEnableOsnapFunction)===!0,this.m_isOffsetInputPostion=u,this.m_isRuning=!0,this.resetData(),this.m_notifyOsnap_delayCall=(f=this,O=null,function(){clearTimeout(O),O=setTimeout(X,20)}),!0},R.prototype.endDrag=function(){return this.m_isRuning=!1,this.m_draw.clearDisplay(this.m_mxJig),!0},R.prototype.reCompteCurrentPoint=function(u){return this.m_isOffsetInputPostion&&u.add(this.m_vecOffset),u},R.prototype.getIsEnableVar=function(){return this.m_isEnable},R.prototype.isEnable=function(){if(!this.isEnable||h.isTmpDisableOsmode())return!1;var u=this.m_mxJig.getMxObject().getSysVarLong("OSMODE");return this.m_lSpecificOsMode!=0&&(u=this.m_lSpecificOsMode),!(u==0||u&a.OsModeOff)},R.prototype.notifyOsnap=function(u,c){this.m_lOSmode=u,c==null?this.m_isValidPrvInputPoint=!1:(this.m_isValidPrvInputPoint=!0,this.m_prvInputPoint=c),this.m_osmode==T.MxJigCmdManager.OsnapMode.kOsModekInValid&&this.m_draw.clearDisplay(this.m_mxJig),this.m_notifyOsnap_delayCall()},R.prototype.setPoint=function(u,c){if(this.isEnable()){u==null?(this.m_isValid=!1,this.m_osmode=T.MxJigCmdManager.OsnapMode.kOsModekInValid):(this.m_iLongprogressStatus==-1||this.m_iLongprogressStatus,this.m_pt=u,this.m_inPoint=u,this.m_isValid=!0,(c==null||this.m_osmode!=T.MxJigCmdManager.OsnapMode.kOsModekInValid&&_.MxTools.getXYPlanDistance(this.m_ptSnapSrcPoint,u)>c)&&(this.m_osmode=T.MxJigCmdManager.OsnapMode.kOsModekInValid));var f=this.m_mxJig.getMxObject().getSysVarLong("OSMODE");this.m_lSpecificOsMode!=0&&(f=this.m_lSpecificOsMode);var O=h.getPrvPoint();this.notifyOsnap(f,h.isValidPrvpoint()?O:void 0)}},R.prototype.seInValidPoint=function(){this.setPoint(void 0)},R.prototype.getCurrentOSnapPoint=function(u){var c={isSnapPoint:!1};return this.isEnable()?(c.pt=u,c.osmode=this.m_osmode,this.m_osmode!=T.MxJigCmdManager.OsnapMode.kOsModekInValid?(c.isSnapPoint=!0,c.pt.x=this.m_ptSnapPoint.x,c.pt.y=this.m_ptSnapPoint.y,c.pt.z=this.m_ptSnapPoint.z,h.isOsnapZValue()||(u.z=0)):c.pt=u):(c.pt=u,c.osmode=T.MxJigCmdManager.OsnapMode.kOsModekInValid),c},R.prototype.setLongprogressStatus=function(u){this.m_iLongprogressStatus=u},R.prototype.reComputeOffset=function(){if(this.m_isOffsetInputPostion){var u=this.m_mxJig.getMxObject(),c=_.MxTools.MillimeterToPixels(8);c=u.screenCoordLong2Doc(c),this.m_vecOffset.set(0,c,0),this.m_vecOffset.applyAxisAngle(new M.Vector3(0,0,1),20*Math.PI/180)}},R);function R(u){this.m_inPoint=new M.Vector3,this.m_vecOffset=new M.Vector3,this.m_pt=new M.Vector3,this.m_isValid=!1,this.m_ptSnapPoint=new M.Vector3,this.m_ptSnapSrcPoint=new M.Vector3,this.m_snapObjectId=0,this.m_osmode=T.MxJigCmdManager.OsnapMode.kOsModekInValid,this.m_prvInputPoint=new M.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_lSpecificOsMode=0,this.m_mxJig=u,this.m_draw=new G}o.McEdJigOsnap=B},{"../MxDrawData":22,"../MxDrawObject":23,"../MxFun":27,"../MxTools":38,"./MxJigCmdManager":54,three:19}],44:[function(w,r,o){var a,v=this&&this.__extends||(a=function(_,Y){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,S){k.__proto__=S}||function(k,S){for(var G in S)Object.prototype.hasOwnProperty.call(S,G)&&(k[G]=S[G])})(_,Y)},function(_,Y){function k(){this.constructor=_}a(_,Y),_.prototype=Y===null?Object.create(Y):(k.prototype=Y.prototype,new k)});Object.defineProperty(o,"__esModule",{value:!0}),o.McGiWorldDrawSelect=o.McGiWorldDraw=o.McGiWorldDrawType=void 0;var h,b,D=w("three"),U=w("../MxThreeJS"),V=w("../MxManager"),I=w("three.meshline"),g=w("../MxFun");(b=h=o.McGiWorldDrawType||(o.McGiWorldDrawType={}))[b.kWorldDraw=1]="kWorldDraw",b[b.kDynDragDraw=2]="kDynDragDraw",b[b.kSelectDraw=3]="kSelectDraw";var A=(M.prototype.getType=function(){return this.worldDrawType},M.prototype.setXData=function(_){this.xData=_},M.prototype.setMatrix=function(_){this.matrix=_},M.prototype.getMatrix=function(){return this.matrix},M.prototype.setOpacity=function(_){this.opacity=_},M.prototype.getOpacity=function(){return this.opacity},M.prototype.setColor=function(_){_=g.MxFun.getNumberColor(_),this.iColor!=_&&(this.widthMaterial=null),this.iColor=_},M.prototype.setDash=function(_,Y){this.dDashArray=_,this.dDashRatio=Y},M.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},M.prototype.setDashLineDisplay=function(_){_?(this.dDashArray=.03,this.dDashRatio=.1,this.dLineWidth==0&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},M.prototype.isDashLineDisplay=function(){return 0<this.dDashArray&&0<this.dDashRatio},M.prototype.getColor=function(){return this.iColor},M.prototype.setRenderOrder=function(_){this.iRenderOrder=_},M.prototype.getRenderOrder=function(){return this.iRenderOrder},M.prototype.setLineWidthByPixels=function(_){this.lineWidthByPixels!=_&&(this.widthMaterial=null),this.lineWidthByPixels=_},M.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},M.prototype.setLineWidth=function(_){this.dLineWidth!=_&&(this.widthMaterial=null),this.dLineWidth=_},M.prototype.getLineWidth=function(){return this.dLineWidth},M.prototype.drawEntity=function(_){var Y=this.iRenderOrder;_.type=="Group"?_.traverse(function(k){k.type!="Group"&&(k.renderOrder=Y)}):_.renderOrder=Y,this.matrix!=null&&_.applyMatrix4(this.matrix),this.aryEntity.push(_),this.xData&&(_.MxWordDrawXData=this.xData,this.xData=null)},M.prototype.getEntitys=function(){return this.aryEntity},M.prototype.getMxObject=function(){return this.mxObj},M.prototype.createWidthMaterial=function(){this.widthMaterial==null&&(0<this.dDashArray&&0<this.dDashRatio?this.widthMaterial=new I.MeshLineMaterial({useMap:!1,color:this.iColor,opacity:1,resolution:new D.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 I.MeshLineMaterial({useMap:!1,color:this.iColor,opacity:1,resolution:new D.Vector2(this.mxObj.getViewWidth(),this.mxObj.getViewHeight()),sizeAttenuation:!this.lineWidthByPixels,lineWidth:this.dLineWidth,transparent:!0,depthTest:!1}))},M.prototype.drawSolid=function(_){if(!(_.length<3)){var Y=new D.Shape(_.map(function(G){var C=G.x,B=G.y;return new D.Vector2(C,B)})),k=new D.ShapeGeometry(Y),S=new D.Mesh(k,new D.MeshPhongMaterial({color:this.getColor(),side:D.DoubleSide,transparent:!0,opacity:this.getOpacity()}));this.drawEntity(S)}},M.prototype.drawLines=function(_){if(!(_.length<2))if(this.dLineWidth!=0){this.createWidthMaterial();var Y=new D.Geometry;Y.vertices=_;var k=new I.MeshLine;k.setGeometry(Y);var S=new D.Mesh(k.geometry,this.widthMaterial);this.drawEntity(S),this.drawEntity(U.MxThreeJS.createLines(_.slice(0),this.iColor,0))}else this.drawEntity(U.MxThreeJS.createLines(_.slice(0),this.iColor,this.opacity))},M.prototype.drawGeometryLines=function(_){if(!(_.vertices.length<2))if(this.dLineWidth!=0){this.createWidthMaterial();var Y=new I.MeshLine;if(!(_ instanceof D.Geometry)){var k=new D.Geometry;k.vertices=_.vertices,_=k}Y.setGeometry(_);var S=new D.Mesh(Y.geometry,this.widthMaterial);this.drawEntity(S);var G=new D.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1,opacity:0}),C=new D.Line(_,G);this.drawEntity(C)}else G=void 0,G=this.opacity&&this.opacity!=1||this.opacity==0?new D.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1,opacity:this.opacity}):new D.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1}),C=new D.Line(_,G),this.drawEntity(C)},M.prototype.drawSelectLine=function(_,Y,k,S){_ instanceof Object&&Y instanceof Object?this.drawEntity(U.MxThreeJS.createLine(_,Y,this.iColor,0)):typeof _=="number"&&typeof Y=="number"&&this.drawEntity(U.MxThreeJS.createLine(new D.Vector3(_,Y,0),new D.Vector3(k,S,0),this.iColor,0))},M.prototype.drawLine=function(_,Y,k,S){var G,C;if(_ instanceof Object&&Y instanceof Object?(G=_,C=Y):typeof _=="number"&&typeof Y=="number"&&(G=new D.Vector3(_,Y,0),C=new D.Vector3(k,S,0)),this.dLineWidth!=0){this.createWidthMaterial();var B=new Float32Array(6);B[0]=G.x,B[1]=G.y,B[2]=0,B[3]=C.x,B[4]=C.y,B[5]=0;var R=new I.MeshLine;R.setGeometry(B);var u=new D.Mesh(R.geometry,this.widthMaterial);u.renderOrder=this.iRenderOrder,this.drawEntity(u),this.drawSelectLine(G,C)}else this.drawEntity(U.MxThreeJS.createLine(G,C,this.iColor,this.opacity))},M.prototype.drawCircle=function(_,Y){this.drawEntity(U.MxThreeJS.createCircle(_,Y,this.iColor))},M.prototype.drawText=function(_,Y,k,S,G,C){var B=U.MxThreeJS.creatTextSprite(_,S,Y,k,this.iColor,G,C);return this.drawEntity(B),B},M.prototype.setupForEntity=function(_){this.iColor=g.MxFun.getNumberColor(_.getColor()),this.iRenderOrder=_.getRenderOrder(),this.opacity=_.opacity,this.dLineWidth=_.getLineWidth(),this.lineWidthByPixels=_.getLineWidthByPixels(),this.dDashArray=_.getDash().dDashArray,this.dDashRatio=_.getDash().dDashRatio},M);function M(_,Y){this.aryEntity=[],this.iColor=16777215,this.dLineWidth=0,this.lineWidthByPixels=!0,this.iRenderOrder=V.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=_,this.worldDrawType=Y}o.McGiWorldDraw=A;var N,F=(v(T,N=A),T.prototype.setSmallCoordDraw=function(_){this.isSmallCorrdDraw=_},T.prototype.setCurEntityId=function(_){this.curEntityId=_},T.prototype.drawEntity=function(_){},T.prototype.drawText=function(_,Y,k,S,G,C){return null},T.prototype.drawSelectLine=function(_,Y,k,S){},T.prototype.isValid=function(){return this.curEntityId!=0||(console.log("this.curEntityId == 0"),!1)},T.prototype.drawLine=function(_,Y,k,S){var G,C;this.isValid()&&(_ instanceof Object&&Y instanceof Object?(G=_,C=Y):typeof _=="number"&&typeof Y=="number"&&(G=new D.Vector3(_,Y,0),C=new D.Vector3(k,S,0)),this.selectManager.addLineDisplay(this.curEntityId,G,C,this.isSmallCorrdDraw))},T.prototype.drawCircle=function(_,Y){this.isValid()&&this.selectManager.addCircleDisplay(this.curEntityId,_,Y,this.isSmallCorrdDraw)},T.prototype.drawLines=function(_){if(!(_.length<2))for(var Y=_.length,k=0;k<Y-1;k++)this.selectManager.addLineDisplay(this.curEntityId,_[k],_[k+1],this.isSmallCorrdDraw)},T);function T(_,Y){var k=N.call(this,_,h.kSelectDraw)||this;return k.isSmallCorrdDraw=!1,k.selectManager=Y,k.curEntityId=0,k.isSmallCorrdDraw=!1,k}o.McGiWorldDrawSelect=F},{"../MxFun":27,"../MxManager":29,"../MxThreeJS":37,three:19,"three.meshline":18}],45:[function(w,r,o){var a,v=this&&this.__extends||(a=function(B,R){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(u[f]=c[f])})(B,R)},function(B,R){function u(){this.constructor=B}a(B,R),B.prototype=R===null?Object.create(R):(u.prototype=R.prototype,new u)});Object.defineProperty(o,"__esModule",{value:!0}),o.MrxDbgUiPrBase=o.MrxDbgUiPrBase_Return=o.McEdGetPointWorldDrawObject=o.McEdGetPointWorldDraw=void 0;var h=w("three"),b=w("./MxJig"),D=w("./MxJigCmdManager"),U=w("../MxThreeJS"),V=w("../UI/MxUiVue"),I=w("../MxString"),g=w("./McGiWorldDraw"),A=w("../MxManager"),M=(N.prototype.setMcEdJig=function(B){this.m_pJig=B},N.prototype.getMcEdJig=function(){return this.m_pJig},N.prototype.setColor=function(B){this.m_iColor=B},N.prototype.getColor=function(){return this.m_iColor},N.prototype.getDrawColor=function(){return this.m_pJig.getMxObject().automaticInversionColor(this.m_iColor)},N.prototype.drawLine=function(B,R){this.m_pJig.drawEntity(U.MxThreeJS.createLine(B,R,this.getDrawColor()))},N.prototype.drawRect=function(B,R){var u=new h.Vector3(B.x,R.y,0),c=new h.Vector3(R.x,B.y,0);this.drawLine(B,u),this.drawLine(u,R),this.drawLine(R,c),this.drawLine(c,B)},N.prototype.drawMcDbEntity=function(B,R){this.m_pJig.drawMcDbEntity(B,R?0:this.getDrawColor(),R)},N.prototype.drawMcDbLine=function(B,R,u,c,f,O){this.m_pJig.drawMcDbLine(B,R,u,c,f,O,this.getDrawColor())},N.prototype.drawCircle=function(B,R){this.m_pJig.drawEntity(U.MxThreeJS.createCircle(B,R,this.getDrawColor()))},N.prototype.drawEntity=function(B,R,u){u===void 0&&(u=!1),this.m_pJig.drawEntity(B,R,u)},N.prototype.drawText=function(B,R,u,c){var f=U.MxThreeJS.creatTextSprite(B,c,R,u,this.getDrawColor());this.drawEntity(f)},N.prototype.drawSolid=function(B,R){var u=U.MxThreeJS.createSolid(B,this.getDrawColor(),R);u&&this.drawEntity(u)},N.prototype.drawCustomEntity=function(B,R){var u=new g.McGiWorldDraw(this.m_pJig.getMxObject(),g.McGiWorldDrawType.kDynDragDraw);u.setupForEntity(B),B.worldDraw(u);for(var c=u.getEntitys(),f=c.length,O=0;O<f;O++)this.drawEntity(c[O],R,B.isUseSmallcoordDisplay())},N);function N(){this.m_pJig=null,this.m_iColor=16777215}o.McEdGetPointWorldDraw=M;var F,T,_,Y=(v(k,F=M),k.prototype.setDraw=function(B){this.m_callDraw=B},k.prototype.worldDraw=function(B){this.m_callDraw!=null&&this.m_callDraw(B,this)},k);function k(){var B=F!==null&&F.apply(this,arguments)||this;return B.m_callDraw=void 0,B}o.McEdGetPointWorldDrawObject=Y,(_=T=o.MrxDbgUiPrBase_Return||(o.MrxDbgUiPrBase_Return={}))[_.kCancel=-2]="kCancel",_[_.kNone=-1]="kNone",_[_.kOk=0]="kOk",_[_.kKeyWord=1]="kKeyWord";var S,G=(v(C,S=b.McEdJigCommand),C.prototype.procInKeyword=function(B){B.status>=D.MxJigCmdManager.DragStatus.kKW1&&0<B.sKeyValue.length?this.m_keyWordPicked=B.sKeyValue.toUpperCase():this.m_keyWordPicked=""},C.prototype.getReturnStatus=function(B){switch(B){case D.MxJigCmdManager.DragStatus.kNoChange:return T.kNone;case D.MxJigCmdManager.DragStatus.kCancel:return T.kCancel;case D.MxJigCmdManager.DragStatus.kNull:return T.kNone;case D.MxJigCmdManager.DragStatus.kNormal:return T.kOk}return 1<=B?T.kKeyWord:T.kCancel},C.prototype.SetLASTPOINT=function(B){var R=this._mxObject;if((R=R||A.MxManager.currentMx()).sysVariable().setSysVarPoint("LASTPOINT",B),B){var u=R.sysVariable().getSysVarNumber("GETPOINTSTATUS");u|=D.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint,R.sysVariable().setSysVarNumber("GETPOINTSTATUS",u)}else u=R.sysVariable().getSysVarNumber("GETPOINTSTATUS"),u&=~D.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint,R.sysVariable().setSysVarNumber("GETPOINTSTATUS",u)},C.prototype.clearLastInputPoint=function(){this._mxObject||(this._mxObject=A.MxManager.currentMx()),this.SetLASTPOINT(void 0)},C.prototype.setCursorType=function(B){this.m_cursorType=B},C.prototype.getCursorType=function(){return this.m_cursorType},C.prototype.setInputToucheType=function(B){this.m_toucheType=B},C.prototype.getInputToucheType=function(){return this.m_toucheType},C.prototype.keyWords=function(){return this.m_keyWords},C.prototype.setKeyWords=function(B){this.m_keyWords=B},C.prototype.message=function(){return this.m_message},C.prototype.setMessage=function(B){this.m_message=B},C.prototype.keyWordPicked=function(){return this.m_keyWordPicked},C.prototype.isKeyWordPicked=function(B){return B=B.toUpperCase(),this.m_keyWordPicked==B},C.prototype.setUserDraw=function(B){B.setMcEdJig(this),this.m_pWorldDraw=B},C.prototype.printMessage=function(){var B=new I.MxString(this.m_message);B.TrimRight(":"),1<this.m_keyWords.length&&this.m_keyWords[0]=="["&&this.m_keyWords[this.m_keyWords.length-1]=="]"?B.m_val.indexOf(`
|
|
`)==-1?V.MxUiVue.acutPrintf(`
|
|
`+B.m_val+" 或"+this.m_keyWords+":"):V.MxUiVue.acutPrintf(B.m_val+" 或"+this.m_keyWords+":"):B.m_val.indexOf(`
|
|
`)==-1?V.MxUiVue.acutPrintf(`
|
|
`+B.m_val+":"):V.MxUiVue.acutPrintf(B.m_val+":")},C);function C(){var B=S!==null&&S.apply(this,arguments)||this;return B.m_keyWords="",B.m_message="",B.m_keyWordPicked="",B.m_pWorldDraw=null,B.m_toucheType=D.MxJigCmdManager.InType.kGetBegan,B.m_cursorType=V.MxUiVue.CursorType.kNormal,B}o.MrxDbgUiPrBase=G},{"../MxManager":29,"../MxString":34,"../MxThreeJS":37,"../UI/MxUiVue":65,"./McGiWorldDraw":44,"./MxJig":53,"./MxJigCmdManager":54,three:19}],46:[function(w,r,o){var a,v=this&&this.__extends||(a=function(f,O){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,X){W.__proto__=X}||function(W,X){for(var J in X)Object.prototype.hasOwnProperty.call(X,J)&&(W[J]=X[J])})(f,O)},function(f,O){function W(){this.constructor=f}a(f,O),f.prototype=O===null?Object.create(O):(W.prototype=O.prototype,new W)});Object.defineProperty(o,"__esModule",{value:!0}),o.MrxDbgUiPrAngle=o.MrxDbgUiPrKeyWord=o.MrxDbgUiPrString=o.MrxDbgUiPrInt=o.MrxDbgUiPrDist=void 0;var h,b=w("three"),D=w("./MxJigCmdManager"),U=w("../MxFun"),V=w("./MrxDbgUiPrBase"),I=w("../UI/MxUiVue"),g=w("../MxThreeJS"),A=w("../MxString"),M=(v(N,h=V.MrxDbgUiPrBase),N.prototype.value=function(){return this.m_value},N.prototype.basePt=function(){return new b.Vector3(this.m_basePt.x,this.m_basePt.y,0)},N.prototype.setBasePt=function(f){this.m_basePt==null?this.m_basePt=new b.Vector3(f.x,f.y,0):(this.m_basePt.x=f.x,this.m_basePt.y=f.y),this.m_useBasePt=!0},N.prototype.setUseBasePt=function(f){this.m_useBasePt=f},N.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null,this.clearLastInputPoint(),this.getDynImput().setGetNumber(!0),this.m_useBasePt&&this.SetLASTPOINT(this.m_basePt)},N.prototype.go=function(f){this.initGo(),this.m_retcall=f,this.m_previousInPoint=null,this.m_currentInPoint=null,this.m_value=0,D.MxJigCmdManager.runCmd(this)},N.prototype.onExitCommand=function(){var f=this;I.MxUiVue.setCursorType(I.MxUiVue.CursorType.kNormal);var O=!1;this.m_retcall!=null&&(D.MxJigCmdManager.setRunCmdEvent(function(){h.prototype.onExitCommand.call(f,!1),O=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),D.MxJigCmdManager.setRunCmdEvent(void 0)),!O&&D.MxJigCmdManager.isWaitCmdNull()&&I.MxUiVue.restoreCmdStatus(),O||h.prototype.onExitCommand.call(this,!0)},N.prototype.onStartCommand=function(){I.MxUiVue.setCursorType(this.m_cursorType),this.printMessage(),D.MxJigCmdManager.setKeywordList(this.keyWords()),h.prototype.onStartCommand.call(this)},N.prototype.sampler=function(){var f,O=D.MxJigCmdManager.acquirePoint(this.m_toucheType,!1);return O.status==D.MxJigCmdManager.DragStatus.kNormal&&(this.m_currSamplerPoint==null?this.m_currSamplerPoint=new b.Vector3(O.pt.x,O.pt.y,0):(this.m_currSamplerPoint.x=O.pt.x,this.m_currSamplerPoint.y=O.pt.y)),f=this.m_useBasePt?this.acquireDist(this.m_toucheType,this.m_basePt):this.acquireDist(this.m_toucheType,this.m_currentInPoint),this.procInKeyword(f),f.status==D.MxJigCmdManager.DragStatus.kNormal?(this.m_value=f.dist,f.status):f.status==D.MxJigCmdManager.DragStatus.kKW1?f.status:this.m_useBasePt||this.m_currentInPoint?O.status:((f=this.acquirePoint(this.m_toucheType,!1)).status==D.MxJigCmdManager.DragStatus.kNormal&&f.exit&&(this.m_previousInPoint==null?this.m_previousInPoint=new b.Vector3(f.pt.x,f.pt.y,0):(this.m_previousInPoint.x=f.pt.x,this.m_previousInPoint.y=f.pt.y)),f.status)},N.prototype.done=function(f){if(this.m_retcall!=null)return this.m_resultDragStatus=f,this.m_useBasePt||f!=D.MxJigCmdManager.DragStatus.kNormal||!this.m_previousInPoint||this.m_currentInPoint?D.MxJigCmdManager.DoneStatius.kExitCommand:(this.m_currentInPoint=this.m_previousInPoint,this.m_previousInPoint=null,D.MxJigCmdManager.DoneStatius.kContinueCommand);U.MxFun.Assert(0)},N.prototype.upDisplay=function(){this.m_currSamplerPoint&&(this.m_pWorldDraw&&(this._mxObject.getMcObject().onReadyJigUpdateDispla(),this.m_pWorldDraw.worldDraw(this.m_currSamplerPoint)),this.m_useBasePt&&this.m_basePt?this.drawEntity(g.MxThreeJS.createLine(this.m_currSamplerPoint,this.m_basePt,16777215)):this.m_currentInPoint&&this.drawEntity(g.MxThreeJS.createLine(this.m_currSamplerPoint,this.m_currentInPoint,16777215)))},N);function N(){var f=h.call(this)||this;return f.m_useBasePt=!1,f.m_basePt=null,f.m_previousInPoint=null,f.m_currentInPoint=null,f.m_value=0,f.m_currSamplerPoint=null,f.m_retcall=null,f.m_resultDragStatus=D.MxJigCmdManager.DragStatus.kCancel,f.m_cursorType=I.MxUiVue.CursorType.kCross,f}o.MrxDbgUiPrDist=M;var F,T=(v(_,F=V.MrxDbgUiPrBase),_.prototype.value=function(){return this.m_value},_.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null,this.clearLastInputPoint()},_.prototype.go=function(f){this.initGo(),this.m_retcall=f,this.m_value=0,this.m_currSamplerPoint=null,this.getDynImput().setGetNumber(!0),D.MxJigCmdManager.runCmd(this)},_.prototype.onExitCommand=function(){var f=this;I.MxUiVue.setCursorType(I.MxUiVue.CursorType.kNormal);var O=!1;this.m_retcall!=null&&(D.MxJigCmdManager.setRunCmdEvent(function(){F.prototype.onExitCommand.call(f,!1),O=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),D.MxJigCmdManager.setRunCmdEvent(void 0)),!O&&D.MxJigCmdManager.isWaitCmdNull()&&I.MxUiVue.restoreCmdStatus(),O||F.prototype.onExitCommand.call(this,!0)},_.prototype.onStartCommand=function(){I.MxUiVue.setCursorType(this.m_cursorType),this.printMessage(),D.MxJigCmdManager.setKeywordList(this.keyWords()),F.prototype.onStartCommand.call(this)},_.prototype.sampler=function(){var f=D.MxJigCmdManager.acquirePoint(this.m_toucheType,!1);f.status==D.MxJigCmdManager.DragStatus.kNormal&&(this.m_currSamplerPoint==null?this.m_currSamplerPoint=new b.Vector3(f.pt.x,f.pt.y,0):(this.m_currSamplerPoint.x=f.pt.x,this.m_currSamplerPoint.y=f.pt.y));var O=this.acquireInt();return this.procInKeyword(O),O.status==D.MxJigCmdManager.DragStatus.kNormal?this.m_value=O.iVal:(O.status,D.MxJigCmdManager.DragStatus.kKW1),O.status},_.prototype.done=function(f){if(this.m_retcall!=null)return this.m_resultDragStatus=f,D.MxJigCmdManager.DoneStatius.kExitCommand;U.MxFun.Assert(0)},_.prototype.upDisplay=function(){this.m_currSamplerPoint&&this.m_pWorldDraw&&(this._mxObject.getMcObject().onReadyJigUpdateDispla(),this.m_pWorldDraw.worldDraw(this.m_currSamplerPoint))},_);function _(){var f=F.call(this)||this;return f.m_value=0,f.m_currSamplerPoint=null,f.m_retcall=null,f.m_resultDragStatus=D.MxJigCmdManager.DragStatus.kCancel,f.m_cursorType=I.MxUiVue.CursorType.kNormal,f.setDynamicInputType(D.MxJigCmdManager.DynamicInputType.kNoInput),f}o.MrxDbgUiPrInt=T;var Y,k=(v(S,Y=V.MrxDbgUiPrBase),S.prototype.value=function(){return this.m_value},S.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null},S.prototype.go=function(f){this.initGo(),this.m_retcall=f,this.m_value="",this.m_currSamplerPoint=null,D.MxJigCmdManager.runCmd(this)},S.prototype.onExitCommand=function(){var f=this;I.MxUiVue.setCursorType(I.MxUiVue.CursorType.kNormal);var O=!1;this.m_retcall!=null&&(D.MxJigCmdManager.setRunCmdEvent(function(){Y.prototype.onExitCommand.call(f,!1),O=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),D.MxJigCmdManager.setRunCmdEvent(void 0)),!O&&D.MxJigCmdManager.isWaitCmdNull()&&I.MxUiVue.restoreCmdStatus(),O||Y.prototype.onExitCommand.call(this,!0)},S.prototype.onStartCommand=function(){I.MxUiVue.setCursorType(this.m_cursorType),this.printMessage(),D.MxJigCmdManager.setKeywordList(this.keyWords()),Y.prototype.onStartCommand.call(this)},S.prototype.sampler=function(){var f=D.MxJigCmdManager.acquirePoint(this.m_toucheType,!1);f.status==D.MxJigCmdManager.DragStatus.kNormal&&(this.m_currSamplerPoint==null?this.m_currSamplerPoint=new b.Vector3(f.pt.x,f.pt.y,0):(this.m_currSamplerPoint.x=f.pt.x,this.m_currSamplerPoint.y=f.pt.y));var O=this.acquireString();return this.procInKeyword(O),O.status==D.MxJigCmdManager.DragStatus.kNormal?this.m_value=O.sValue:(O.status,D.MxJigCmdManager.DragStatus.kKW1),O.status},S.prototype.done=function(f){if(this.m_retcall!=null)return this.m_resultDragStatus=f,D.MxJigCmdManager.DoneStatius.kExitCommand;U.MxFun.Assert(0)},S.prototype.upDisplay=function(){this.m_currSamplerPoint&&this.m_pWorldDraw&&(this._mxObject.getMcObject().onReadyJigUpdateDispla(),this.m_pWorldDraw.worldDraw(this.m_currSamplerPoint))},S);function S(){var f=Y.call(this)||this;return f.m_value="",f.m_currSamplerPoint=null,f.m_retcall=null,f.m_resultDragStatus=D.MxJigCmdManager.DragStatus.kCancel,f.m_cursorType=I.MxUiVue.CursorType.kCross,f}o.MrxDbgUiPrString=k;var G,C=(v(B,G=V.MrxDbgUiPrBase),B.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null},B.prototype.printMessage=function(){var f=new A.MxString(this.m_message);f.TrimRight(":"),1<this.m_keyWords.length&&this.m_keyWords[0]=="["&&this.m_keyWords[this.m_keyWords.length-1]=="]"?f.m_val.indexOf(`
|
|
`)==-1?I.MxUiVue.acutPrintf(`
|
|
`+f.m_val+" "+this.m_keyWords+":"):I.MxUiVue.acutPrintf(f.m_val+" "+this.m_keyWords+":"):f.m_val.indexOf(`
|
|
`)==-1?I.MxUiVue.acutPrintf(`
|
|
`+f.m_val+":"):I.MxUiVue.acutPrintf(f.m_val+":")},B.prototype.go=function(f){this.initGo(),this.m_retcall=f,this.m_currSamplerPoint=null,D.MxJigCmdManager.runCmd(this)},B.prototype.onExitCommand=function(){var f=this;I.MxUiVue.setCursorType(I.MxUiVue.CursorType.kNormal);var O=!1;this.m_retcall!=null&&(D.MxJigCmdManager.setRunCmdEvent(function(){G.prototype.onExitCommand.call(f,!1),O=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),D.MxJigCmdManager.setRunCmdEvent(void 0)),!O&&D.MxJigCmdManager.isWaitCmdNull()&&I.MxUiVue.restoreCmdStatus(),O||G.prototype.onExitCommand.call(this,!0)},B.prototype.onStartCommand=function(){I.MxUiVue.setCursorType(this.m_cursorType),this.printMessage(),D.MxJigCmdManager.setKeywordList(this.keyWords()),G.prototype.onStartCommand.call(this)},B.prototype.sampler=function(){var f=D.MxJigCmdManager.acquirePoint(this.m_toucheType,!1);f.status==D.MxJigCmdManager.DragStatus.kNormal&&(this.m_currSamplerPoint==null?this.m_currSamplerPoint=new b.Vector3(f.pt.x,f.pt.y,0):(this.m_currSamplerPoint.x=f.pt.x,this.m_currSamplerPoint.y=f.pt.y));var O=this.acquireKeyword();return this.procInKeyword(O),O.status,D.MxJigCmdManager.DragStatus.kKW1,O.status},B.prototype.done=function(f){if(this.m_retcall!=null)return f>=D.MxJigCmdManager.DragStatus.kKW1&&(f=D.MxJigCmdManager.DragStatus.kNormal),this.m_resultDragStatus=f,D.MxJigCmdManager.DoneStatius.kExitCommand;U.MxFun.Assert(0)},B.prototype.upDisplay=function(){this.m_currSamplerPoint&&this.m_pWorldDraw&&(this._mxObject.getMcObject().onReadyJigUpdateDispla(),this.m_pWorldDraw.worldDraw(this.m_currSamplerPoint))},B);function B(){var f=G.call(this)||this;return f.m_currSamplerPoint=null,f.m_retcall=null,f.m_resultDragStatus=D.MxJigCmdManager.DragStatus.kCancel,f.m_cursorType=I.MxUiVue.CursorType.kCross,f.setUserInputControls(0),f.setDisableDynInput(!0),f}o.MrxDbgUiPrKeyWord=C;var R,u=(v(c,R=V.MrxDbgUiPrBase),c.prototype.value=function(){return this.m_value},c.prototype.basePt=function(){return new b.Vector3(this.m_basePt.x,this.m_basePt.y,0)},c.prototype.setBasePt=function(f){this.m_basePt==null?this.m_basePt=new b.Vector3(f.x,f.y,0):(this.m_basePt.x=f.x,this.m_basePt.y=f.y),this.m_useBasePt=!0},c.prototype.setUseBasePt=function(f){this.m_useBasePt=f},c.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null,this.getDynImput().setGetNumber(!0),this.clearLastInputPoint(),this.m_useBasePt&&this.SetLASTPOINT(this.m_basePt)},c.prototype.go=function(f){this.initGo(),this.m_retcall=f,this.m_previousInPoint=null,this.m_currentInPoint=null,this.m_value=0,D.MxJigCmdManager.runCmd(this)},c.prototype.onExitCommand=function(){var f=this;I.MxUiVue.setCursorType(I.MxUiVue.CursorType.kNormal);var O=!1;this.m_retcall!=null&&(D.MxJigCmdManager.setRunCmdEvent(function(){R.prototype.onExitCommand.call(f,!1),O=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),D.MxJigCmdManager.setRunCmdEvent(void 0)),!O&&D.MxJigCmdManager.isWaitCmdNull()&&I.MxUiVue.restoreCmdStatus(),O||R.prototype.onExitCommand.call(this,!0)},c.prototype.onStartCommand=function(){I.MxUiVue.setCursorType(this.m_cursorType),this.printMessage(),D.MxJigCmdManager.setKeywordList(this.keyWords()),R.prototype.onStartCommand.call(this)},c.prototype.sampler=function(){var f,O=D.MxJigCmdManager.acquirePoint(this.m_toucheType,!1);return O.status==D.MxJigCmdManager.DragStatus.kNormal&&(this.m_currSamplerPoint==null?this.m_currSamplerPoint=new b.Vector3(O.pt.x,O.pt.y,0):(this.m_currSamplerPoint.x=O.pt.x,this.m_currSamplerPoint.y=O.pt.y)),f=this.m_useBasePt?this.acquireAngle(this.m_toucheType,this.m_basePt):this.acquireAngle(this.m_toucheType,this.m_currentInPoint),this.procInKeyword(f),f.status==D.MxJigCmdManager.DragStatus.kNormal?(this.m_value=f.ang,f.status):f.status==D.MxJigCmdManager.DragStatus.kKW1?f.status:this.m_useBasePt||this.m_currentInPoint?O.status:((f=this.acquirePoint(this.m_toucheType,!1)).status==D.MxJigCmdManager.DragStatus.kNormal&&f.exit&&(this.m_previousInPoint==null?this.m_previousInPoint=new b.Vector3(f.pt.x,f.pt.y,0):(this.m_previousInPoint.x=f.pt.x,this.m_previousInPoint.y=f.pt.y)),f.status)},c.prototype.done=function(f){if(this.m_retcall!=null)return this.m_resultDragStatus=f,this.m_useBasePt||f!=D.MxJigCmdManager.DragStatus.kNormal||!this.m_previousInPoint||this.m_currentInPoint?D.MxJigCmdManager.DoneStatius.kExitCommand:(this.m_currentInPoint=this.m_previousInPoint,this.m_previousInPoint=null,D.MxJigCmdManager.DoneStatius.kContinueCommand);U.MxFun.Assert(0)},c.prototype.upDisplay=function(){this.m_currSamplerPoint&&(this.m_pWorldDraw&&(this._mxObject.getMcObject().onReadyJigUpdateDispla(),this.m_pWorldDraw.worldDraw(this.m_currSamplerPoint)),this.m_useBasePt&&this.m_basePt?this.drawEntity(g.MxThreeJS.createLine(this.m_currSamplerPoint,this.m_basePt,16777215)):this.m_currentInPoint&&this.drawEntity(g.MxThreeJS.createLine(this.m_currSamplerPoint,this.m_currentInPoint,16777215)))},c);function c(){var f=R.call(this)||this;return f.m_useBasePt=!1,f.m_basePt=null,f.m_previousInPoint=null,f.m_currentInPoint=null,f.m_value=0,f.m_currSamplerPoint=null,f.m_retcall=null,f.m_resultDragStatus=D.MxJigCmdManager.DragStatus.kCancel,f.m_cursorType=I.MxUiVue.CursorType.kCross,f}o.MrxDbgUiPrAngle=u},{"../MxFun":27,"../MxString":34,"../MxThreeJS":37,"../UI/MxUiVue":65,"./MrxDbgUiPrBase":45,"./MxJigCmdManager":54,three:19}],47:[function(w,r,o){var a,v=this&&this.__extends||(a=function(F,T){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,Y){_.__proto__=Y}||function(_,Y){for(var k in Y)Object.prototype.hasOwnProperty.call(Y,k)&&(_[k]=Y[k])})(F,T)},function(F,T){function _(){this.constructor=F}a(F,T),F.prototype=T===null?Object.create(T):(_.prototype=T.prototype,new _)});Object.defineProperty(o,"__esModule",{value:!0}),o.MrxDbgUiPrPoint=void 0;var h,b=w("three"),D=w("./MxJigCmdManager"),U=w("../MxFun"),V=w("./MrxDbgUiPrBase"),I=w("../UI/MxUiVue"),g=w("../MxThreeJS"),A=w("../MxManager"),M=(v(N,h=V.MrxDbgUiPrBase),N.prototype.value=function(){return new b.Vector3(this.m_value.x,this.m_value.y,0)},N.prototype.getCADValue=function(){return A.MxManager.getMxCpp().newMcGePoint3d(new b.Vector3(this.m_value.x,this.m_value.y,0))},N.prototype.basePt=function(){return new b.Vector3(this.m_basePt.x,this.m_basePt.y,0)},N.prototype.setBasePt=function(F){this.m_basePt==null?this.m_basePt=new b.Vector3(F.x,F.y,0):(this.m_basePt.x=F.x,this.m_basePt.y=F.y),this.m_useBasePt=!0},N.prototype.setUseBasePt=function(F){this.m_useBasePt=F},N.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null,this.m_retWhileCall=null,this.m_exitCall=null,this.m_useBasePt&&this.SetLASTPOINT(this.m_basePt)},N.prototype.go=function(F){this.initGo(),this.m_retcall=F,D.MxJigCmdManager.runCmd(this)},N.prototype.goWhile=function(F,T){this.initGo(),this.m_retWhileCall=F,T&&(this.m_exitCall=T),D.MxJigCmdManager.runCmd(this)},N.prototype.onExitCommand=function(){var F=this;I.MxUiVue.setCursorType(I.MxUiVue.CursorType.kNormal);var T=!1;this.m_retcall!=null&&(D.MxJigCmdManager.setRunCmdEvent(function(){h.prototype.onExitCommand.call(F,!1),T=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),D.MxJigCmdManager.setRunCmdEvent(void 0)),!T&&D.MxJigCmdManager.isWaitCmdNull()&&I.MxUiVue.restoreCmdStatus(),T||h.prototype.onExitCommand.call(this,!0)},N.prototype.onStartCommand=function(){I.MxUiVue.setCursorType(this.m_cursorType),this.printMessage(),D.MxJigCmdManager.setKeywordList(this.keyWords()),this.m_useBasePt&&this.SetLASTPOINT(this.m_basePt),h.prototype.onStartCommand.call(this)},N.prototype.sampler=function(){var F=this.acquirePoint(this.m_toucheType);return this.procInKeyword(F),F.status==D.MxJigCmdManager.DragStatus.kNormal&&(this.m_value==null?this.m_value=new b.Vector3(F.pt.x,F.pt.y,0):(this.m_value.x=F.pt.x,this.m_value.y=F.pt.y)),F.status},N.prototype.done=function(F){if(this.m_retcall!=null)return this.m_resultDragStatus=F,this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),D.MxJigCmdManager.DoneStatius.kExitCommand;if(this.m_retWhileCall!=null){if((this.m_resultDragStatus=F)==D.MxJigCmdManager.DragStatus.kCancel)return this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),D.MxJigCmdManager.DoneStatius.kExitCommand;var T=!1;F==D.MxJigCmdManager.DragStatus.kNull&&(T=!0);var _=this.m_retWhileCall(this.getReturnStatus(this.m_resultDragStatus));return _!=null&&_.exit!=null&&(T=_.exit),T?(this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),D.MxJigCmdManager.DoneStatius.kExitCommand):(D.MxJigCmdManager.setKeywordList(this.keyWords()),this.printMessage(),D.MxJigCmdManager.DoneStatius.kContinueCommand)}U.MxFun.Assert(0)},N.prototype.upDisplay=function(){if(this.m_value&&(this.m_pWorldDraw&&(this._mxObject.getMcObject().onReadyJigUpdateDispla(0,this.m_value),this.m_pWorldDraw.worldDraw(this.m_value)),this.m_useBasePt&&this.m_basePt)){var F=16777215;this._mxObject.isWhiteViewColor()&&(F=0);var T=this._mxObject;this.drawEntity(g.MxThreeJS.createLine(T.toSmallcoord(this.m_value),T.toSmallcoord(this.m_basePt),F),void 0,!0)}},N);function N(){var F=h.call(this)||this;return F.m_useBasePt=!1,F.m_basePt=null,F.m_value=null,F.m_retcall=null,F.m_retWhileCall=null,F.m_exitCall=null,F.m_resultDragStatus=D.MxJigCmdManager.DragStatus.kCancel,F.m_cursorType=I.MxUiVue.CursorType.kCross,F}o.MrxDbgUiPrPoint=M},{"../MxFun":27,"../MxManager":29,"../MxThreeJS":37,"../UI/MxUiVue":65,"./MrxDbgUiPrBase":45,"./MxJigCmdManager":54,three:19}],48:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxCmdRunManager=void 0;var a,v,h,b,D,U,V,I,g=w("../MxFun"),A=w("../MxType"),M=w("./MxJigCmdManager"),N=w("../UI/MxUiVue"),F=w("../MxDrawData");a=o.MxCmdRunManager||(o.MxCmdRunManager={}),v={},h=new Array,b=0,D=!1,U="",V={},I={},a.InitQuickCommand=function(T){if(T)if(T instanceof Array)for(var _=T.length,Y=0;Y<_;Y++){var k=T[Y];if(!(k.length<2)){var S=k[0];if(S.length!=0)for(var G=k.length,C=1;C<G;C++)k[C].length!=0&&(V[k[C].toUpperCase()]=S)}}else console.log("Mx:QuickCommand data error,Not an array");else console.log("Mx:QuickCommand data error")},a.InitLanguageString=function(T){this.m_mapLanguageString=T},a.getLanguageString=function(T,_){var Y=I[T];return Y===void 0&&(Y=_),Y},a.MoveUpKey=function(){return D?++b>=h.length&&(b=0):D=!0,!0},a.MoveDownKey=function(){return!!D&&(--b<0&&(b=h.length-1),!0)},a.GetListCommad=function(){return b<0||b>=h.length?"":h[b]},a.ClearPrvCmd=function(){U=""},a.GetPrvCmd=function(){return U},a.SetPrvCmd=function(T){U=T},a.runCmd=function(T,_,Y){var k=_.toUpperCase(),S=v[k];if(T&&S==null){var G=V[k];if(G!=null&&(S=v[G.toUpperCase()]),S==null)return N.MxUiVue.isNull()?console.log(g.MxFun.formatString('未知命令"{0}"',_)):N.MxUiVue.acutPrintf(`未知命令"{0}"。
|
|
命令:`,_),!1}if(!S)return!1;T.endPanCommand(),T.getTempMarkDraw().clear(!1);var C=h.indexOf(S.cmd);-1<C&&h.splice(C,1),D=!(b=0),h.push(S.cmd),!(S.flag&A.MxType.MxCommandFlag.MCRX_CMD_NO_RECORD_PRVCMD)&&(U=S.cmd);var B=S.fun;T&&!(S.flag&A.MxType.MxCommandFlag.MCRX_CMD_TRANSPARENT)&&N.MxUiVue.acutPrintf(`{0}
|
|
`,S.cmd),M.MxJigCmdManager.stopCmd(M.MxJigCmdManager.DetailedResult.kNewCommadIn),T.callEvent("commandWillStart",{cmd:S.cmd}),T.getMcObject().fireStartRunCommand(S.cmd,S.flag);var R=T.sysVariable().getSysVarNumber("GETPOINTSTATUS");if(R&=~M.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint,R&=~M.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastMovePoint,T.sysVariable().setSysVarNumber("GETPOINTSTATUS",R),T&&(S.flag&A.MxType.MxCommandFlag.MCRX_CMD_NO_CLEAR_SELECT)==0){var u=!1,c=T.getMxAllSelect();if(T.getMxDatabase().getGripManager().removeAllGrips()&&(u=!0),T.getMxDatabase().getSelectManager().removeAllEntity()&&(u=!0),T.isValidMcObject()){var f=T.getMcObject().getGripManager().getAllSelect();T.getMcObject().getGripManager().setPrvCommandSelect(f),T.getMcObject().getGripManager().clearAll()&&(u=!0)}T.getMxDatabase().getSelectManager().setPrvCommandSelect(c),u&&(T.getMxDatabase().getGripManager().fireMxEntitySelectChange(),T.updateDisplay())}try{B(Y)}catch(O){console.log("mx: run cmd error"),console.log(O)}return T.getMcObject().fireEndRunCommand(S.cmd,S.flag),T&&(M.MxJigCmdManager.isRunning()||N.MxUiVue.restoreCmdStatus(),T.updateDisplay(),F.MxDrawData.m_isAutoResetRenderer||T.resetRenderer()),!0},a.addCommand=function(T,_,Y){Y==null&&(Y=A.MxType.MxCommandFlag.MCRX_CMD_MODAL);var k=T.toUpperCase();v[k]={fun:_,cmd:T,flag:Y}}},{"../MxDrawData":22,"../MxFun":27,"../MxType":39,"../UI/MxUiVue":65,"./MxJigCmdManager":54}],49:[function(w,r,o){var a,v=this&&this.__extends||(a=function(C,B){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,u){R.__proto__=u}||function(R,u){for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(R[c]=u[c])})(C,B)},function(C,B){function R(){this.constructor=C}a(C,B),C.prototype=B===null?Object.create(B):(R.prototype=B.prototype,new R)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxDrawObjectOsnap=o.McDbLine=o.McDbCurve=o.McDbEntity=o.McDbType=void 0;var h,b,D=w("three"),U=w("../MxThreeJS"),V=w("../MxDrawData"),I=w("./MxJigCmdManager"),g=w("./McEdJigOsnap");(b=h=o.McDbType||(o.McDbType={}))[b.kInValid=0]="kInValid",b[b.kLine=1]="kLine";var A=(M.prototype.getType=function(){return this.m_type},M);function M(){this.m_type=h.kInValid}o.McDbEntity=A;var N,F=(v(T,N=A),T);function T(){return N!==null&&N.apply(this,arguments)||this}o.McDbCurve=F;var _,Y=(v(k,_=F),k);function k(){var C=_.call(this)||this;return C.m_type=h.kLine,C}o.McDbLine=Y;var S=(G.prototype.getBlobHead=function(C,B){var R={};return R.type=C.getInt32(B,!0),B+=4,R.ver=C.getInt32(B,!0),B+=4,R.databaseIndex=C.getInt32(B,!0),B+=4,R.nOffset=B,R},G.prototype.clearData=function(){this.threejsObjects=new D.Object3D},G.prototype.calculateDistance=function(C,B,R){var u=new D.Vector3().subVectors(B,C),c=new D.Vector3().subVectors(R,C),f=u.clone().normalize(),O=c.clone().normalize(),W=f.dot(O),X=new D.Vector3().subVectors(R,B),J=new D.Vector3().subVectors(C,B),te=X.clone().normalize(),ne=J.clone().normalize();if(0<te.dot(ne)&&0<W){var ue=Math.sqrt(1-W*W),be=C.distanceTo(R),je=be*ue,ve=be*W,Be=u.clone().normalize().multiplyScalar(ve),q=C.clone().add(Be),ge=u.clone().normalize().multiplyScalar(200+ve);return{pt1:C,pt2:B,pt:R,distance:je,targetPt:q,warningPt:C.clone().add(ge)}}return null},G.prototype.getOsnapData=function(C,B){if(this.threejsObjects){var R=new D.Raycaster,u=V.MxDrawData.m_dInputRectWidth;R.linePrecision=this.mxObj.screenCoordLong2World(u);var c=this.mxObj.getCanvas(),f=c.clientWidth,O=c.clientHeight,W=this.mxObj.screenCoord2World(C.x,C.y);W.z=0,C=new D.Vector2(C.x/f*2-1,-C.y/O*2+1),R.setFromCamera(C,this.mxObj.getCamera());var X=R.intersectObjects(this.threejsObjects.children,!0),J=this.mxObj.getSysVarLong("OSMODE"),te=new Map;if(X.length)for(var ne=0;ne<X.length;ne++){var ue=X[ne];if(ue.object.userData&&ue.object.userData.obj.getType()==h.kLine){var be=ue.object.userData.obj;if(J&g.MxOsnapDefine.OsModeEnd){var je=W.distanceTo(be.pt1);be.pt1.type=I.MxJigCmdManager.OsnapMode.kOsModeEnd,te.set(je,be.pt1);var ve=W.distanceTo(be.pt2);be.pt2.type=I.MxJigCmdManager.OsnapMode.kOsModeEnd,te.set(ve,be.pt2)}if(J&g.MxOsnapDefine.OsModeNear&&(!be.bulge||be.bulge==0)){var Be=this.calculateDistance(be.pt1,be.pt2,W);Be&&(Be.targetPt.type=I.MxJigCmdManager.OsnapMode.kOsModeNear,te.set(Be.distance,Be.targetPt))}}}if(te.size){var q=this.mxObj.screenCoordLong2World(u),ge=Array.from(te);ge.sort(function(oe,le){return oe[0]-le[0]}),ge[0][0]<q&&B(ge[0][1],ge[0][1].type)}}},G.prototype.mxWebEntitysData=function(C,B){var R=this.getBlobHead(C,0);C.getInt32(R.nOffset,!0),R.nOffset+=4;var u=C.getInt32(R.nOffset,!0);R.nOffset+=4;var c=C.getInt32(R.nOffset,!0);if(R.nOffset+=4,1<c)console.log("mx:error mxfun.js version is old!");else{var f=C.getInt32(R.nOffset,!0);if(R.nOffset+=4,f==R.nOffset){this.threejsObjects=new D.Object3D;for(var O=0;O<u;O++){var W=C.getInt8(R.nOffset);R.nOffset+=1;var X=C.getInt32(R.nOffset,!0);if(R.nOffset+=4,W==1){var J=C.getFloat32(R.nOffset,!0);R.nOffset+=4;var te=C.getFloat32(R.nOffset,!0);R.nOffset+=4;var ne=C.getFloat32(R.nOffset,!0);R.nOffset+=4;var ue=C.getFloat32(R.nOffset,!0);R.nOffset+=4,(le=new Y).pt1=new D.Vector3(J,te,0),le.pt2=new D.Vector3(ne,ue,0),(Pe=U.MxThreeJS.createLine(le.pt1,le.pt2,16777215)).userData.obj=le,this.threejsObjects.add(Pe)}else if(W==2){var be=C.getInt8(R.nOffset);R.nOffset+=1;var je=C.getInt32(R.nOffset,!0);R.nOffset+=4;for(var ve=new D.Vector3,Be=0,q=null,ge=0;ge<je;ge++){var oe=new D.Vector3;oe.x=C.getFloat32(R.nOffset,!0),R.nOffset+=4,oe.y=C.getFloat32(R.nOffset,!0),R.nOffset+=4;var le,Pe,Ye=C.getFloat32(R.nOffset,!0);R.nOffset+=4,0<ge&&((le=new Y).pt1=ve.clone(),le.pt2=oe.clone(),le.bulge=Ye,(Pe=U.MxThreeJS.createLine(le.pt1,le.pt2,16777215)).userData.obj=le,this.threejsObjects.add(Pe)),ve=oe,Be=Ye,ge==0&&(q=oe)}be&&2<je&&((le=new Y).pt1=q.clone(),le.pt2=ve.clone(),le.bulge=Be,(Pe=U.MxThreeJS.createLine(le.pt1,le.pt2,16777215)).userData.obj=le,this.threejsObjects.add(Pe))}else console.log("mx:error mxWebEntitysData type"),R.nOffset=R.nOffset-5+X}}else console.log("mx: mxWebEntitysData size assert(0)")}},G);function G(C){this.threejsObjects=null,this.mxObj=null,this.mxObj=C}o.MxDrawObjectOsnap=S},{"../MxDrawData":22,"../MxThreeJS":37,"./McEdJigOsnap":43,"./MxJigCmdManager":54,three:19}],50:[function(w,r,o){var a,v=this&&this.__extends||(a=function(A,M){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,F){N.__proto__=F}||function(N,F){for(var T in F)Object.prototype.hasOwnProperty.call(F,T)&&(N[T]=F[T])})(A,M)},function(A,M){function N(){this.constructor=A}a(A,M),A.prototype=M===null?Object.create(M):(N.prototype=M.prototype,new N)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxEntSelJig=void 0;var h,b=w("./MxJig"),D=w("./MxJigCmdManager"),U=w("../UI/MxUiVue"),V=w("../MrxDbgUtils"),I=(v(g,h=b.McEdJigCommand),g.prototype.sampler=function(){var A=D.MxJigCmdManager.InType.kGetBegan,M=this.acquirePoint(A);return M.status==D.MxJigCmdManager.DragStatus.kNormal&&(this.point=M.pt),M.status},g.prototype.done=function(A){if(A==D.MxJigCmdManager.DragStatus.kNormal){var M=this;V.MrxDbgUtils.findEntAtPoint(this.getMxObject(),this.point,this.filter).then(function(N){M.callRet(N)})}else this.callRet([]);return D.MxJigCmdManager.DoneStatius.kExitCommand},g.prototype.onStartCommand=function(){U.MxUiVue.setCursorType(U.MxUiVue.CursorType.kRect),h.prototype.onStartCommand.call(this)},g.prototype.onExitCommand=function(){U.MxUiVue.setCursorType(U.MxUiVue.CursorType.kNormal),D.MxJigCmdManager.isWaitCmdNull()&&U.MxUiVue.restoreCmdStatus(),h.prototype.onExitCommand.call(this,!0)},g.prototype.upDisplay=function(){},g);function g(){return h!==null&&h.apply(this,arguments)||this}o.MxEntSelJig=I},{"../MrxDbgUtils":20,"../UI/MxUiVue":65,"./MxJig":53,"./MxJigCmdManager":54}],51:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxGridTrace=void 0;var a=w("three"),v=w("./MxJigCmdManager"),h=w("../MxFun"),b=w("../MxDrawData"),D=w("../MxThreeJS"),U=(V.prototype.ClearDynDrawEntity=function(){for(var I=this.m_mxJig.getMxObject().getTheTempDrawContainer_SmallCoord(),g=this.m_vecDynDrawEntity.length,A=0;A<g;A++)h.MxFun.removeThreejsObject(this.m_vecDynDrawEntity[A],I);this.m_vecDynDrawEntity=[]},V.prototype.GetSanpValue=function(I,g){var A=I%g;return 0<=A?g/2<A?I+=g-A:I-=A:g/2<(A=Math.abs(A))?I-=g-A:I+=A,I},V.prototype.CreteTracePoint=function(I,g){var A=this.m_mxJig.getMxObject(),M=A.getTheTempDrawContainer_SmallCoord();g/=2;var N=D.MxThreeJS.createLine(A.toSmallcoord2(I.x+g,I.y+g,0),A.toSmallcoord2(I.x-g,I.y-g,0),16711680);M.add(N),this.m_vecDynDrawEntity.push(N);var F=D.MxThreeJS.createLine(A.toSmallcoord2(I.x-g,I.y+g,0),A.toSmallcoord2(I.x+g,I.y-g,0),16711680);M.add(F),this.m_vecDynDrawEntity.push(F)},V.prototype.MouseMove=function(I){var g=this.m_mxJig.getMxObject();if(g.getMcObject().isValid()){if(this.ClearDynDrawEntity(),this.m_isValidTracePoint=!1,this.m_isTrace){var A=g.getSysVarPoint("SNAPUNIT");if(!(A.x<1e-6||A.y<1e-6)){I.z=0;var M=new a.Vector3;M.x=this.GetSanpValue(I.x,A.x),M.y=this.GetSanpValue(I.y,A.y);var N=g.viewCoordLong2Cad(b.MxDrawData.m_dInputRectWidth),F=2*N;M.distanceTo(I)<F&&(this.m_isValidTracePoint=!0,this.m_ptTracePoint=M,this.CreteTracePoint(M,N))}}}else this.m_isTrace=!1},V.prototype.Init=function(){var I=this.m_mxJig.getMxObject();I.getMcObject().isValid()?(this.m_isValidTracePoint=!1,this.m_isTrace=!1,I.getSysVarLong("GRIDMODE")!=0&&(this.m_isTrace=!0),I.sysVariable().getSysVarNumber("GETPOINTSTATUS")&v.MxJigCmdManager.GETPOINTSTATUS.OsModeGridSnapTempDisable&&(this.m_isTrace=!1),this.m_mxJig.isDisableGridTrace()&&(this.m_isTrace=!1),this.m_isTrace):this.m_isTrace=!1},V.prototype.GetTracePoint=function(){if(this.m_isTrace)return this.m_isValidTracePoint?this.m_ptTracePoint:void 0},V.prototype.ClearDisplay=function(){this.ClearDynDrawEntity()},V.prototype.ReSetTempDisplay=function(){this.ClearDynDrawEntity(),this.m_isValidTracePoint=!1},V);function V(I){this.m_vecDynDrawEntity=[],this.m_ptTracePoint=new a.Vector3,this.m_isValidTracePoint=!1,this.m_isTrace=!1,this.m_mxJig=null,this.m_mxJig=I}o.MxGridTrace=U},{"../MxDrawData":22,"../MxFun":27,"../MxThreeJS":37,"./MxJigCmdManager":54,three:19}],52:[function(w,r,o){var a,v=this&&this.__extends||(a=function(M,N){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,T){F.__proto__=T}||function(F,T){for(var _ in T)Object.prototype.hasOwnProperty.call(T,_)&&(F[_]=T[_])})(M,N)},function(M,N){function F(){this.constructor=M}a(M,N),M.prototype=N===null?Object.create(N):(F.prototype=N.prototype,new F)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxIntelliSelectJig=void 0;var h,b=w("three"),D=w("./MxJig"),U=w("./MxJigCmdManager"),V=w("../MxThreeJS"),I=w("../MxTools"),g=(v(A,h=D.McEdJigCommand),A.prototype.sampler=function(){var M=U.MxJigCmdManager.InType.kGetBegan,N=this.acquirePoint(M);return N.status==U.MxJigCmdManager.DragStatus.kNormal&&(this.m_pt2=N.pt),N.status},A.prototype.getTypeName=function(){return"MxIntelliSelect"},A.prototype.done=function(M){if(M==U.MxJigCmdManager.DragStatus.kNormal){var N=this.getMxObject();N.getMxDatabase().getGripManager().doWindowsSelect(this.m_pt1,this.m_pt2),N.getMcObject().getGripManager().doRangeSelect(this.m_pt1,this.m_pt2)}return U.MxJigCmdManager.DoneStatius.kExitCommand},A.prototype.doPointSelect=function(M,N,F){var T=M.viewCoordLong2Cad(16),_={x:N.x,y:N.y,tol:T};M.callCommand("MxCAD_IntelliSelect_Point",JSON.stringify(_),function(Y){F(Y)})},A.prototype.upDisplay=function(){var M=this.getMxObject(),N=this.m_pt1.clone(),F=this.m_pt2.clone(),T=new b.Vector3(this.m_pt1.x,this.m_pt2.y,this.m_pt2.z),_=new b.Vector3(this.m_pt2.x,this.m_pt1.y,this.m_pt2.z);if(!I.MxTools.IsZero(M.getViewAngle())){var Y=new b.Matrix4;Y.makeRotationZ(M.getViewAngle());var k=new b.Matrix4().makeTranslation(N.x,N.y,0).multiply(Y).multiply(new b.Matrix4().makeTranslation(-N.x,-N.y,0));N.applyMatrix4(k),F.applyMatrix4(k),T=new b.Vector3(N.x,F.y,F.z),_=new b.Vector3(F.x,N.y,F.z);var S=new b.Matrix4;S.getInverse(k),N.applyMatrix4(S),F.applyMatrix4(S),T.applyMatrix4(S),_.applyMatrix4(S)}var G=[];G.push(N),G.push(T),G.push(F),G.push(_),G.push(N);var C=null,B=65280;if(F.x>N.x)C=V.MxThreeJS.createLines(G,16777215),B=255;else{var R=this.getMxObject().viewCoordLong2Cad(3);C=V.MxThreeJS.createDashedLines(G,16777215,2*R,R)}var u=[];u.push(N),u.push(T),u.push(F),u.push(N),u.push(F),u.push(_);var c=V.MxThreeJS.createTriangle(u,B,.27);this.drawEntity(c,30),this.drawEntity(C,31)},A);function A(M){var N=h.call(this)||this;return N.m_pt1=M,N.m_pt2=M,N}o.MxIntelliSelectJig=g},{"../MxThreeJS":37,"../MxTools":38,"./MxJig":53,"./MxJigCmdManager":54,three:19}],53:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.McEdJigCommand=o.MxDynamicInput=void 0;var a=w("three"),v=w("../MxFun"),h=w("./MxJigCmdManager"),b=w("../MxManager"),D=w("../MxTools"),U=w("../UI/MxUiVue"),V=w("./McEdJigOsnap"),I=w("./McEdJigDynamicTrace"),g=w("./MxPolarAxisTrace"),A=w("./MxGridTrace"),M=w("../MxThreeJS"),N=w("../MxDrawData"),F=w("./MxOffsetArrow"),T=(_.prototype.getLockValuesMap=function(){return this.m_isShowDynInput?U.MxUiVue.DynamicInput_getLockValuesMap():new Map},_.prototype.getFocusIndex=function(){return this.m_isShowDynInput?this.m_iFocusIndex:-1},_.prototype.ClearDynDrawEntity=function(){for(var S=this.m_jig.getMxObject().getTheTempDrawContainer_SmallCoord(),G=this.m_vecDynDrawEntity.length,C=0;C<G;C++)v.MxFun.removeThreejsObject(this.m_vecDynDrawEntity[C],S);this.m_vecDynDrawEntity=[]},_.prototype.setGetNumber=function(S){this.m_isGetNumber=S},_.prototype.ClearDisplay=function(){this.ClearDynDrawEntity()},_.prototype.onKeyEcsDown=function(){return this.m_isShowDynInput&&this.m_isInputStatus?(this.m_isInputStatus=!1,U.MxUiVue.OnMxEvent({name:"dynInputReSet"}),1):0},_.prototype.getCurrentInputPointCoordinates=function(S){if(!this.m_isShowDynInput)return!1;var G=U.MxUiVue.DynamicInput_getLockValuesMap();if(G.size==0)return!1;var C,B=S.clone(),R=this.m_jig.getMxObject();if(U.MxUiVue.DynamicInput_getType()!=h.MxJigCmdManager.DynamicInputType.kDistanceInput)return U.MxUiVue.DynamicInput_getType()==h.MxJigCmdManager.DynamicInputType.kXYCoordInput&&(G.size!=1?G.size==2&&G.has(0)&&G.has(1)?(B.x=D.MxTools._tstof(G.get(0)),B.y=D.MxTools._tstof(G.get(1)),B):(console.log("Mx:error index:",G),!1):(c=(C=G.entries().next().value)[0],f=D.MxTools._tstof(C[1]),c==0?(B.x=f,B):c==1?(B.y=f,B):(console.log("Mx:error index:",c),!1)));if(!(R.sysVariable().getSysVarNumber("GETPOINTSTATUS")&h.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint))return!1;var u=R.sysVariable().getSysVarPoint("LASTPOINT");if(G.size==1){var c=(C=G.entries().next().value)[0],f=D.MxTools._tstof(C[1]);if(c==0)return!((ne=B.clone().sub(u)).length()<1e-7)&&(ne.normalize(),ne.multiplyScalar(f),u.clone().add(ne));if(c!=1)return console.log("Mx:error index:",c),!1;var O=f;if(!(R.sysVariable().getSysVarNumber("GETPOINTSTATUS")&h.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint))return!1;var W=R.sysVariable().getSysVarPoint("LASTPOINT");return!((ne=B.clone().sub(W)).length()<1e-7)&&(O=O*Math.PI/180,ne.dot(new a.Vector3(0,1,0))<0&&(O=-O),(X=new a.Vector3(ne.length(),0,0)).applyAxisAngle(new a.Vector3(0,0,1),O),W.clone().add(X))}if(G.size!=2||!G.has(0)||!G.has(1))return console.log("Mx:error index:",G),!1;if(!(R.sysVariable().getSysVarNumber("GETPOINTSTATUS")&h.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint))return!1;var X,J=D.MxTools._tstof(G.get(0)),te=(O=D.MxTools._tstof(G.get(1)),R.sysVariable().getSysVarPoint("LASTPOINT")),ne=B.clone().sub(te);return O=O*Math.PI/180,ne.dot(new a.Vector3(0,1,0))<0&&(O=-O),(X=new a.Vector3(J,0,0)).applyAxisAngle(new a.Vector3(0,0,1),O),te.clone().add(X)},_.prototype.onKeyDonw=function(S){if(!this.m_isShowDynInput||S==27||S==16||S==17||S==18)return 0;if(S==9)return this.m_isInputStatus=!1,0;if(S!=32&&S!=13)return this.m_isInputStatus=!0,0;if(this.m_isInputStatus&&U.MxUiVue.DynamicInput_isShow()){if(this.m_isGetNumber||U.MxUiVue.DynamicInput_getType()==h.MxJigCmdManager.DynamicInputType.kDistanceInput){var G=U.MxUiVue.DynamicInput_getFocusValue();this.m_iFocusIndex=U.MxUiVue.DynamicInput_getFocusIndex(),U.MxUiVue.setCmdText(G)}else if(U.MxUiVue.DynamicInput_getType()==h.MxJigCmdManager.DynamicInputType.kXYCoordInput){var C=U.MxUiVue.DynamicInput_getValue1(),B=U.MxUiVue.DynamicInput_getValue2(),R=U.MxUiVue.DynamicInput_getLockValuesMap();R.has(0)&&(C=R.get(0)),R.has(1)&&(B=R.get(1)),G=U.MxUiVue.DynamicInput_getFocusValue();var u=U.MxUiVue.DynamicInput_getFocusIndex(),c="";G.length!=0?c=D.MxTools.IsNumerical(G)?u==0?v.MxFun.formatString("{0},{1}",G,B):v.MxFun.formatString("{0},{1}",C,G):G:D.MxTools.IsNumerical(C)&&D.MxTools.IsNumerical(B)&&(c=v.MxFun.formatString("{0},{1}",C,B)),this.m_iFocusIndex=u,U.MxUiVue.setCmdText(c)}}return this.m_isInputStatus=!1,0},_.prototype.isInputStatus=function(){return this.m_isInputStatus},_.prototype.isTruncatedInput=function(){return this.m_isShowDynInput&&this.m_isInputStatus},_.prototype.initDynInput=function(S){this.m_jig=S;var G=this.m_jig.getMxObject();if(this.m_iFocusIndex=-1,this.m_isShowDynInput=!1,!U.MxUiVue.isNull()){U.MxUiVue.DynamicInput_clearLockValuesMap(),U.MxUiVue.DynamicInput_setType(this.m_dynType);var C=G.sysVariable().getSysVarNumber("GETPOINTSTATUS");C&h.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint&&U.MxUiVue.SetLasetPoint(G.sysVariable().getSysVarPoint("LASTPOINT")),this.m_dynType==h.MxJigCmdManager.DynamicInputType.kAutoInput&&(C&h.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint?U.MxUiVue.DynamicInput_setType(h.MxJigCmdManager.DynamicInputType.kDistanceInput):U.MxUiVue.DynamicInput_setType(h.MxJigCmdManager.DynamicInputType.kXYCoordInput))}},_.prototype.setFocus=function(S){U.MxUiVue.OnMxEvent({name:"dynInputSetFocus",param:{isFocus:S}})},_.prototype.exitDynInput=function(){U.MxUiVue.DynamicInput_setShow(!1),U.MxUiVue.DynamicInput_upDisplay()},_.prototype.isShow=function(){return U.MxUiVue.DynamicInput_isShow()},_.prototype.drawSolidPoint=function(S,G,C,B){var R=M.MxThreeJS.createPoint(B.toSmallcoord(S),this.m_iDashedLineLenColor,G);C.add(R),this.m_vecDynDrawEntity.push(R)},_.prototype.drawDashedLine=function(S,G,C,B,R,u){var c=M.MxThreeJS.createDashedLine(u.toSmallcoord2(S.x,S.y,S.z),u.toSmallcoord2(G.x,G.y,G.z),this.m_iDashedLineLenColor,B,B);C.add(c),this.m_vecDynDrawEntity.push(c)},_.prototype.worldDrawDistanceInput=function(S,G){var C=this.m_jig.getMxObject();if(C.getMcObject().isValid()&&((S=S.clone()).z=0,(G=G.clone()).z=0,!(C.docCoordLong2Screen(S.distanceTo(G))<20))){var B=C.getTheTempDrawContainer_SmallCoord(),R=C.viewCoordLong2Cad(this.m_dashedLineLen),u=S.clone().sub(G),c=u.clone();c.applyAxisAngle(new a.Vector3(0,0,1),.5*Math.PI),c.normalize(),c.multiplyScalar(C.viewCoordLong2Cad(50));var f=new a.Vector3(0,1,0),O=new a.Vector3(1,0,0);c.dot(f)<0&&c.multiplyScalar(-1),u.dot(f)<0&&c.multiplyScalar(-1),u.dot(O)<0&&c.multiplyScalar(-1);var W=G.clone().add(c),X=S.clone().add(c),J=G.distanceTo(S),te=new a.Vector3(G.x+J,G.y,G.z);this.drawSolidPoint(G.clone().add(c),3,B,C),this.drawSolidPoint(S.clone().add(c),3,B,C),this.drawSolidPoint(te,3,B,C),this.drawDashedLine(W,X,B,R,R,C),this.drawDashedLine(G,W,B,R,R,C),this.drawDashedLine(S,X,B,R,R,C),this.drawDashedLine(G,te,B,R,R,C);var ne=S.clone().sub(G),ue=0;1e-6<ne.length()&&(ue=ne.angleTo(new a.Vector3(1,0,0)));var be=0,je=ue;ne.dot(f)<0&&(be=2*Math.PI-ue,je=ue);var ve=M.MxThreeJS.createDashedArc(C.toSmallcoord(G),J,be,je,this.m_iDashedLineLenColor,R,R);B.add(ve),this.m_vecDynDrawEntity.push(ve)}},_.prototype.upDynInput=function(){if(!U.MxUiVue.isNull()){var S=this.m_jig.getMxObject(),G=!1;if(G=!this.m_jig.isDisableDynInput()&&S.getSysVarLong("DYNINPUT")==1,N.MxDrawData.m_isForbiddenDynInput&&(G=!1),v.MxFun.isPC()||(G=!1),U.MxUiVue.DynamicInput_setShow(G),this.m_isShowDynInput=G){if(U.MxUiVue.DynamicInput_setTip(U.MxUiVue.getCmdTip()),h.MxJigCmdManager.getAcquireStatus()==h.MxJigCmdManager.AcquireStatus.kMove){var C=h.MxJigCmdManager.getAcquirePoint();if(U.MxUiVue.DynamicInput_setPos(S.currentCoord2Screen(C.x,C.y,C.z)),U.MxUiVue.DynamicInput_getType()==h.MxJigCmdManager.DynamicInputType.kXYCoordInput)U.MxUiVue.DynamicInput_setValue1(C.x.toFixed(3)),U.MxUiVue.DynamicInput_setValue2(C.y.toFixed(3));else if(U.MxUiVue.DynamicInput_getType()==h.MxJigCmdManager.DynamicInputType.kDistanceInput){var B=h.MxJigCmdManager.getAcquirePoint(),R=U.MxUiVue.GetLasetPoint();this.worldDrawDistanceInput(B,R);var u=new a.Vector3(R.x+.5*(B.x-R.x),R.y+.5*(B.y-R.y),R.z+.5*(B.z-R.z)),c=B.clone().sub(R);c.length()<1e-8&&(c=new a.Vector3(1,0,0));var f=c.clone();f.applyAxisAngle(new a.Vector3(0,0,1),.5*Math.PI),f.normalize(),f.multiplyScalar(S.viewCoordLong2Cad(50));var O=new a.Vector3(0,1,0),W=new a.Vector3(1,0,0);f.dot(O)<0&&f.multiplyScalar(-1),c.dot(O)<0&&f.multiplyScalar(-1),c.dot(W)<0&&f.multiplyScalar(-1),u.add(f);var X=R.distanceTo(B);U.MxUiVue.DynamicInput_setValue1(X.toFixed(3)),U.MxUiVue.DynamicInput_setValue1Pos(S.currentCoord2Screen(u.x,u.y,C.z)),X=R.distanceTo(B);var J=R.clone();J.x+=X;var te=(u=new a.Vector3(J.x+.5*(B.x-J.x),J.y+.5*(B.y-J.y),J.z+.5*(B.z-J.z))).clone().sub(R);te.normalize(),te.multiplyScalar(X),u=R.clone().add(te);var ne=B.clone().sub(R),ue=0;1e-6<ne.length()&&(ue=ne.angleTo(new a.Vector3(1,0,0))),ue=180*ue/Math.PI,U.MxUiVue.DynamicInput_setValue2(ue.toFixed(3)+"°"),U.MxUiVue.DynamicInput_setValue2Pos(S.currentCoord2Screen(u.x,u.y,C.z))}}U.MxUiVue.DynamicInput_upDisplay()}}},_.prototype.setDynamicInputType=function(S){this.m_dynType=S},_.prototype.getDynamicInputType=function(){return this.m_dynType},_);function _(S){this.m_dynType=h.MxJigCmdManager.DynamicInputType.kAutoInput,this.m_isInputStatus=!1,this.m_vecDynDrawEntity=[],this.m_dashedLineLen=1.5,this.m_iDashedLineLenColor=8421504,this.m_iFocusIndex=-1,this.m_isShowDynInput=!1,this.m_isGetNumber=!1,this.m_jig=S}o.MxDynamicInput=T;var Y=(k.prototype.getTypeName=function(){return""},k.prototype.isExit=function(){return this._isExit},k.prototype.isEnableOsnap=function(){return this.getOsnap().getIsEnableVar()&&!V.McEdImpJigGlobalData.isTmpDisableOsmode()},k.prototype.getDetailedResult=function(){return this.m_DetailedResult},k.prototype.clearGroup=function(){this.drawGroup&&(this._mxObject.getTheTempDrawContainer().remove(this.drawGroup),this.drawGroup=null),this.drawGroup_smallCoord&&(this._mxObject.getTheTempDrawContainer().remove(this.drawGroup_smallCoord),this.drawGroup_smallCoord=null)},k.prototype.getParentGroup=function(){return this.drawGroup||(this.drawGroup=new a.Group,this.drawGroup.renderOrder=b.MxData.iGripRenderOrder,this._mxObject.getTheTempDrawContainer().add(this.drawGroup)),this.drawGroup},k.prototype.getParentGroup_smallCoord=function(){return this.drawGroup_smallCoord||(this.drawGroup_smallCoord=new a.Group,this.drawGroup_smallCoord.renderOrder=b.MxData.iGripRenderOrder,this._mxObject.getTheTempDrawContainer_SmallCoord().add(this.drawGroup_smallCoord)),this.drawGroup_smallCoord},k.prototype.onExitCommand=function(S){S&&this.m_dynInput.exitDynInput(),this.m_osnap.endDrag(),this.m_dynamicTrace.ClearDisplay(),this.m_polarAxisTrace.ClearDisplay(),this.m_offsetArrow.ClearDisplay(),this.m_gridTrace.ClearDisplay(),this.m_dynInput.ClearDisplay(),this.clearGroup(),this._mxObject.getMcObject().onJigCommandEnd()},k.prototype.getOsnap=function(){return this.m_osnap},k.prototype.getOrtho=function(){return this.m_ortho},k.prototype.getDynamicTrace=function(){return this.m_dynamicTrace},k.prototype.getPolarAxisTrace=function(){return this.m_polarAxisTrace},k.prototype.getOffsetArrow=function(){return this.m_offsetArrow},k.prototype.getGridTrace=function(){return this.m_gridTrace},k.prototype.onGetOsnapData=function(S){this.m_dynamicTrace.OnDynamicTrace(S.id,new a.Vector3(S.ptsx,S.ptsy,S.ptsz),S.osmode)},k.prototype.isDisableDynInput=function(){return this.m_isDisableDynInput},k.prototype.setDisableDynInput=function(S){this.m_isDisableDynInput=S},k.prototype.setDisableOsnap=function(S){this.m_isDisableOsnap=S},k.prototype.setOffsetInputPostion=function(S){this.m_isOffsetInputPostion=S},k.prototype.isOffsetInputPostion=function(){return this.m_isOffsetInputPostion},k.prototype.isDisableOsnap=function(){return this.m_isDisableOsnap},k.prototype.setDisableDynamicTrace=function(S){this.m_isDisableDynamicTrace=S},k.prototype.isDisableDynamicTrace=function(){return this.m_isDisableDynamicTrace},k.prototype.setDisablePolarAxisTrace=function(S){this.m_isDisablePolarAxisTrace=S},k.prototype.isDisablePolarAxisTrace=function(){return this.m_isDisablePolarAxisTrace},k.prototype.setDisableGridTrace=function(S){this.m_isDisableGridTrace=S},k.prototype.isDisableGridTrace=function(){return this.m_isDisableGridTrace},k.prototype.setDisableOrthoTrace=function(S){this.m_isDisableOrtho=S},k.prototype.isDisableOrthoTrace=function(){return this.m_isDisableOrtho},k.prototype.disableAllTrace=function(S){S===void 0&&(S=!0),this.m_isDisableOsnap=S,this.m_isDisableDynamicTrace=S,this.m_isDisablePolarAxisTrace=S,this.m_isDisableGridTrace=S,this.m_isDisableOrtho=S},k.prototype.onStartCommand=function(){this._isCancle=!1,this._isExit=!1,this.m_DetailedResult=h.MxJigCmdManager.DetailedResult.kUnknown,this.m_dynInput.initDynInput(this),this.m_osnap.startDrag(this.m_isOffsetInputPostion,this);var S=this._mxObject.getCurrentMousePostion();this._mxObject.isValidCurMousePostion()||(S.x=.5*this._mxObject.getViewWidth(),S.y=.5*this._mxObject.getViewHeight());var G=this._mxObject.screenCoord2Current(S.x,S.y,0);this.m_osnap.setPoint(G),this.m_dynamicTrace.Init(),this.m_polarAxisTrace.Init(),this.m_offsetArrow.Init(),this.m_gridTrace.Init(),this.m_ortho.Init(),h.MxJigCmdManager.doMouseMoveImp(),this.m_dynInput.setFocus(!0)},k.prototype.getDynImput=function(){return this.m_dynInput},k.prototype.setMxObject=function(S){this._mxObject=S},k.prototype.getMxObject=function(){return this._mxObject},k.prototype.setColor=function(S){this._iColor=S},k.prototype.getColor=function(){return this._iColor},k.prototype.setDynamicInputType=function(S){this.m_dynInput.setDynamicInputType(S)},k.prototype.getDynamicInputType=function(){return this.m_dynInput.getDynamicInputType()},k.prototype.createTriangle=function(S,G,C){var B=new a.MeshBasicMaterial({color:this._iColor,side:a.DoubleSide}),R=new a.Geometry;R.vertices.push(S),R.vertices.push(G),R.vertices.push(C);var u=new a.Vector3(1,1,1),c=new a.Color(this._iColor),f=new a.Face3(0,1,2,u,c,0);return R.faces.push(f),R.computeFaceNormals(),R.computeVertexNormals(),new a.Mesh(R,B)},k.prototype.createPoint=function(S){var G=new a.Geometry;G.vertices.push(S);var C=new a.PointsMaterial({color:this._iColor,size:3});return new a.Points(G,C)},k.prototype.createLine=function(S,G){var C=new a.Geometry,B=new a.LineBasicMaterial({color:this._iColor});return C.vertices.push(S,G),new a.Line(C,B)},k.prototype.drawReserve=function(S){this.m_isReserveDrawStatus=!0,this.m_callReserveDrawAddEntity=S,this.upDisplay(),this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null},k.prototype.drawMcDbEntity=function(S,G,C){var B=S.getImp(),R=B.GetObjectID();R==0&&S.tempRelationObject(),this.m_isReserveDrawStatus?this._mxObject.getMcObject().DrawEntity(B,G,C):this._mxObject.getMcObject().onJigDrawEntityDisplay(B,G,C),R==0&&S.freeTempRelationObject()},k.prototype.drawMcDbLine=function(S,G,C,B,R,u,c){this.m_isReserveDrawStatus?this._mxObject.getMcObject().DrawLine(S,G,C,B,R,u,c):this._mxObject.getMcObject().onJigDrawEntityDisplay_line(S,G,C,B,R,u,c)},k.prototype.drawEntity=function(S,G,C){if(C===void 0&&(C=!1),S!=null)if(this.m_isReserveDrawStatus)S.renderOrder=G!=null?G:b.MxData.iDynJigRenderOrder,this._mxObject.addObject(S),this.m_callReserveDrawAddEntity&&this.m_callReserveDrawAddEntity(S);else{var B="MxDynDraw_"+this._DynNameId.toString();S.name=B,S.renderOrder=G!=null?G:b.MxData.iDynJigRenderOrder,this._aryDynDrawObjectNamesId==null&&(this._aryDynDrawObjectNamesId=new Array),this._aryDynDrawObjectNamesId.push(this._DynNameId),this._DynNameId++,C?this.getParentGroup_smallCoord().add(S):this.getParentGroup().add(S)}},k.prototype.floorPowerOfTwo=function(S){return Math.pow(2,Math.floor(Math.log(S)/Math.LN2))},k.prototype.makeTextSprite=function(S,G,C,B,R){var u,c=document.createElement("canvas"),f=c.getContext("2d"),O=v.MxFun.formatString("normal {0}px Arial","256");f.font=O;var W=f.measureText(S);u=2*this.floorPowerOfTwo(W.width),c.width=u,c.height=256,f.font=O,f.textAlign="center",f.textBaseline="middle";var X=v.MxFun.formatString("#{0}",R.toString(16));f.fillStyle=X,f.fillText(S,u/2,128);var J=new a.Texture(c);J.needsUpdate=!0;var te=new a.SpriteMaterial({map:J});te.transparent=!1,te.rotation=B;var ne=new a.Sprite(te);return ne.scale.set(u/256*C,C,1),ne.position.set(G.x,G.y,0),ne},k.prototype.drawText=function(S,G,C,B){var R=this.makeTextSprite(S,B,G,C,this._iColor);this.drawEntity(R)},k.prototype.drawPoints=function(S){for(var G=0;G<S.length;G++){var C=new a.Geometry;C.vertices.push(S[G]);var B=new a.PointsMaterial({color:this._iColor,size:3}),R=new a.Points(C,B);this.drawEntity(R)}},k.prototype.drawPoint=function(S){var G=new a.Geometry;G.vertices.push(S);var C=new a.PointsMaterial({color:this._iColor,size:3}),B=new a.Points(G,C);this.drawEntity(B)},k.prototype.drawPolyline=function(S){for(var G=new a.Geometry,C=0;C<S.length;C++)G.vertices.push(S[C]);var B=new a.LineBasicMaterial({color:this._iColor}),R=new a.Line(G,B);this.drawEntity(R)},k.prototype.drawSpline=function(S){},k.prototype.drawCircle=function(S,G){var C=new a.CircleGeometry(G,64,3,2*Math.PI),B=new a.LineBasicMaterial({color:this._iColor});C.vertices.shift();var R=new a.LineLoop(C,B);R.position.x=S.x,R.position.y=S.y,R.position.z=S.z,this.drawEntity(R)},k.prototype.drawArc=function(S,G,C,B){var R=new a.CircleGeometry(G,64,C,B),u=new a.LineBasicMaterial({color:this._iColor});R.vertices.shift();var c=new a.Line(R,u);c.position.x=S.x,c.position.y=S.y,c.position.z=S.z,this.drawEntity(c)},k.prototype.drawLine=function(S,G){var C=new a.Geometry,B=new a.LineBasicMaterial({color:this._iColor});C.vertices.push(S,G);var R=new a.Line(C,B);this.drawEntity(R)},k.prototype.removeDynDrawObject=function(){if(this._aryDynDrawObjectNamesId!=null){for(var S=0;S<this._aryDynDrawObjectNamesId.length;S++){var G,C="MxDynDraw_"+this._aryDynDrawObjectNamesId[S].toString();(G=this.getParentGroup().getObjectByName(C))?v.MxFun.removeThreejsObject(G,this.getParentGroup()):(G=this.getParentGroup_smallCoord().getObjectByName(C))&&v.MxFun.removeThreejsObject(G,this.getParentGroup_smallCoord())}this._aryDynDrawObjectNamesId=[],this._mxObject.getMcObject().onJigClearDisplay()}},k.prototype.acquirePoint=function(S,G){G===void 0&&(G=!0);var C=h.MxJigCmdManager.acquirePoint(S,G);return this._isExit=C.exit,this._isExit&&(this.m_DetailedResult=C.DetailedResult),C},k.prototype.acquireDist=function(S,G){var C=h.MxJigCmdManager.acquireDist(S,G);return this._isExit=C.exit,this._isExit&&(this.m_DetailedResult=C.DetailedResult),C},k.prototype.acquireAngle=function(S,G){var C=h.MxJigCmdManager.acquireAngle(S,G);return this._isExit=C.exit,this._isExit&&(this.m_DetailedResult=C.DetailedResult),C},k.prototype.acquireInt=function(){var S=h.MxJigCmdManager.acquireInt();return this._isExit=S.exit,this._isExit&&(this.m_DetailedResult=S.DetailedResult),S},k.prototype.acquireString=function(){var S=h.MxJigCmdManager.acquireString();return this._isExit=S.exit,this._isExit&&(this.m_DetailedResult=S.DetailedResult),S},k.prototype.acquireKeyword=function(){var S=h.MxJigCmdManager.acquireKeyword();return this._isExit=S.exit,this._isExit&&(this.m_DetailedResult=S.DetailedResult),S},k.prototype.notifyCancleExit=function(S){this.m_DetailedResult=S,this._isCancle=!0,this.removeDynDrawObject(),this.done(h.MxJigCmdManager.DragStatus.kCancel),this.onExitCommand(!0),h.MxJigCmdManager.commandRunComplete(this)},k.prototype.notifySampler=function(){var S=this.sampler();if(this.m_dynInput.upDynInput(),S==h.MxJigCmdManager.DragStatus.kNormal&&(this.removeDynDrawObject(),this.upDisplay()),this._isExit){var G=this.done(S);this._isCancle||(G==h.MxJigCmdManager.DoneStatius.kContinueCommand?(this._isExit=!1,h.MxJigCmdManager.doMouseMoveImp(),U.MxUiVue.OnMxEvent({name:"dynInputReSet"})):(this.removeDynDrawObject(),h.MxJigCmdManager.commandRunComplete(this),this.onExitCommand(!0)))}this._mxObject.updateDisplay()},k.prototype.getCurrentMouseButton=function(){return h.MxJigCmdManager.getCurrentMouseButton()},k.prototype.userInputControls=function(){return this._userInputContros},k.prototype.setUserInputControls=function(S){this._userInputContros=S},k.prototype.abort=function(S){h.MxJigCmdManager.stopCmd(S)},k);function k(){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_isDisableDynamicTrace=!1,this.m_isDisablePolarAxisTrace=!1,this.m_isDisableGridTrace=!1,this.m_isDisableOrtho=!1,this.m_dynInput=new T(this),this.m_dynamicTrace=new I.McEdJigDynamicTrace(this),this.m_polarAxisTrace=new g.MxPolarAxisTrace(this),this.m_offsetArrow=new F.MxOffsetArrow(this),this.m_gridTrace=new A.MxGridTrace(this),this.m_osnap=new V.McEdJigOsnap(this),this.m_ortho=new V.McEdJigOrtho(this),this._userInputContros=h.MxJigCmdManager.UserInputControls.kNullResponseAccepted,this.m_isOffsetInputPostion=!1,this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null,this.drawGroup=null,this.drawGroup_smallCoord=null,this._mxObject=null,this.m_DetailedResult=h.MxJigCmdManager.DetailedResult.kUnknown}o.McEdJigCommand=Y},{"../MxDrawData":22,"../MxFun":27,"../MxManager":29,"../MxThreeJS":37,"../MxTools":38,"../UI/MxUiVue":65,"./McEdJigDynamicTrace":42,"./McEdJigOsnap":43,"./MxGridTrace":51,"./MxJigCmdManager":54,"./MxOffsetArrow":56,"./MxPolarAxisTrace":57,three:19}],54:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxJigCmdManager=o.AcquireReturn=void 0;var a,v=w("three"),h=w("../MxFun"),b=w("./MxJig"),D=w("../MxManager"),U=w("./MrxDbgUiPrPoint"),V=w("./MrxDbgUiPrBase"),I=w("../UI/MxUiVue"),g=w("../MxTools"),A=w("../MxString"),M=w("./McEdJigOsnap"),N=w("../MxDrawData"),F=w("./MrxDbgUiPrDist"),T=function(){this.status=a.DragStatus.kNoChange,this.exit=!0,this.DetailedResult=a.DetailedResult.kUnknown,this.sKeyValue="",this.dist=0,this.iVal=0,this.sValue="",this.ang=0};o.AcquireReturn=T,function(_){var Y,k,S,G,C,B,R,u,c,f,O,W,X,J,te,ne,ue,be,je,ve;(k=Y=_.UserInputControls||(_.UserInputControls={}))[k.kGovernedByOrthoMode=1]="kGovernedByOrthoMode",k[k.kNullResponseAccepted=2]="kNullResponseAccepted",k[k.kDontEchoCancelForCtrlC=4]="kDontEchoCancelForCtrlC",k[k.kDontUpdateLastPoint=8]="kDontUpdateLastPoint",k[k.kNoDwgLimitsChecking=16]="kNoDwgLimitsChecking",k[k.kNoZeroResponseAccepted=32]="kNoZeroResponseAccepted",k[k.kNoNegativeResponseAccepted=64]="kNoNegativeResponseAccepted",k[k.kAccept3dCoordinates=128]="kAccept3dCoordinates",k[k.kAcceptMouseUpAsPoint=256]="kAcceptMouseUpAsPoint",k[k.kAnyBlankTerminatesInput=512]="kAnyBlankTerminatesInput",k[k.kInitialBlankTerminatesInput=1024]="kInitialBlankTerminatesInput",k[k.kAcceptOtherInputString=2048]="kAcceptOtherInputString",k[k.kGovernedByUCSDetect=4096]="kGovernedByUCSDetect",k[k.kNoZDirectionOrtho=8192]="kNoZDirectionOrtho",k[k.kSpacesInAccepted=16384]="kSpacesInAccepted",(G=S=_.AcquireStatus||(_.AcquireStatus={}))[G.kNoChange=0]="kNoChange",G[G.kMove=1]="kMove",G[G.kBegan=2]="kBegan",G[G.kEnd=3]="kEnd",G[G.kMouseUp=4]="kMouseUp",G[G.kMouseDown=5]="kMouseDown",G[G.kCancle=6]="kCancle",(B=C=_.DragStatus||(_.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",(u=R=_.DetailedResult||(_.DetailedResult={}))[u.kUnknown=1]="kUnknown",u[u.kTouchDownIn=2]="kTouchDownIn",u[u.kTouchUpIn=3]="kTouchUpIn",u[u.kMouseLeftIn=4]="kMouseLeftIn",u[u.kMouseLeftUpIn=5]="kMouseLeftUpIn",u[u.kMouseRightIn=6]="kMouseRightIn",u[u.kKeyIn=7]="kKeyIn",u[u.kCoordIn=8]="kCoordIn",u[u.kNullEnterIn=9]="kNullEnterIn",u[u.kNullSpaceIn=10]="kNullSpaceIn",u[u.kEcsIn=11]="kEcsIn",u[u.kNewCommadIn=12]="kNewCommadIn",(c=_.DoneStatius||(_.DoneStatius={}))[c.kContinueCommand=0]="kContinueCommand",c[c.kExitCommand=1]="kExitCommand",(O=f=_.InType||(_.InType={}))[O.kGetBegan=1]="kGetBegan",O[O.kGetEnd=2]="kGetEnd",(X=W=_.MouseButton||(_.MouseButton={}))[X.kInvalid=-1]="kInvalid",X[X.kLeft=0]="kLeft",X[X.kMid=1]="kMid",X[X.kRight=2]="kRight",(te=J=_.COMMAND_IN||(_.COMMAND_IN={}))[te.COMMAND_IN_NO_ENTITY=0]="COMMAND_IN_NO_ENTITY",te[te.COMMAND_IN_EMTPY=1]="COMMAND_IN_EMTPY",te[te.COMMAND_IN_KEY=2]="COMMAND_IN_KEY",te[te.COMMAND_IN_STRING=3]="COMMAND_IN_STRING",te[te.COMMAND_IN_COORD=5]="COMMAND_IN_COORD",te[te.COMMAND_IN_DIST=6]="COMMAND_IN_DIST",te[te.COMMAND_IN_INVALID=7]="COMMAND_IN_INVALID",te[te.COMMAND_IN_INVALID_ZERO=8]="COMMAND_IN_INVALID_ZERO",te[te.COMMAND_IN_INVALID_NEG=9]="COMMAND_IN_INVALID_NEG",te[te.COMMAND_IN_INT=10]="COMMAND_IN_INT",(ue=ne=_.COMMAND_GET||(_.COMMAND_GET={}))[ue.COMMAND_GET_STRING=1]="COMMAND_GET_STRING",ue[ue.COMMAND_GET_KEY=2]="COMMAND_GET_KEY",ue[ue.COMMAND_GET_DIST=4]="COMMAND_GET_DIST",ue[ue.COMMAND_GET_COORD=8]="COMMAND_GET_COORD",ue[ue.COMMAND_GET_INT=16]="COMMAND_GET_INT",(be=_.DynamicInputType||(_.DynamicInputType={}))[be.kNoInput=0]="kNoInput",be[be.kXYCoordInput=1]="kXYCoordInput",be[be.kDistanceInput=2]="kDistanceInput",be[be.kDynTip=3]="kDynTip",be[be.kAutoInput=4]="kAutoInput",(je=_.GETPOINTSTATUS||(_.GETPOINTSTATUS={}))[je.OsModeSValidLastPoint=1]="OsModeSValidLastPoint",je[je.OsModeSTempDisable=2]="OsModeSTempDisable",je[je.OsModeOrthoTempDisable=4]="OsModeOrthoTempDisable",je[je.OsModeSValidLastMovePoint=8]="OsModeSValidLastMovePoint",je[je.OsModePoloarTempDisable=16]="OsModePoloarTempDisable",je[je.OsModeDynTraceTempDisable=32]="OsModeDynTraceTempDisable",je[je.OsModeGridSnapTempDisable=64]="OsModeGridSnapTempDisable",(ve=_.OsnapMode||(_.OsnapMode={}))[ve.kOsModekInValid=0]="kOsModekInValid",ve[ve.kOsModeEnd=1]="kOsModeEnd",ve[ve.kOsModeMid=2]="kOsModeMid",ve[ve.kOsModeCen=3]="kOsModeCen",ve[ve.kOsModeNode=4]="kOsModeNode",ve[ve.kOsModeQuad=5]="kOsModeQuad",ve[ve.kOsModeIns=7]="kOsModeIns",ve[ve.kOsModePerp=8]="kOsModePerp",ve[ve.kOsModeTan=9]="kOsModeTan",ve[ve.kOsModeNear=10]="kOsModeNear",ve[ve.kOsModeInt=11]="kOsModeInt";var Be,q=void 0,ge=void 0,oe=S.kNoChange,le=W.kInvalid,Pe=-9999999,Ye=new v.Vector2(Pe,Pe),ze=!1,se=void 0,xe=!1,De=0,tt=new Map,st=new Array,mt=new A.MxString,Rt=void 0,Ot=-2;function He(){q!=null&&q.notifySampler()}function Vt($e,We){var ut=$e.srcElement;if(ut&&(N.MxDrawData.m_isMapBox||ut.tagName=="CANVAS")){if(q==null||q.getDynImput().isTruncatedInput())return 0;Ye.x=$e.offsetX,Ye.y=$e.offsetY,We&&(Ye.x=We.x,Ye.y=We.y),On(Ye)}return 0}function jt($e,We){if($e.button!=W.kLeft)return 0;var ut=$e.srcElement;if(!ut||!N.MxDrawData.m_isMapBox&&ut.tagName!="CANVAS"||q==null||q.getDynImput().isTruncatedInput())return 0;Ye.x=$e.offsetX,Ye.y=$e.offsetY,We&&(Ye.x=We.x,Ye.y=We.y),Be=q.getMxObject().screenCoord2Current($e.offsetX,$e.offsetY,0);var Ie=q.getOsnap();return Be=Ie.reCompteCurrentPoint(Be),oe=S.kMouseUp,le=$e.button,He(),$e.stopPropagation(),1}function Ln($e,We,ut){var Ie=q.getMxObject().screenCoord2Current($e,We,ut),Mt=q.getOsnap();Ie=Mt.reCompteCurrentPoint(Ie);var rn,tn=!1,En=q.getDynImput().getCurrentInputPointCoordinates(Ie);if(En instanceof v.Vector3&&(tn=!0,Ie.x=En.x,Ie.y=En.y),!tn){var br=Mt.getCurrentOSnapPoint(Ie);Ie=br.pt,br.isSnapPoint&&(tn=!0)}if(tn||(rn=q.getDynamicTrace().GetTracePoint())&&(Ie.copy(rn),tn=!0),tn||(rn=q.getPolarAxisTrace().GetTracePoint())&&(Ie.copy(rn),tn=!0),!tn){var Mr=q.getOrtho();Mr.OnViewMouseMove(Ie);var Tr=Mr.GetCurOrthoPoint();Tr.isValid&&(Ie.copy(Tr.pt),tn=!0)}return tn||(rn=q.getGridTrace().GetTracePoint())&&(Ie.copy(rn),tn=!0),Ie}function nn($e,We){if($e.button!=W.kLeft)return 0;q!=null&&q.getDynImput().isShow()&&q.getDynImput().setFocus(!0);var ut=$e.srcElement;if(!ut||!N.MxDrawData.m_isMapBox&&ut.tagName!="CANVAS"||q==null||q.getDynImput().isTruncatedInput())return 0;Ye.x=$e.offsetX,Ye.y=$e.offsetY,We&&(Ye.x=We.x,Ye.y=We.y);var Ie=Ln($e.offsetX,$e.offsetY,0);return M.McEdImpJigGlobalData.setPrvPoint(Ie),q.getOsnap().seInValidPoint(),Be=Ie,oe=S.kMouseDown,le=$e.button,He(),$e.stopPropagation(),1}function er($e,We){We===void 0&&(We=!0);var ut=void 0,Ie=$e.touches;We&&(Ie=$e.changedTouches);for(var Mt=0;Mt<Ie.length;Mt++)if(Ie[Mt].identifier==0){ut=Ie[Mt];break}return ut}function yt($e){var We;if(N.MxDrawData.m_isMobileCommandOperationSupportsMultipoint){if(!(We=er($e,!0)))return;$e.stopPropagation(),$e.preventDefault()}else{if($e.stopPropagation(),$e.preventDefault(),$e.touches.length==0)return;We=$e.touches[0]}q!=null&&q.getDynImput().isShow()&&q.getDynImput().setFocus(!0);var ut=$e.srcElement;if(ut&&(N.MxDrawData.m_isMapBox||ut.tagName=="CANVAS")){if(q==null)return;var Ie=$e.target.getBoundingClientRect();Ye.x=We.clientX-Ie.left,Ye.y=We.clientY-Ie.top;var Mt=Ln(Ye.x,Ye.y,0);return M.McEdImpJigGlobalData.setPrvPoint(Mt),q.getOsnap().seInValidPoint(),Be=Mt,oe=S.kBegan,le=W.kInvalid,He(),1}}function Ue($e){var We;if(N.MxDrawData.m_isMobileCommandOperationSupportsMultipoint){if(!(We=er($e)))return;$e.stopPropagation(),$e.preventDefault()}else $e.stopPropagation(),$e.preventDefault(),0<$e.touches.length&&(We=$e.touches[0]);var ut=$e.srcElement;if(ut&&(N.MxDrawData.m_isMapBox||ut.tagName=="CANVAS")){if(q==null||Ye.x==Pe||Ye.y==Pe)return;if(We){var Ie=$e.target.getBoundingClientRect();Ye.x=We.clientX-Ie.left,Ye.y=We.clientY-Ie.top}var Mt=Ln(Ye.x,Ye.y,0);return M.McEdImpJigGlobalData.setPrvPoint(Mt),q.getOsnap().seInValidPoint(),Be=Mt,oe=S.kEnd,le=W.kInvalid,He(),1}}function Zt($e){var We;if(N.MxDrawData.m_isMobileCommandOperationSupportsMultipoint){if($e.touches.length==1&&(We=er($e)),!We)return;$e.stopPropagation(),$e.preventDefault()}else{if($e.stopPropagation(),$e.preventDefault(),$e.touches.length==0)return;We=$e.touches[0]}var ut=$e.srcElement;if(ut&&(N.MxDrawData.m_isMapBox||ut.tagName=="CANVAS")){if(q==null)return;var Ie=$e.target.getBoundingClientRect();Ye.x=We.clientX-Ie.left,Ye.y=We.clientY-Ie.top,On(Ye)}}function On($e){if(xe=!1,$e==null){if(Ye.x==Pe||Ye.y==Pe)return;$e=Ye}q.getDynImput().ClearDisplay();var We=q.getMxObject().screenCoord2Current($e.x,$e.y,0),ut=q.getOffsetArrow();ut.ReSetTempDisplay(),ut.MouseMove(We);var Ie=q.getOsnap();We=Ie.reCompteCurrentPoint(We);var Mt=q.getMxObject().viewCoordLong2Cad(.5*N.MxDrawData.m_dInputRectWidth);Ie.setPoint(We,Mt);var rn=q.getDynamicTrace();rn.ReSetTempDisplay(),rn.OnDynamicTrace(0,We,_.OsnapMode.kOsModekInValid),rn.MouseMove(We);var tn,En=!1,br=q.getDynImput().getCurrentInputPointCoordinates(We);br instanceof v.Vector3&&(En=!0,We.x=br.x,We.y=br.y,We.z=br.z),En||(tn=rn.GetTracePoint())&&(We.x=tn.x,We.y=tn.y,We.z=tn.z,En=!0);var Mr=q.getPolarAxisTrace();if(Mr.ReSetTempDisplay(),En||(Mr.MouseMove(We),(tn=Mr.GetTracePoint())&&(We.x=tn.x,We.y=tn.y,We.z=tn.z,En=!0)),!En){var Tr=q.getOrtho();Tr.OnViewMouseMove(We);var ti=Tr.GetCurOrthoPoint();ti.isValid&&We.copy(ti.pt)}var Gr=q.getGridTrace();Gr.ReSetTempDisplay(),En||(Gr.MouseMove(We),(tn=Gr.GetTracePoint())&&(We.x=tn.x,We.y=tn.y,We.z=tn.z,En=!0)),Be=We,oe=S.kMove;var ba=q.getMxObject();ba.sysVariable().setSysVarPoint("LASTMOVEPOINT",We);var Di=ba.sysVariable().getSysVarNumber("GETPOINTSTATUS");Di|=_.GETPOINTSTATUS.OsModeSValidLastMovePoint,ba.sysVariable().setSysVarNumber("GETPOINTSTATUS",Di),He.call(this)}function Xn(){q&&(Rt=q.getMxObject().getEventManager(),h.MxFun.isPC()?(Rt.addEventListener("mouseup",jt,!0),Rt.addEventListener("mousemove",Vt,!0),Rt.addEventListener("mousedown",nn,!0)):(Rt.addEventListener("touchstart",yt,!0),Rt.addEventListener("touchend",Ue,!0),Rt.addEventListener("touchmove",Zt,!0)))}function dt(){Rt&&(h.MxFun.isPC()?(Rt.removeEventListener("mouseup",jt,!0),Rt.removeEventListener("mousemove",Vt,!0),Rt.removeEventListener("mousedown",nn,!0)):(Rt.removeEventListener("touchstart",yt,!0),Rt.removeEventListener("touchend",Ue,!0),Rt.removeEventListener("touchmove",Zt,!0)),Rt=void 0)}function lt($e){var We=$e.getOrbitControls();h.MxFun.isPC()?(Ot=We.mouseButtons.LEFT,We.mouseButtons.LEFT=-1):N.MxDrawData.m_isMobileCommandOperationSupportsMultipoint||(We.enabled=!1),We.resetStatusValue(),$e.callEvent("dragWillStart"),$e.updateDisplay()}function Xt($e){var We=new v.Vector3,ut=!1,Ie=new A.MxString($e),Mt=Ie.AnalyzeString(",");if(Mt.length<2)for(;;){var rn=q.getDynImput().getFocusIndex();if(rn==-1||Ie.IsEmpty()||!g.MxTools.IsNumerical(Ie))break;var tn=q.getDynImput().getLockValuesMap();if(rn==0){var En=g.MxTools._tstof(Ie.m_val);if(g.MxTools.IsZero(En)||!((or=(ni=q.getMxObject()).sysVariable().getSysVarNumber("GETPOINTSTATUS"))&_.GETPOINTSTATUS.OsModeSValidLastPoint)||!(or&_.GETPOINTSTATUS.OsModeSValidLastMovePoint))break;var br=void 0;tn.has(1)&&(br=g.MxTools._tstof(tn.get(1)));var Mr=ni.sysVariable().getSysVarPoint("LASTPOINT"),Tr=ni.sysVariable().getSysVarPoint("LASTMOVEPOINT").clone().sub(Mr);if(br===void 0){if(Tr.length()<1e-7)break;Tr.normalize()}else br=br*Math.PI/180,Tr.dot(new v.Vector3(0,1,0))<0&&(br=-br),(Tr=new v.Vector3(1,0,0)).applyAxisAngle(new v.Vector3(0,0,1),br);Tr.multiplyScalar(En);var ti=(We=Mr.clone().add(Tr)).clone().add(Tr.multiplyScalar(10));ni.sysVariable().setSysVarPoint("LASTMOVEPOINT",ti),ut=!0}else if(rn==1){var Gr=g.MxTools._tstof(Ie.m_val);if(!((or=(ni=q.getMxObject()).sysVariable().getSysVarNumber("GETPOINTSTATUS"))&_.GETPOINTSTATUS.OsModeSValidLastPoint)||!(or&_.GETPOINTSTATUS.OsModeSValidLastMovePoint))break;var ba=void 0;tn.has(0)&&(ba=g.MxTools._tstof(tn.get(0))),Mr=ni.sysVariable().getSysVarPoint("LASTPOINT"),Tr=ni.sysVariable().getSysVarPoint("LASTMOVEPOINT").clone().sub(Mr);var Di=0;if(ba===void 0){if(Tr.length()<1e-7)break;Di=Tr.length()}else Di=ba;Gr=Gr*Math.PI/180,Tr.dot(new v.Vector3(0,1,0))<0&&(Gr=-Gr);var wi=new v.Vector3(Di,0,0);wi.applyAxisAngle(new v.Vector3(0,0,1),Gr),ti=(We=Mr.clone().add(wi)).clone().add(wi.multiplyScalar(2)),ni.sysVariable().setSysVarPoint("LASTMOVEPOINT",ti),ut=!0}break}else{var or,ni=q.getMxObject(),H=new A.MxString(Mt[0]),Nr=new A.MxString(Mt[1]),Ri=new A.MxString("0");if(2<Mt.length&&(Ri.m_val=Mt[2]),H.IsEmpty()||H.Left(1)!="@")g.MxTools.IsNumerical(H)&&g.MxTools.IsNumerical(Nr)&&g.MxTools.IsNumerical(Ri)?(ut=!0,We.x=g.MxTools._tstof(H.m_val),We.y=g.MxTools._tstof(Nr.m_val),We.z=g.MxTools._tstof(Ri.m_val)):ut=!1;else if(H.m_val=H.m_val.substring(1,H.m_val.length),g.MxTools.IsNumerical(H)&&g.MxTools.IsNumerical(Nr)&&g.MxTools.IsNumerical(Ri))if((or=ni.sysVariable().getSysVarNumber("GETPOINTSTATUS"))&_.GETPOINTSTATUS.OsModeSValidLastPoint){ut=!0;var Zn=g.MxTools._tstof(H.m_val),Xi=g.MxTools._tstof(Nr.m_val),xo=g.MxTools._tstof(Ri.m_val);Mr=ni.sysVariable().getSysVarPoint("LASTPOINT"),We.x=Mr.x+Zn,We.y=Mr.y+Xi,We.z=Mr.z+xo}else ut=!1;else ut=!1}return ut?We:null}function xn($e,We){We===void 0&&(We=!1),I.MxUiVue.AcutPrintfNoFormat($e,We)}function $t($e,We){if($e==J.COMMAND_IN_INVALID){var ut=I.MxUiVue.getCmdTip();return xn(We),xn(ut),C.kNoChange}return $e==J.COMMAND_IN_INVALID_ZERO?(ut=I.MxUiVue.getCmdTip(),q.userInputControls()&Y.kNoNegativeResponseAccepted?xn(`
|
|
值必须为正 且非零。
|
|
`):xn(`
|
|
值必不能为零。
|
|
`),xn(ut),C.kOther):$e!=J.COMMAND_IN_INVALID_NEG?C.kNoChange:(ut=I.MxUiVue.getCmdTip(),q.userInputControls()&Y.kNoZeroResponseAccepted?xn(`
|
|
值必须为正 且非零。
|
|
`):xn(`
|
|
值必不能为负。
|
|
`),xn(ut),C.kOther)}function Yn($e){var We={iRet:J.COMMAND_IN_NO_ENTITY,sValue:"",iKey:C.kNull,dDist:0,iVal:0,pt:null,cmdText:""};if(!xe)return We;var ut=q.userInputControls(),Ie=I.MxUiVue.getCmdText();if((We.cmdText=Ie).length==0)return ut&Y.kNullResponseAccepted?We.iRet=J.COMMAND_IN_EMTPY:We.iRet=J.COMMAND_IN_INVALID,We;if($e&ne.COMMAND_GET_KEY&&0<tt.size){var Mt=new A.MxString(Ie);Mt.MakeUpper(),Mt.TrimLeft(" "),Mt.TrimRight(" ");var rn=tt.get(Mt.m_val);if(rn!=null)return We.iRet=J.COMMAND_IN_KEY,We.iKey=rn,We.sValue=Mt.m_val,We}if($e&ne.COMMAND_GET_DIST&&g.MxTools.IsNumerical(Ie))return We.dDist=g.MxTools._tstof(Ie),ut&Y.kNoZeroResponseAccepted&&g.MxTools.IsZero(We.dDist)?We.iRet=J.COMMAND_IN_INVALID_ZERO:ut&Y.kNoNegativeResponseAccepted&&We.dDist<0?We.iRet=J.COMMAND_IN_INVALID_NEG:(We.sValue=Ie,We.iRet=J.COMMAND_IN_DIST),We;if($e&ne.COMMAND_GET_INT&&g.MxTools.IsNumerical(Ie))return We.iVal=g.MxTools._tstoi(Ie),ut&Y.kNoZeroResponseAccepted&&We.iVal==0?We.iRet=J.COMMAND_IN_INVALID_ZERO:ut&Y.kNoNegativeResponseAccepted&&We.iVal<0?We.iRet=J.COMMAND_IN_INVALID_NEG:(We.sValue=Ie,We.iRet=J.COMMAND_IN_INT),We;if($e&ne.COMMAND_GET_COORD){var tn=Xt(Ie);if(tn!=null)return We.sValue=Ie,We.iRet=J.COMMAND_IN_COORD,We.pt=tn,We}return $e&ne.COMMAND_GET_STRING?(We.sValue=Ie,We.iRet=J.COMMAND_IN_STRING):We.iRet=J.COMMAND_IN_INVALID,We}function kr($e){var We=q.getMxObject();if(We.sysVariable().setSysVarPoint("LASTPOINT",$e),$e){var ut=We.sysVariable().getSysVarNumber("GETPOINTSTATUS");ut|=_.GETPOINTSTATUS.OsModeSValidLastPoint,We.sysVariable().setSysVarNumber("GETPOINTSTATUS",ut)}else ut=We.sysVariable().getSysVarNumber("GETPOINTSTATUS"),ut&=~_.GETPOINTSTATUS.OsModeSValidLastPoint,We.sysVariable().setSysVarNumber("GETPOINTSTATUS",ut)}function Br($e){var We=new T;return oe==S.kMove?(We.status=C.kNormal,We.pt=Be,We.exit=!1):oe==S.kEnd?$e&f.kGetEnd?(We.status=C.kNormal,We.pt=Be,We.exit=!0,We.DetailedResult=R.kTouchUpIn,kr(We.pt)):(We.status=C.kNormal,We.pt=Be,We.exit=!1):oe==S.kCancle?(We.status=C.kCancel,We.pt=Be,We.exit=!0):oe==S.kBegan?$e&f.kGetBegan?(We.status=C.kNormal,We.pt=Be,We.exit=!0,We.DetailedResult=R.kTouchDownIn,kr(We.pt)):(We.status=C.kNormal,We.pt=Be,We.exit=!1):oe==S.kMouseDown?(We.status=C.kNormal,We.pt=Be,We.exit=!0,We.DetailedResult=R.kMouseLeftIn,kr(We.pt)):(We.status=C.kNoChange,We.pt=void 0,We.exit=!1),We}_.getInputKeyword=function($e){if($e<1)return"";for(var We,ut=tt.entries();!(We=ut.next()).done;)if(We.value==$e)return We.key;return""},_.GetKeyWordToString=function(){return st},_.keywordList=function(){return mt.m_val},_.setKeywordList=function($e){if(mt.m_val=$e,tt.clear(),st.length=0,!mt.IsEmpty())if(mt.TrimLeft(" "),mt.TrimRight(" "),mt.m_val[0]=="["&&mt.m_val[mt.m_val.length-1]=="]"){mt.TrimLeft("["),mt.TrimRight("]");for(var We=mt.AnalyzeString("/"),ut=1,Ie=0;Ie<We.length;Ie++){var Mt=(En=new A.MxString(We[Ie])).Find("(");if(Mt!=-1){var rn=new A.MxString(En.Left(Mt)),tn=new A.MxString(En.Right(En.GetLength()-Mt-1));tn.TrimRight(")"),rn.IsEmpty()||tn.IsEmpty()||(tn.MakeUpper(),tt.set(tn.m_val,ut),ut++,st.push(new g.MxPair(tn.m_val,rn.m_val)))}}}else for(We=mt.AnalyzeString(" "),ut=1,Ie=0;Ie<We.length;Ie++){var En;(En=new A.MxString(We[Ie])).IsEmpty()||(En.MakeUpper(),tt.set(En.m_val,ut),ut++)}},_.getAcquirePoint=function(){return Be},_.getAcquireStatus=function(){return oe},_.doMouseMoveImp=On,_.OnThreeControlsChage=function(){if(q!=null)return q.getOsnap().reComputeOffset(),void(Ye.x!=Pe&&Ye.y!=Pe&&On(Ye))},_.OnEnter=function($e){De=$e,xe=!0,oe=S.kNoChange,He(),xe=!1},_.Test=function(){xe=!0},_.registEvent=Xn,_.unRegistEvent=dt,_.getCurrentMouseButton=function(){return le},_.isRunning=function(){return q!=null},_.getCurCmd=function(){return q},_.commandRunComplete=function($e){q!=$e&&console.log("aseert:_curCmd == cmd");var We,ut,Ie=D.MxManager.currentMx();q!=null&&(Ie=q.getMxObject()),ge!=null?(q=ge,ge=void 0,le=W.kInvalid,Xn(),q.onStartCommand(),lt(Ie)):(dt(),q=void 0,ut=(We=Ie).getOrbitControls(),h.MxFun.isPC()?Ot!=-2&&(ut.mouseButtons.LEFT=Ot,Ot=-2,ut.resetStatusValue()):(N.MxDrawData.m_isMobileCommandOperationSupportsMultipoint||(ut.enabled=!0),ut.resetStatusValue()),We.callEvent("dragWillEnd"),We.updateDisplay(),N.MxDrawData.m_isAutoResetRenderer||We.resetRenderer())},_.isWaitCmdNull=function(){return ge==null},_.stopCmd=function($e){D.MxManager.currentMx().endPanCommand(),q!=null&&(ze=!0,q.notifyCancleExit($e),ze=!1)},_.setRunCmdEvent=function($e){se=$e},_.runCmd=function($e){if(!ze){var We=D.MxManager.currentMx();$e.setMxObject(We),We.isValidCurMousePostion()?Ye=We.getCurrentMousePostion():h.MxFun.isPC()?(Ye.x=Pe,Ye.y=Pe):(Ye.x=.5*We.getViewWidth(),Ye.y=.5*We.getViewHeight()),se&&se(),q==null?(q=$e,le=W.kInvalid,Xn(),q.onStartCommand(),lt(We)):(ge=$e,ze=!0,q.notifyCancleExit(R.kNewCommadIn),ze=!1)}},_.GetAcqurePointFromStringTo=Xt,_.ProcCommandRetResult=$t,_.GetCommandLineContent=Yn,_.acquireKeyword=function(){var $e=new T;if(q==null)return $e.status=C.kCancel,$e.exit=!0,$e;var We=Yn(ne.COMMAND_GET_STRING|ne.COMMAND_GET_KEY);return We.iRet==J.COMMAND_IN_EMTPY?($e.status=C.kNull,$e.exit=!0,De==13?$e.DetailedResult=R.kNullEnterIn:De==32?$e.DetailedResult=R.kNullSpaceIn:De==-1&&($e.DetailedResult=R.kMouseRightIn)):We.iRet==J.COMMAND_IN_KEY?($e.status=We.iKey,$e.exit=!0,$e.sKeyValue=We.sValue,$e.DetailedResult=R.kKeyIn):(We.cmdText.length==0?$e.status=C.kNoChange:$e.status=$t(We.iRet,`
|
|
需要输入关键字。
|
|
`),$e.exit=!1),$e},_.acquireString=function(){var $e=new T;if(q==null)return $e.status=C.kCancel,$e.exit=!0,$e;var We=Yn(ne.COMMAND_GET_STRING|ne.COMMAND_GET_KEY);return We.iRet==J.COMMAND_IN_EMTPY?($e.status=C.kNull,$e.exit=!0,De==13?$e.DetailedResult=R.kNullEnterIn:De==32?$e.DetailedResult=R.kNullSpaceIn:De==-1&&($e.DetailedResult=R.kMouseRightIn)):We.iRet==J.COMMAND_IN_KEY?($e.status=We.iKey,$e.exit=!0,$e.sKeyValue=We.sValue,$e.DetailedResult=R.kKeyIn):We.iRet==J.COMMAND_IN_STRING?($e.status=C.kNormal,$e.sValue=We.sValue,$e.exit=!0,$e.DetailedResult=R.kKeyIn):($e.status=$t(We.iRet,`
|
|
需要输入非空字符串。
|
|
`),$e.exit=!1),$e},_.acquireInt=function(){var $e=new T;if(q==null)return $e.status=C.kCancel,$e.exit=!0,$e;var We=Yn(ne.COMMAND_GET_INT|ne.COMMAND_GET_KEY);return We.iRet==J.COMMAND_IN_EMTPY?($e.status=C.kNull,$e.exit=!0,De==13?$e.DetailedResult=R.kNullEnterIn:De==32?$e.DetailedResult=R.kNullSpaceIn:De==-1&&($e.DetailedResult=R.kMouseRightIn)):We.iRet==J.COMMAND_IN_KEY?($e.status=We.iKey,$e.exit=!0,$e.sKeyValue=We.sValue,$e.DetailedResult=R.kKeyIn):We.iRet==J.COMMAND_IN_INT?($e.status=C.kNormal,$e.iVal=We.iVal,$e.exit=!0,$e.DetailedResult=R.kKeyIn):($e.status=$t(We.iRet,`
|
|
需要整数或选项关键字。
|
|
`),$e.exit=!1),$e},_.acquireDist=function($e,We){var ut=new T;if(q==null)return ut.status=C.kCancel,ut.exit=!0,ut;var Ie=Yn(ne.COMMAND_GET_DIST|ne.COMMAND_GET_KEY);if(Ie.iRet==J.COMMAND_IN_EMTPY)return ut.status=C.kNull,ut.exit=!0,De==13?ut.DetailedResult=R.kNullEnterIn:De==32?ut.DetailedResult=R.kNullSpaceIn:De==-1&&(ut.DetailedResult=R.kMouseRightIn),ut;if(Ie.iRet==J.COMMAND_IN_KEY)return ut.status=Ie.iKey,ut.exit=!0,ut.sKeyValue=Ie.sValue,ut.DetailedResult=R.kKeyIn,ut;if(Ie.iRet==J.COMMAND_IN_DIST)return ut.status=C.kNormal,ut.dist=Ie.dDist,ut.exit=!0,ut.DetailedResult=R.kCoordIn,ut;if(ut.status=$t(Ie.iRet,`
|
|
需要点或选项关键字。
|
|
`),!We||Ie.iRet==J.COMMAND_IN_INVALID_ZERO||Ie.iRet==J.COMMAND_IN_INVALID_NEG)return ut.exit=!1,ut;var Mt=Br($e);if(Mt.status==C.kNormal&&Mt.exit){var rn=Mt.pt.clone(),tn=We.clone();rn.z=tn.z=0;var En=rn.distanceTo(tn);return q.userInputControls()&Y.kNoZeroResponseAccepted&&g.MxTools.IsZero(En)?($t(J.COMMAND_IN_INVALID_ZERO,`
|
|
需要点或选项关键字。
|
|
`),ut.status=C.kOther,ut.exit=!1,ut):(ut.status=C.kNormal,ut.dist=En,ut.exit=!0,ut.DetailedResult=Mt.DetailedResult,ut)}return ut.exit=!1,ut.status=C.kNoChange,ut},_.acquirePoint=function($e,We){We===void 0&&(We=!0);var ut=new T;if(q==null)return ut.status=C.kCancel,ut;var Ie=Yn(ne.COMMAND_GET_COORD|ne.COMMAND_GET_KEY);return Ie.iRet==J.COMMAND_IN_EMTPY?(ut.status=C.kNull,ut.exit=!0,De==13?ut.DetailedResult=R.kNullEnterIn:De==32?ut.DetailedResult=R.kNullSpaceIn:De==-1&&(ut.DetailedResult=R.kMouseRightIn),ut):Ie.iRet==J.COMMAND_IN_KEY?(ut.status=Ie.iKey,ut.exit=!0,ut.sKeyValue=Ie.sValue,ut.DetailedResult=R.kKeyIn,ut):Ie.iRet==J.COMMAND_IN_COORD?(ut.status=C.kNormal,ut.pt=new v.Vector3(Ie.pt.x,Ie.pt.y,Ie.pt.z),ut.exit=!0,ut.DetailedResult=R.kCoordIn,ut):(We&&$t(Ie.iRet,`
|
|
需要点或选项关键字。
|
|
`),Br($e))},_.acquireAngle=function($e,We){var ut=new T;if(q==null)return ut.status=C.kCancel,ut.exit=!0,ut;var Ie=Yn(ne.COMMAND_GET_DIST|ne.COMMAND_GET_KEY);if(Ie.iRet==J.COMMAND_IN_EMTPY)return ut.status=C.kNull,ut.exit=!0,De==13?ut.DetailedResult=R.kNullEnterIn:De==32?ut.DetailedResult=R.kNullSpaceIn:De==-1&&(ut.DetailedResult=R.kMouseRightIn),ut;if(Ie.iRet==J.COMMAND_IN_KEY)return ut.status=Ie.iKey,ut.exit=!0,ut.sKeyValue=Ie.sValue,ut.DetailedResult=R.kKeyIn,ut;if(Ie.iRet==J.COMMAND_IN_DIST)return ut.status=C.kNormal,ut.ang=3.14159265*Ie.dDist/180,ut.exit=!0,ut.DetailedResult=R.kCoordIn,ut;if(ut.status=$t(Ie.iRet,`
|
|
需要点或选项关键字。
|
|
`),!We||Ie.iRet==J.COMMAND_IN_INVALID_ZERO||Ie.iRet==J.COMMAND_IN_INVALID_NEG)return ut.exit=!1,ut;var Mt=Br($e);if(Mt.status==C.kNormal&&Mt.exit){var rn=new v.Vector3(Mt.pt.x-We.x,Mt.pt.y-We.y,0),tn=rn.angleTo(new v.Vector3(1,0,0));rn.dot(new v.Vector3(0,1,0))<-1e-11&&(tn=2*Math.PI-tn);var En=q.userInputControls();return En&Y.kNoZeroResponseAccepted&&g.MxTools.IsZero(tn)?($t(J.COMMAND_IN_INVALID_ZERO,`
|
|
需要点或选项关键字。
|
|
`),ut.status=C.kOther,ut.exit=!1,ut):(En&Y.kNoNegativeResponseAccepted&&tn<0?($t(J.COMMAND_IN_INVALID_NEG,`
|
|
需要点或选项关键字。
|
|
`),ut.status=C.kOther,ut.exit=!1):(ut.status=C.kNormal,ut.ang=tn,ut.exit=!0,ut.DetailedResult=Mt.DetailedResult),ut)}return ut.exit=!1,ut.status=C.kNoChange,ut},_.getMcEdJigCommandClass=function(){return b.McEdJigCommand},_.getMrxDbgUiPrPointClass=function(){return U.MrxDbgUiPrPoint},_.getMrxDbgUiPrDistClass=function(){return F.MrxDbgUiPrDist},_.getMrxDbgUiPrIntClass=function(){return F.MrxDbgUiPrInt},_.getMrxDbgUiPrStringClass=function(){return F.MrxDbgUiPrString},_.getMrxDbgUiPrKeyWordClass=function(){return F.MrxDbgUiPrKeyWord},_.getMrxDbgUiPrAngleClass=function(){return F.MrxDbgUiPrAngle},_.getMcEdGetPointWorldDrawClass=function(){return V.McEdGetPointWorldDraw},_.McEdGetPointWorldDrawObjectClass=function(){return V.McEdGetPointWorldDrawObject},_.init=function(){this._curCmd=void 0}}(a=o.MxJigCmdManager||(o.MxJigCmdManager={}))},{"../MxDrawData":22,"../MxFun":27,"../MxManager":29,"../MxString":34,"../MxTools":38,"../UI/MxUiVue":65,"./McEdJigOsnap":43,"./MrxDbgUiPrBase":45,"./MrxDbgUiPrDist":46,"./MrxDbgUiPrPoint":47,"./MxJig":53,three:19}],55:[function(w,r,o){var a,v=this&&this.__extends||(a=function(I,g){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,M){A.__proto__=M}||function(A,M){for(var N in M)Object.prototype.hasOwnProperty.call(M,N)&&(A[N]=M[N])})(I,g)},function(I,g){function A(){this.constructor=I}a(I,g),I.prototype=g===null?Object.create(g):(A.prototype=g.prototype,new A)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxJigGetLine=void 0;var h,b=w("./MxJig"),D=w("./MxJigCmdManager"),U=(v(V,h=b.McEdJigCommand),V.prototype.sampler=function(){var I=D.MxJigCmdManager.InType.kGetBegan;this._isGetPt1||(I=D.MxJigCmdManager.InType.kGetEnd);var g=this.acquirePoint(I);return g.status==D.MxJigCmdManager.DragStatus.kNormal&&(this._isGetPt1?this._pt1=g.pt:this._pt2=g.pt),g.status},V.prototype.setRetCall=function(I){this._retCall=I},V.prototype.done=function(I){if(this._isGetPt1)return this._isGetPt1=!1,D.MxJigCmdManager.DoneStatius.kContinueCommand;var g={};return g.pt1=this.getMxObject().worldCoord2Currnet(this._pt1.x,this._pt1.y,this._pt1.z),g.pt2=this.getMxObject().worldCoord2Currnet(this._pt2.x,this._pt2.y,this._pt2.z),this._retCall(g),D.MxJigCmdManager.DoneStatius.kExitCommand},V.prototype.upDisplay=function(){this._isGetPt1||this._pt1==null||this._pt2==null||this.drawLine(this._pt1,this._pt2)},V);function V(){var I=h!==null&&h.apply(this,arguments)||this;return I._isGetPt1=!0,I}o.MxJigGetLine=U},{"./MxJig":53,"./MxJigCmdManager":54}],56:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxOffsetArrow=void 0;var a=w("three"),v=w("../MxFun"),h=w("../MxThreeJS"),b=w("../MxTools"),D=(U.prototype.ClearDynDrawEntity=function(){var V=this.m_vecDynDrawEntity.length;if(V!=0){for(var I=this.m_mxJig.getMxObject().getTheTempDrawContainer_SmallCoord(),g=0;g<V;g++)v.MxFun.removeThreejsObject(this.m_vecDynDrawEntity[g],I);this.m_vecDynDrawEntity=[]}},U.prototype.MouseMove=function(V){var I=this.m_mxJig.getMxObject();if(I.getMcObject().isValid()&&(this.ClearDynDrawEntity(),this.m_mxJig.isOffsetInputPostion())){var g=V.clone(),A=this.m_mxJig.getOsnap().reCompteCurrentPoint(g.clone()),M=h.MxThreeJS.createLine(I.toSmallcoord(g),I.toSmallcoord(A),16777215),N=I.getTheTempDrawContainer_SmallCoord();N.add(M),this.m_vecDynDrawEntity.push(M);var F=b.MxTools.MillimeterToPixels(2.9);F=I.screenCoordLong2Doc(F);var T=h.MxThreeJS.createSolidCircle(I.toSmallcoord(g),.85*F,16777215);N.add(T),this.m_vecDynDrawEntity.push(T);var _=h.MxThreeJS.createCircle(I.toSmallcoord(g),F,16777215);N.add(_),this.m_vecDynDrawEntity.push(_);var Y=g.sub(A);Y.normalize().multiplyScalar(.8*F);var k=Y.clone().applyAxisAngle(new a.Vector3(0,0,1),15*Math.PI/180),S=Y.clone().applyAxisAngle(new a.Vector3(0,0,1),15*-Math.PI/180),G=A.clone().add(k),C=A.clone().add(S),B=h.MxThreeJS.createLine(I.toSmallcoord(G),I.toSmallcoord(A),16777215);I.getTheTempDrawContainer_SmallCoord().add(B),this.m_vecDynDrawEntity.push(B);var R=h.MxThreeJS.createLine(I.toSmallcoord(C),I.toSmallcoord(A),16777215);I.getTheTempDrawContainer_SmallCoord().add(R),this.m_vecDynDrawEntity.push(R)}},U.prototype.ClearDisplay=function(){this.ClearDynDrawEntity()},U.prototype.ReSetTempDisplay=function(){this.ClearDynDrawEntity()},U.prototype.Init=function(){},U);function U(V){this.m_vecDynDrawEntity=[],this.m_mxJig=null,this.m_mxJig=V}o.MxOffsetArrow=D},{"../MxFun":27,"../MxThreeJS":37,"../MxTools":38,three:19}],57:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxPolarAxisTrace=void 0;var a=w("three"),v=w("./MxJigCmdManager"),h=w("../MxFun"),b=w("../MxDrawData"),D=w("../MxTools"),U=w("../MxManager"),V=w("../MxThreeJS"),I=(g.prototype.ClearDynDrawEntity=function(){for(var A=this.m_mxJig.getMxObject().getTheTempDrawContainer_SmallCoord(),M=this.m_vecDynDrawEntity.length,N=0;N<M;N++)h.MxFun.removeThreejsObject(this.m_vecDynDrawEntity[N],A);this.m_vecDynDrawEntity=[]},g.prototype.CreteTracePoint=function(A,M){var N=this.m_mxJig.getMxObject(),F=N.getTheTempDrawContainer_SmallCoord();M/=2;var T=V.MxThreeJS.createLine(N.toSmallcoord2(A.x+M,A.y+M,0),N.toSmallcoord2(A.x-M,A.y-M,0),16711680);F.add(T),this.m_vecDynDrawEntity.push(T);var _=V.MxThreeJS.createLine(N.toSmallcoord2(A.x-M,A.y+M,0),N.toSmallcoord2(A.x+M,A.y-M,0),16711680);F.add(_),this.m_vecDynDrawEntity.push(_)},g.prototype.MouseMove=function(A){var M=this.m_mxJig.getMxObject();if(M.getMcObject().isValid()){if(this.ClearDynDrawEntity(),this.m_isValidTracePoint=!1,this.m_isTrace&&M.sysVariable().getSysVarNumber("GETPOINTSTATUS")&v.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint){var N=M.sysVariable().getSysVarPoint("LASTPOINT"),F=M.getSysVarDouble("POLARANG");if(F=180*F/Math.PI,!((F=Math.abs(F))<.001)){var T=M.viewCoordLong2Cad(b.MxDrawData.m_dInputRectWidth),_=2*T,Y=A.clone().sub(N);if(!(Y.length()<_)){Y.normalize();var k=U.MxManager.getMxCpp().getMxCAD_MxCpp(),S=U.MxManager.getMxCpp().getMxCAD_App(),G=M.getTheTempDrawContainer_SmallCoord(),C=M.viewCoordLong2Cad(this.m_dashedLineLen);Y=k.newMcGeVector3d(Y);var B=k.newMcGeVector3d(new a.Vector3(1,0,0)),R=Y.angleTo2(B),u=(R=180*R/Math.PI)%F;u<F/2?R-=u:R+=F-u;var c=M.viewCoordLong2Cad(M.getViewWidth()),f=M.viewCoordLong2Cad(M.getViewHeight()),O=D.MxTools.MxMax(c,f);(Y=B.clone()).rotateBy(R*Math.PI/180),Y.mult(O);var W=new a.Vector3(N.x+Y.x,N.y+Y.y,N.z+Y.z),X={pt1:W,pt2:N},J=S.MxCADAssist.GetClosestPointTo(X.pt1.x,X.pt1.y,X.pt2.x,X.pt2.y,A.x,A.y,!0);if(0<J.length()){var te=J.at(0),ne=new a.Vector3(te.x,te.y,te.z);if(ne.distanceTo(A)<_){var ue=V.MxThreeJS.createDashedLine(M.toSmallcoord2(N.x-Y.x,N.y-Y.y,N.z-Y.z),M.toSmallcoord(W),this.m_iDashedLineLenColor,C,C);G.add(ue),this.m_vecDynDrawEntity.push(ue),this.m_isValidTracePoint=!0,this.m_ptTracePoint=ne,this.CreteTracePoint(ne,T)}}}}}}else this.m_isTrace=!1},g.prototype.Init=function(){var A=this.m_mxJig.getMxObject();A.getMcObject().isValid()?(this.m_isValidTracePoint=!1,this.m_isTrace=!1,8&A.getSysVarLong("AUTOSNAP")&&(this.m_isTrace=!0),A.sysVariable().getSysVarNumber("GETPOINTSTATUS")&v.MxJigCmdManager.GETPOINTSTATUS.OsModePoloarTempDisable&&(this.m_isTrace=!1),this.m_mxJig.isDisablePolarAxisTrace()&&(this.m_isTrace=!1),this.m_isTrace):this.m_isTrace=!1},g.prototype.GetTracePoint=function(){if(this.m_isTrace)return this.m_isValidTracePoint?this.m_ptTracePoint:void 0},g.prototype.ClearDisplay=function(){this.ClearDynDrawEntity()},g.prototype.ReSetTempDisplay=function(){this.ClearDynDrawEntity(),this.m_isValidTracePoint=!1},g);function g(A){this.m_vecDynDrawEntity=[],this.m_ptTracePoint=new a.Vector3,this.m_isValidTracePoint=!1,this.m_isTrace=!1,this.m_mxJig=null,this.m_dashedLineLen=1.5,this.m_iDashedLineLenColor=11184810,this.m_mxJig=A}o.MxPolarAxisTrace=I},{"../MxDrawData":22,"../MxFun":27,"../MxManager":29,"../MxThreeJS":37,"../MxTools":38,"./MxJigCmdManager":54,three:19}],58:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0});var a=w("./MxFun");window.MXFUN_THREE=a.MxFun.getTHREE();var v=w("./MxManager");function h(){}(h.CreateMx=function(){a.MxFun.init(),typeof MxMain!="undefined"&&MxMain(w)==0||a.MxFun.createMxObject(),v.MxManager.callEvent("init");var b=a.MxFun.getUiObject();b!=null&&(b.sTitle=a.MxFun.getCurrentDraw().getFileTitle(),setTimeout(function(){b.init()},400))},h.Main=function(){if(typeof MxUiMain!="undefined"){MxUiMain(w);var b=a.MxFun.getUiObject();b!=null&&b.writeUICSS()}typeof MxDocumentReady=="undefined"?$(document).ready(function(){h.CreateMx()}):MxDocumentReady(w,h.CreateMx)},h).Main()},{"./MxFun":27,"./MxManager":29}],59:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxSvgManager=void 0;var a=w("three"),v=w("three"),h=w("./SVGLoader"),b=function(){this.svg=new a.Group,this.aryMeterial=[],this.boxSize=new v.Vector3(1,1,1)},D=(U.prototype.loadSVGImp=function(g,A,M,N){new h.SVGLoader().load(g,function(F){if(F.paths.length){var T=[],_=F.paths,Y=new a.Group,k=!0,S=!0,G=!1,C=!1;N&&(N.drawStrokes&&(k=N.drawStrokes),N.drawFillShapes&&(S=N.drawFillShapes),N.fillShapesWireframe&&(G=N.fillShapesWireframe),N.strokesWireframe&&(C=N.strokesWireframe));for(var B=0;B<_.length;B++){var R=_[B],u=R.userData.style.fill;if(S&&u!==void 0&&u!=="none"){for(var c=new a.MeshBasicMaterial({color:A||new a.Color().setStyle(u),opacity:R.userData.style.fillOpacity,transparent:R.userData.style.fillOpacity<1,side:a.DoubleSide,depthWrite:!1,wireframe:G}),f=h.SVGLoader.createShapes(R),O=0;O<f.length;O++){var W=f[O],X=new a.ShapeBufferGeometry(W),J=new a.Mesh(X,c);Y.add(J)}T.push(c)}var te=R.userData.style.stroke;if(k&&te!==void 0&&te!=="none"){c=new a.MeshBasicMaterial({color:A||new a.Color().setStyle(te),opacity:R.userData.style.strokeOpacity,transparent:R.userData.style.strokeOpacity<1,side:a.DoubleSide,depthWrite:!1,wireframe:C}),O=0;for(var ne=R.subPaths.length;O<ne;O++){var ue=R.subPaths[O];(X=h.SVGLoader.pointsToStroke(ue.getPoints(),R.userData.style,12,.001))&&(J=new a.Mesh(X,c),Y.add(J))}T.push(c)}}M&&M(Y,T)}else console.log("mx svg:"+g+" data.paths.length == 0"),M&&M(null,null)},void 0,function(){M&&M(null,null)})},U.prototype.loadSVG=function(g,A,M,N){var F=this,T=this.mapSvgUrlToData.get(g),_=!N||!N.useBuffer||N.useBuffer;if(T&&_){if(M)if(T==null)M(null,null);else{var Y=T.svg.clone();Y.boxSize=T.boxSize,M(Y,T.aryMeterial)}}else this.loadSVGImp(g,A,function(k,S){if(k&&S){var G=new b;G.svg=k,G.aryMeterial=S;var C=new v.Box3().setFromObject(k);G.boxSize.x=C.max.x-C.min.x,G.boxSize.y=C.max.y-C.min.y,G.boxSize.x!==-1/0&&G.boxSize.y!==-1/0||console.log("mx svg:"+g+" boxSize invalid"),F.mapSvgUrlToData.set(g,G);var B=G.svg.clone();B.boxSize=G.boxSize,M&&M(B,G.aryMeterial)}else F.mapSvgUrlToData.set(g,null),M&&M(null,null)},N)},U);function U(){this.mapSvgUrlToData=new Map}var V=(I.prototype.loadSVG=function(g,A,M,N){M&&this.mxThreeJsBuffer.loadSVG(g,A,M,N)},I);function I(){this.mxThreeJsBuffer=new D}o.MxSvgManager=V},{"./SVGLoader":60,three:19}],60:[function(w,r,o){var a,v=this&&this.__extends||(a=function(V,I){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,A){g.__proto__=A}||function(g,A){for(var M in A)Object.prototype.hasOwnProperty.call(A,M)&&(g[M]=A[M])})(V,I)},function(V,I){function g(){this.constructor=V}a(V,I),V.prototype=I===null?Object.create(I):(g.prototype=I.prototype,new g)});Object.defineProperty(o,"__esModule",{value:!0}),o.SVGLoader=void 0;var h,b=w("three"),D=(v(U,h=b.Loader),U.prototype.load=function(V,I,g,A){var M=this,N=new b.FileLoader(M.manager);N.setPath(M.path),N.setRequestHeader(M.requestHeader),N.setWithCredentials(M.withCredentials),N.load(V,function(F){try{I(M.parse(F))}catch(T){A?A(T):console.error(T),M.manager.itemError(V)}},g,A)},U.prototype.parse=function(V){var I=this;function g(X,J,te,ne,ue,be,je,ve){if(J!=0&&te!=0){ne=ne*Math.PI/180,J=Math.abs(J),te=Math.abs(te);var Be=(je.x-ve.x)/2,q=(je.y-ve.y)/2,ge=Math.cos(ne)*Be+Math.sin(ne)*q,oe=-Math.sin(ne)*Be+Math.cos(ne)*q,le=J*J,Pe=te*te,Ye=ge*ge,ze=oe*oe,se=Ye/le+ze/Pe;if(1<se){var xe=Math.sqrt(se);le=(J*=xe)*J,Pe=(te*=xe)*te}var De=le*ze+Pe*Ye,tt=(le*Pe-De)/De,st=Math.sqrt(Math.max(0,tt));ue===be&&(st=-st);var mt=st*J*oe/te,Rt=-st*te*ge/J,Ot=Math.cos(ne)*mt-Math.sin(ne)*Rt+(je.x+ve.x)/2,He=Math.sin(ne)*mt+Math.cos(ne)*Rt+(je.y+ve.y)/2,Vt=A(1,0,(ge-mt)/J,(oe-Rt)/te),jt=A((ge-mt)/J,(oe-Rt)/te,(-ge-mt)/J,(-oe-Rt)/te)%(2*Math.PI);X.currentPath.absellipse(Ot,He,J,te,Vt,Vt+jt,be===0,ne)}else X.lineTo(ve.x,ve.y)}function A(X,J,te,ne){var ue=X*te+J*ne,be=Math.sqrt(X*X+J*J)*Math.sqrt(te*te+ne*ne),je=Math.acos(Math.max(-1,Math.min(1,ue/be)));return X*ne-J*te<0&&(je=-je),je}function M(X,J){J=Object.assign({},J);var te={};if(X.hasAttribute("class"))for(var ne=X.getAttribute("class").split(/\s/).filter(Boolean).map(function(Be){return Be.trim()}),ue=0;ue<ne.length;ue++)te=Object.assign(te,S["."+ne[ue]]);function be(Be,q,ge){ge===void 0&&(ge=function(oe){return oe.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),oe}),X.hasAttribute(Be)&&(J[q]=ge(X.getAttribute(Be))),te[Be]&&(J[q]=ge(te[Be])),X.style&&X.style[Be]!==""&&(J[q]=ge(X.style[Be]))}function je(Be){return Math.max(0,Math.min(1,Y(Be)))}function ve(Be){return Math.max(0,Y(Be))}return X.hasAttribute("id")&&(te=Object.assign(te,S["#"+X.getAttribute("id")])),be("fill","fill"),be("fill-opacity","fillOpacity",je),be("fill-rule","fillRule"),be("opacity","opacity",je),be("stroke","stroke"),be("stroke-opacity","strokeOpacity",je),be("stroke-width","strokeWidth",ve),be("stroke-linejoin","strokeLineJoin"),be("stroke-linecap","strokeLineCap"),be("stroke-miterlimit","strokeMiterLimit",ve),be("visibility","visibility"),J}function N(X,J){return X-(J-X)}function F(X,J,te){if(typeof X!="string")throw new TypeError("Invalid input: "+typeof X);var ne,ue={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/},be=0,je=!0,ve="",Be="",q=[];function ge(Ye,ze,se){var xe=new SyntaxError('Unexpected character "'+Ye+'" at index '+ze+".");throw xe.partial=se,xe}function oe(){ve!==""&&(Be===""?q.push(Number(ve)):q.push(Number(ve)*Math.pow(10,Number(Be)))),Be=ve=""}for(var le=X.length,Pe=0;Pe<le;Pe++)if(ne=X[Pe],Array.isArray(J)&&J.includes(q.length%te)&&ue.FLAGS.test(ne))be=1,ve=ne,oe();else{if(be===0){if(ue.WHITESPACE.test(ne))continue;if(ue.DIGIT.test(ne)||ue.SIGN.test(ne)){be=1,ve=ne;continue}if(ue.POINT.test(ne)){be=2,ve=ne;continue}ue.COMMA.test(ne)&&(je&&ge(ne,Pe,q),je=!0)}if(be===1){if(ue.DIGIT.test(ne)){ve+=ne;continue}if(ue.POINT.test(ne)){ve+=ne,be=2;continue}if(ue.EXP.test(ne)){be=3;continue}ue.SIGN.test(ne)&&ve.length===1&&ue.SIGN.test(ve[0])&&ge(ne,Pe,q)}if(be===2){if(ue.DIGIT.test(ne)){ve+=ne;continue}if(ue.EXP.test(ne)){be=3;continue}ue.POINT.test(ne)&&ve[ve.length-1]==="."&&ge(ne,Pe,q)}if(be===3){if(ue.DIGIT.test(ne)){Be+=ne;continue}if(ue.SIGN.test(ne)){if(Be===""){Be+=ne;continue}Be.length===1&&ue.SIGN.test(Be)&&ge(ne,Pe,q)}}ue.WHITESPACE.test(ne)?(oe(),be=0,je=!1):ue.COMMA.test(ne)?(oe(),je=!(be=0)):ue.SIGN.test(ne)?(oe(),be=1,ve=ne):ue.POINT.test(ne)?(oe(),be=2,ve=ne):ge(ne,Pe,q)}return oe(),q}var T=["mm","cm","in","pt","pc","px"],_={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 Y(X){var J="px";if(typeof X=="string"||X instanceof String)for(var te=0,ne=T.length;te<ne;te++){var ue=T[te];if(X.endsWith(ue)){J=ue,X=X.substring(0,X.length-ue.length);break}}var be=void 0;return J==="px"&&I.defaultUnit!=="px"?be=_.in[I.defaultUnit]/I.defaultDPI:(be=_[J][I.defaultUnit])<0&&(be=_[J].in*I.defaultDPI),be*parseFloat(X)}var k=[],S={},G=[],C=new b.Matrix3,B=new b.Matrix3,R=new b.Matrix3,u=new b.Matrix3,c=new b.Vector2,f=new b.Vector3,O=new b.Matrix3,W=new DOMParser().parseFromString(V,"image/svg+xml");return function X(J,te){if(J.nodeType===1){var ne,ue,be,je,ve,Be,q,ge,oe,le,Pe,Ye,ze=function(Rt){if(!(Rt.hasAttribute("transform")||Rt.nodeName==="use"&&(Rt.hasAttribute("x")||Rt.hasAttribute("y"))))return null;var Ot=function(He){var Vt=new b.Matrix3,jt=C;if(He.nodeName==="use"&&(He.hasAttribute("x")||He.hasAttribute("y"))){var Ln=Y(He.getAttribute("x")),nn=Y(He.getAttribute("y"));Vt.translate(Ln,nn)}if(He.hasAttribute("transform"))for(var er=He.getAttribute("transform").split(")"),yt=er.length-1;0<=yt;yt--){var Ue=er[yt].trim();if(Ue!==""){var Zt=Ue.indexOf("("),On=Ue.length;if(0<Zt&&Zt<On){var Xn=Ue.substr(0,Zt),dt=F(Ue.substr(Zt+1,On-Zt-1));switch(jt.identity(),Xn){case"translate":1<=dt.length&&(nn=Ln=dt[0],2<=dt.length&&(nn=dt[1]),jt.translate(Ln,nn));break;case"rotate":if(1<=dt.length){var lt,Xt=0,xn=0;lt=-dt[0]*Math.PI/180,3<=dt.length&&(Xt=dt[1],xn=dt[2]),B.identity().translate(-Xt,-xn),R.identity().rotate(lt),u.multiplyMatrices(R,B),B.identity().translate(Xt,xn),jt.multiplyMatrices(B,u)}break;case"scale":if(1<=dt.length){var $t=dt[0],Yn=$t;2<=dt.length&&(Yn=dt[1]),jt.scale($t,Yn)}break;case"skewX":dt.length===1&&jt.set(1,Math.tan(dt[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":dt.length===1&&jt.set(1,0,0,Math.tan(dt[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":dt.length===6&&jt.set(dt[0],dt[2],dt[4],dt[1],dt[3],dt[5],0,0,1)}}Vt.premultiply(jt)}}return Vt}(Rt);return 0<G.length&&Ot.premultiply(G[G.length-1]),O.copy(Ot),G.push(Ot),Ot}(J),se=!0,xe=null;switch(J.nodeName){case"svg":break;case"style":(function(Rt){if(Rt.sheet&&Rt.sheet.cssRules&&Rt.sheet.cssRules.length)for(var Ot=0;Ot<Rt.sheet.cssRules.length;Ot++){var He=Rt.sheet.cssRules[Ot];if(He.type===1)for(var Vt=He.selectorText.split(/,/gm).filter(Boolean).map(function(Ln){return Ln.trim()}),jt=0;jt<Vt.length;jt++)S[Vt[jt]]=Object.assign(S[Vt[jt]]||{},He.style)}})(J);break;case"g":te=M(J,te);break;case"path":te=M(J,te),J.hasAttribute("d")&&(xe=function(Rt){for(var Ot=new b.ShapePath,He=new b.Vector2,Vt=new b.Vector2,jt=new b.Vector2,Ln=!0,nn=!1,er=Rt.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi),yt=0,Ue=er.length;yt<Ue;yt++){var Zt=er[yt],On=Zt.charAt(0),Xn=Zt.substr(1).trim();Ln===!0&&(Ln=!(nn=!0));var dt=void 0;switch(On){case"M":for(var lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=2)He.x=dt[lt+0],He.y=dt[lt+1],Vt.x=He.x,Vt.y=He.y,lt===0?Ot.moveTo(He.x,He.y):Ot.lineTo(He.x,He.y),lt===0&&jt.copy(He);break;case"H":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt++)He.x=dt[lt],Vt.x=He.x,Vt.y=He.y,Ot.lineTo(He.x,He.y),lt===0&&nn===!0&&jt.copy(He);break;case"V":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt++)He.y=dt[lt],Vt.x=He.x,Vt.y=He.y,Ot.lineTo(He.x,He.y),lt===0&&nn===!0&&jt.copy(He);break;case"L":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=2)He.x=dt[lt+0],He.y=dt[lt+1],Vt.x=He.x,Vt.y=He.y,Ot.lineTo(He.x,He.y),lt===0&&nn===!0&&jt.copy(He);break;case"C":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=6)Ot.bezierCurveTo(dt[lt+0],dt[lt+1],dt[lt+2],dt[lt+3],dt[lt+4],dt[lt+5]),Vt.x=dt[lt+2],Vt.y=dt[lt+3],He.x=dt[lt+4],He.y=dt[lt+5],lt===0&&nn===!0&&jt.copy(He);break;case"S":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=4)Ot.bezierCurveTo(N(He.x,Vt.x),N(He.y,Vt.y),dt[lt+0],dt[lt+1],dt[lt+2],dt[lt+3]),Vt.x=dt[lt+0],Vt.y=dt[lt+1],He.x=dt[lt+2],He.y=dt[lt+3],lt===0&&nn===!0&&jt.copy(He);break;case"Q":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=4)Ot.quadraticCurveTo(dt[lt+0],dt[lt+1],dt[lt+2],dt[lt+3]),Vt.x=dt[lt+0],Vt.y=dt[lt+1],He.x=dt[lt+2],He.y=dt[lt+3],lt===0&&nn===!0&&jt.copy(He);break;case"T":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=2){var xn=N(He.x,Vt.x),$t=N(He.y,Vt.y);Ot.quadraticCurveTo(xn,$t,dt[lt+0],dt[lt+1]),Vt.x=xn,Vt.y=$t,He.x=dt[lt+0],He.y=dt[lt+1],lt===0&&nn===!0&&jt.copy(He)}break;case"A":for(lt=0,Xt=(dt=F(Xn,[3,4],7)).length;lt<Xt;lt+=7)if(dt[lt+5]!=He.x||dt[lt+6]!=He.y){var Yn=He.clone();He.x=dt[lt+5],He.y=dt[lt+6],Vt.x=He.x,Vt.y=He.y,g(Ot,dt[lt],dt[lt+1],dt[lt+2],dt[lt+3],dt[lt+4],Yn,He),lt===0&&nn===!0&&jt.copy(He)}break;case"m":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=2)He.x+=dt[lt+0],He.y+=dt[lt+1],Vt.x=He.x,Vt.y=He.y,lt===0?Ot.moveTo(He.x,He.y):Ot.lineTo(He.x,He.y),lt===0&&jt.copy(He);break;case"h":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt++)He.x+=dt[lt],Vt.x=He.x,Vt.y=He.y,Ot.lineTo(He.x,He.y),lt===0&&nn===!0&&jt.copy(He);break;case"v":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt++)He.y+=dt[lt],Vt.x=He.x,Vt.y=He.y,Ot.lineTo(He.x,He.y),lt===0&&nn===!0&&jt.copy(He);break;case"l":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=2)He.x+=dt[lt+0],He.y+=dt[lt+1],Vt.x=He.x,Vt.y=He.y,Ot.lineTo(He.x,He.y),lt===0&&nn===!0&&jt.copy(He);break;case"c":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=6)Ot.bezierCurveTo(He.x+dt[lt+0],He.y+dt[lt+1],He.x+dt[lt+2],He.y+dt[lt+3],He.x+dt[lt+4],He.y+dt[lt+5]),Vt.x=He.x+dt[lt+2],Vt.y=He.y+dt[lt+3],He.x+=dt[lt+4],He.y+=dt[lt+5],lt===0&&nn===!0&&jt.copy(He);break;case"s":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=4)Ot.bezierCurveTo(N(He.x,Vt.x),N(He.y,Vt.y),He.x+dt[lt+0],He.y+dt[lt+1],He.x+dt[lt+2],He.y+dt[lt+3]),Vt.x=He.x+dt[lt+0],Vt.y=He.y+dt[lt+1],He.x+=dt[lt+2],He.y+=dt[lt+3],lt===0&&nn===!0&&jt.copy(He);break;case"q":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=4)Ot.quadraticCurveTo(He.x+dt[lt+0],He.y+dt[lt+1],He.x+dt[lt+2],He.y+dt[lt+3]),Vt.x=He.x+dt[lt+0],Vt.y=He.y+dt[lt+1],He.x+=dt[lt+2],He.y+=dt[lt+3],lt===0&&nn===!0&&jt.copy(He);break;case"t":for(lt=0,Xt=(dt=F(Xn)).length;lt<Xt;lt+=2)xn=N(He.x,Vt.x),$t=N(He.y,Vt.y),Ot.quadraticCurveTo(xn,$t,He.x+dt[lt+0],He.y+dt[lt+1]),Vt.x=xn,Vt.y=$t,He.x=He.x+dt[lt+0],He.y=He.y+dt[lt+1],lt===0&&nn===!0&&jt.copy(He);break;case"a":for(lt=0,Xt=(dt=F(Xn,[3,4],7)).length;lt<Xt;lt+=7)dt[lt+5]==0&&dt[lt+6]==0||(Yn=He.clone(),He.x+=dt[lt+5],He.y+=dt[lt+6],Vt.x=He.x,Vt.y=He.y,g(Ot,dt[lt],dt[lt+1],dt[lt+2],dt[lt+3],dt[lt+4],Yn,He),lt===0&&nn===!0&&jt.copy(He));break;case"Z":case"z":Ot.currentPath.autoClose=!0,0<Ot.currentPath.curves.length&&(He.copy(jt),Ot.currentPath.currentPoint.copy(He),Ln=!0);break;default:console.warn(Zt)}nn=!1}return Ot}(J));break;case"rect":te=M(J,te),xe=function(Rt){var Ot=Y(Rt.getAttribute("x")||0),He=Y(Rt.getAttribute("y")||0),Vt=Y(Rt.getAttribute("rx")||Rt.getAttribute("ry")||0),jt=Y(Rt.getAttribute("ry")||Rt.getAttribute("rx")||0),Ln=Y(Rt.getAttribute("width")),nn=Y(Rt.getAttribute("height")),er=.448084975506,yt=new b.ShapePath;return yt.moveTo(Ot+Vt,He),yt.lineTo(Ot+Ln-Vt,He),Vt===0&&jt===0||yt.bezierCurveTo(Ot+Ln-Vt*er,He,Ot+Ln,He+jt*er,Ot+Ln,He+jt),yt.lineTo(Ot+Ln,He+nn-jt),Vt===0&&jt===0||yt.bezierCurveTo(Ot+Ln,He+nn-jt*er,Ot+Ln-Vt*er,He+nn,Ot+Ln-Vt,He+nn),yt.lineTo(Ot+Vt,He+nn),Vt===0&&jt===0||yt.bezierCurveTo(Ot+Vt*er,He+nn,Ot,He+nn-jt*er,Ot,He+nn-jt),yt.lineTo(Ot,He+jt),Vt===0&&jt===0||yt.bezierCurveTo(Ot,He+jt*er,Ot+Vt*er,He,Ot+Vt,He),yt}(J);break;case"polygon":te=M(J,te),le=J,Pe=new b.ShapePath,Ye=0,le.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(Rt,Ot,He){var Vt=Y(Ot),jt=Y(He);Ye===0?Pe.moveTo(Vt,jt):Pe.lineTo(Vt,jt),Ye++}),Pe.currentPath.autoClose=!0,xe=Pe;break;case"polyline":te=M(J,te),q=J,ge=new b.ShapePath,oe=0,q.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(Rt,Ot,He){var Vt=Y(Ot),jt=Y(He);oe===0?ge.moveTo(Vt,jt):ge.lineTo(Vt,jt),oe++}),ge.currentPath.autoClose=!1,xe=ge;break;case"circle":te=M(J,te),xe=function(Rt){var Ot=Y(Rt.getAttribute("cx")||0),He=Y(Rt.getAttribute("cy")||0),Vt=Y(Rt.getAttribute("r")||0),jt=new b.Path;jt.absarc(Ot,He,Vt,0,2*Math.PI,!1);var Ln=new b.ShapePath;return Ln.subPaths.push(jt),Ln}(J);break;case"ellipse":te=M(J,te),xe=function(Rt){var Ot=Y(Rt.getAttribute("cx")||0),He=Y(Rt.getAttribute("cy")||0),Vt=Y(Rt.getAttribute("rx")||0),jt=Y(Rt.getAttribute("ry")||0),Ln=new b.Path;Ln.absellipse(Ot,He,Vt,jt,0,2*Math.PI,void 0,void 0);var nn=new b.ShapePath;return nn.subPaths.push(Ln),nn}(J);break;case"line":te=M(J,te),ue=Y((ne=J).getAttribute("x1")||0),be=Y(ne.getAttribute("y1")||0),je=Y(ne.getAttribute("x2")||0),ve=Y(ne.getAttribute("y2")||0),(Be=new b.ShapePath).moveTo(ue,be),Be.lineTo(je,ve),Be.currentPath.autoClose=!1,xe=Be;break;case"defs":se=!1;break;case"use":te=M(J,te);var De=J.href.baseVal.substring(1),tt=J.viewportElement.getElementById(De);tt?X(tt,te):console.warn("SVGLoader: 'use node' references non-existent node id: "+De)}if(xe&&(te.fill!==void 0&&te.fill!=="none"&&xe.color.setStyle(te.fill),function(Rt,Ot){function He(Xn){f.set(Xn.x,Xn.y,1).applyMatrix3(Ot),Xn.set(f.x,f.y)}for(var Vt=function(Xn){return Xn.elements[1]!==0||Xn.elements[3]!==0}(Ot),jt=Rt.subPaths,Ln=0,nn=jt.length;Ln<nn;Ln++)for(var er=jt[Ln].curves,yt=0;yt<er.length;yt++){var Ue=er[yt];Ue.isLineCurve?(He(Ue.v1),He(Ue.v2)):Ue.isCubicBezierCurve?(He(Ue.v0),He(Ue.v1),He(Ue.v2),He(Ue.v3)):Ue.isQuadraticBezierCurve?(He(Ue.v0),He(Ue.v1),He(Ue.v2)):Ue.isEllipseCurve&&(Vt&&console.warn("SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented."),c.set(Ue.aX,Ue.aY),He(c),Ue.aX=c.x,Ue.aY=c.y,Ue.xRadius*=(On=Ot.elements,Math.sqrt(On[0]*On[0]+On[1]*On[1])),Ue.yRadius*=(Zt=Ot.elements,Math.sqrt(Zt[3]*Zt[3]+Zt[4]*Zt[4])))}var Zt,On}(xe,O),k.push(xe),xe.userData={node:J,style:te}),se)for(var st=J.childNodes,mt=0;mt<st.length;mt++)X(st[mt],te);ze&&(G.pop(),0<G.length?O.copy(G[G.length-1]):O.identity())}}(W.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:k,xml:W.documentElement}},U.createShapes=function(V){var I=999999999,g={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},A={loc:g.ORIGIN,t:0};function M(C,B,R,u){var c=C.x,f=B.x,O=R.x,W=u.x,X=C.y,J=B.y,te=R.y,ne=u.y,ue=(W-O)*(X-te)-(ne-te)*(c-O),be=(ne-te)*(f-c)-(W-O)*(J-X),je=ue/be,ve=((f-c)*(X-te)-(J-X)*(c-O))/be;if(be==0&&ue!=0||je<=0||1<=je||ve<0||1<ve)return null;if(ue==0&&be==0){for(var Be=0;Be<2;Be++){if(N(Be===0?R:u,C,B),A.loc==g.ORIGIN)return{x:(q=Be===0?R:u).x,y:q.y,t:A.t};if(A.loc==g.BETWEEN)return{x:+(c+A.t*(f-c)).toPrecision(10),y:+(X+A.t*(J-X)).toPrecision(10),t:A.t}}return null}for(Be=0;Be<2;Be++){var q;if(N(Be===0?R:u,C,B),A.loc==g.ORIGIN)return{x:(q=Be===0?R:u).x,y:q.y,t:A.t}}return{x:+(c+je*(f-c)).toPrecision(10),y:+(X+je*(J-X)).toPrecision(10),t:je}}function N(C,B,R){var u,c=R.x-B.x,f=R.y-B.y,O=C.x-B.x,W=C.y-B.y,X=c*W-O*f;return C.x===B.x&&C.y===B.y?(A.loc=g.ORIGIN,A.t=0):C.x===R.x&&C.y===R.y?(A.loc=g.DESTINATION,A.t=1,0):void(X<-Number.EPSILON?A.loc=g.LEFT:X>Number.EPSILON?A.loc=g.RIGHT:c*O<0||f*W<0?A.loc=g.BEHIND:Math.sqrt(c*c+f*f)<Math.sqrt(O*O+W*W)?A.loc=g.BEYOND:(u=c!=0?O/c:W/f,A.loc=g.BETWEEN,A.t=u))}function F(C,B,R){var u=new b.Vector2;B.getCenter(u);var c=[];return R.forEach(function(f){f.boundingBox.containsPoint(u)&&function(O,W){for(var X=[],J=[],te=1;te<O.length;te++)for(var ne=O[te-1],ue=O[te],be=function(ve){var Be=W[ve-1],q=W[ve],ge=M(ne,ue,Be,q);ge!==null&&X.find(function(oe){return oe.t<=ge.t+Number.EPSILON&&oe.t>=ge.t-Number.EPSILON})===void 0&&(X.push(ge),J.push(new b.Vector2(ge.x,ge.y)))},je=1;je<W.length;je++)be(je);return J}(C,f.points).forEach(function(O){c.push({identifier:f.identifier,isCW:f.isCW,point:O})})}),c.sort(function(f,O){return f.point.x-O.point.x}),c}var T=0,_=I,Y=-I,k=V.subPaths.map(function(C){for(var B=C.getPoints(),R=-I,u=I,c=-I,f=I,O=0;O<B.length;O++){var W=B[O];W.y>R&&(R=W.y),W.y<u&&(u=W.y),W.x>c&&(c=W.x),W.x<f&&(f=W.x)}return Y<=c&&(Y=c+1),f<=_&&(_=f-1),{curves:C.curves,points:B,isCW:b.ShapeUtils.isClockWise(B),identifier:T++,boundingBox:new b.Box2(new b.Vector2(f,u),new b.Vector2(c,R))}});k=k.filter(function(C){return 1<C.points.length}),T=0;var S=(k=k.map(function(C){return C.identifier=T,T++,C})).map(function(C){return function(B,R,u,c,f){f!=null&&f!==""||(f="nonzero");var O=new b.Vector2;B.boundingBox.getCenter(O);var W=F([new b.Vector2(u,O.y),new b.Vector2(c,O.y)],B.boundingBox,R);W.sort(function(ge,oe){return ge.point.x-oe.point.x});var X=[],J=[];W.forEach(function(ge){ge.identifier===B.identifier?X.push(ge):J.push(ge)});for(var te=X[0].point.x,ne=[],ue=0;ue<J.length&&J[ue].point.x<te;)0<ne.length&&ne[ne.length-1]===J[ue].identifier?ne.pop():ne.push(J[ue].identifier),ue++;if(ne.push(B.identifier),f==="evenodd"){var be=ne.length%2==0,je=ne[ne.length-2];return{identifier:B.identifier,isHole:be,for:je}}if(f==="nonzero"){be=!0;for(var ve=je=null,Be=0;Be<ne.length;Be++){var q=ne[Be];be?(ve=R[q].isCW,be=!1,je=q):ve!==R[q].isCW&&(ve=R[q].isCW,be=!0)}return{identifier:B.identifier,isHole:be,for:je}}console.warn('fill-rule: "'+f+'" is currently not implemented.')}(C,k,_,Y,V.userData.style.fillRule)}),G=[];return k.forEach(function(C){if(!S[C.identifier].isHole){var B=new b.Shape;B.curves=C.curves,S.filter(function(R){return R.isHole&&R.for===C.identifier}).forEach(function(R){var u=k[R.identifier],c=new b.Path;c.curves=u.curves,B.holes.push(c)}),G.push(B)}}),G},U.getStrokeStyle=function(V,I,g,A,M){return{strokeColor:I=I!==void 0?I:"#000",strokeWidth:V=V!==void 0?V:1,strokeLineJoin:g=g!==void 0?g:"miter",strokeLineCap:A=A!==void 0?A:"butt",strokeMiterLimit:M=M!==void 0?M:4}},U.pointsToStroke=function(V,I,g,A){var M=[],N=[],F=[];if(U.pointsToStrokeWithBuffers(V,I,g,A,M,N,F)===0)return null;var T=new b.BufferGeometry;return T.setAttribute("position",new b.Float32BufferAttribute(M,3)),T.setAttribute("normal",new b.Float32BufferAttribute(N,3)),T.setAttribute("uv",new b.Float32BufferAttribute(F,2)),T},U.pointsToStrokeWithBuffers=function(V,I,g,A,M,N,F,T){var _=new b.Vector2,Y=new b.Vector2,k=new b.Vector2,S=new b.Vector2,G=new b.Vector2,C=new b.Vector2,B=new b.Vector2,R=new b.Vector2,u=new b.Vector2,c=new b.Vector2,f=new b.Vector2,O=new b.Vector2,W=new b.Vector2,X=new b.Vector2,J=new b.Vector2,te=new b.Vector2,ne=new b.Vector2;g=g!==void 0?g:12,A=A!==void 0?A:.001,T=T!==void 0?T:0;var ue=(V=function(Xt){for(var xn=!1,$t=1,Yn=Xt.length-1;$t<Yn;$t++)if(Xt[$t].distanceTo(Xt[$t+1])<A){xn=!0;break}if(!xn)return Xt;var kr=[];for(kr.push(Xt[0]),$t=1,Yn=Xt.length-1;$t<Yn;$t++)Xt[$t].distanceTo(Xt[$t+1])>=A&&kr.push(Xt[$t]);return kr.push(Xt[Xt.length-1]),kr}(V)).length;if(ue<2)return 0;var be,je,ve,Be,q,ge,oe=V[0].equals(V[ue-1]),le=V[0],Pe=I.strokeWidth/2,Ye=1/(ue-1),ze=0,se=!1,xe=0,De=3*T,tt=2*T;yt(V[0],V[1],_).multiplyScalar(Pe),R.copy(V[0]).sub(_),u.copy(V[0]).add(_),c.copy(R),f.copy(u);for(var st=1;st<ue;st++){be=V[st],je=st===ue-1?oe?V[1]:void 0:V[st+1];var mt=_;if(yt(le,be,mt),k.copy(mt).multiplyScalar(Pe),O.copy(be).sub(k),W.copy(be).add(k),ve=ze+Ye,Be=!1,je!==void 0){yt(be,je,Y),k.copy(Y).multiplyScalar(Pe),X.copy(be).sub(k),J.copy(be).add(k),q=!0,k.subVectors(je,le),mt.dot(k)<0&&(q=!1),st===1&&(se=q),k.subVectors(je,be),k.normalize();var Rt=Math.abs(mt.dot(k));if(Rt!==0){var Ot=Pe/Rt;k.multiplyScalar(-Ot),S.subVectors(be,le),G.copy(S).setLength(Ot).add(k),te.copy(G).negate();var He=G.length(),Vt=S.length();S.divideScalar(Vt),C.subVectors(je,be);var jt=C.length();switch(C.divideScalar(jt),S.dot(te)<Vt&&C.dot(te)<jt&&(Be=!0),ne.copy(G).add(be),te.add(be),ge=!1,Be?q?(J.copy(te),W.copy(te)):(X.copy(te),O.copy(te)):On(),I.strokeLineJoin){case"bevel":Xn(q,Be,ve);break;case"round":dt(q,Be),q?Zt(be,O,X,ve,0):Zt(be,J,W,ve,1);break;default:var Ln=Pe*I.strokeMiterLimit/He;if(Ln<1){if(I.strokeLineJoin!=="miter-clip"){Xn(q,Be,ve);break}dt(q,Be),q?(C.subVectors(ne,O).multiplyScalar(Ln).add(O),B.subVectors(ne,X).multiplyScalar(Ln).add(X),Ue(O,ve,0),Ue(C,ve,0),Ue(be,ve,.5),Ue(be,ve,.5),Ue(C,ve,0),Ue(B,ve,0),Ue(be,ve,.5),Ue(B,ve,0),Ue(X,ve,0)):(C.subVectors(ne,W).multiplyScalar(Ln).add(W),B.subVectors(ne,J).multiplyScalar(Ln).add(J),Ue(W,ve,1),Ue(C,ve,1),Ue(be,ve,.5),Ue(be,ve,.5),Ue(C,ve,1),Ue(B,ve,1),Ue(be,ve,.5),Ue(B,ve,1),Ue(J,ve,1))}else Be?(q?(Ue(u,ze,1),Ue(R,ze,0),Ue(ne,ve,0),Ue(u,ze,1),Ue(ne,ve,0),Ue(te,ve,1)):(Ue(u,ze,1),Ue(R,ze,0),Ue(ne,ve,1),Ue(R,ze,0),Ue(te,ve,0),Ue(ne,ve,1)),q?X.copy(ne):J.copy(ne)):q?(Ue(O,ve,0),Ue(ne,ve,0),Ue(be,ve,.5),Ue(be,ve,.5),Ue(ne,ve,0),Ue(X,ve,0)):(Ue(W,ve,1),Ue(ne,ve,1),Ue(be,ve,.5),Ue(be,ve,.5),Ue(ne,ve,1),Ue(J,ve,1)),ge=!0}}else On()}else On();oe||st!==ue-1||lt(V[0],c,f,q,!0,ze),ze=ve,le=be,R.copy(X),u.copy(J)}if(oe){if(Be&&M){var nn=ne,er=te;se!==q&&(nn=te,er=ne),q?(ge||se)&&(er.toArray(M,0),er.toArray(M,9),ge&&nn.toArray(M,3)):!ge&&se||(er.toArray(M,3),er.toArray(M,9),ge&&nn.toArray(M,0))}}else lt(be,O,W,q,!1,ve);return xe;function yt(Xt,xn,$t){return $t.subVectors(xn,Xt),$t.set(-$t.y,$t.x).normalize()}function Ue(Xt,xn,$t){M&&(M[De]=Xt.x,M[De+1]=Xt.y,M[De+2]=0,N&&(N[De]=0,N[De+1]=0,N[De+2]=1),De+=3,F&&(F[tt]=xn,F[tt+1]=$t,tt+=2)),xe+=3}function Zt(Xt,xn,$t,Yn,kr){_.copy(xn).sub(Xt).normalize(),Y.copy($t).sub(Xt).normalize();var Br=Math.PI,$e=_.dot(Y);Math.abs($e)<1&&(Br=Math.abs(Math.acos($e))),Br/=g,k.copy(xn);for(var We=0,ut=g-1;We<ut;We++)S.copy(k).rotateAround(Xt,Br),Ue(k,Yn,kr),Ue(S,Yn,kr),Ue(Xt,Yn,.5),k.copy(S);Ue(S,Yn,kr),Ue($t,Yn,kr),Ue(Xt,Yn,.5)}function On(){Ue(u,ze,1),Ue(R,ze,0),Ue(O,ve,0),Ue(u,ze,1),Ue(O,ve,1),Ue(W,ve,0)}function Xn(Xt,xn,$t){xn?(Xt?(Ue(u,ze,1),Ue(R,ze,0),Ue(O,ve,0),Ue(u,ze,1),Ue(O,ve,0),Ue(te,ve,1),Ue(O,$t,0),Ue(X,$t,0)):(Ue(u,ze,1),Ue(R,ze,0),Ue(W,ve,1),Ue(R,ze,0),Ue(te,ve,0),Ue(W,ve,1),Ue(W,$t,1),Ue(J,$t,0)),Ue(te,$t,.5)):(Xt?(Ue(O,$t,0),Ue(X,$t,0)):(Ue(W,$t,1),Ue(J,$t,0)),Ue(be,$t,.5))}function dt(Xt,xn){xn&&(Xt?(Ue(u,ze,1),Ue(R,ze,0),Ue(O,ve,0),Ue(u,ze,1),Ue(O,ve,0),Ue(te,ve,1),Ue(O,ze,0),Ue(be,ve,.5),Ue(te,ve,1),Ue(be,ve,.5),Ue(X,ze,0),Ue(te,ve,1)):(Ue(u,ze,1),Ue(R,ze,0),Ue(W,ve,1),Ue(R,ze,0),Ue(te,ve,0),Ue(W,ve,1),Ue(W,ze,1),Ue(te,ve,0),Ue(be,ve,.5),Ue(be,ve,.5),Ue(te,ve,0),Ue(J,ze,1)))}function lt(Xt,xn,$t,Yn,kr,Br){switch(I.strokeLineCap){case"round":kr?Zt(Xt,$t,xn,Br,.5):Zt(Xt,xn,$t,Br,.5);break;case"square":if(kr)_.subVectors(xn,Xt),Y.set(_.y,-_.x),k.addVectors(_,Y).add(Xt),S.subVectors(Y,_).add(Xt),Yn?(k.toArray(M,3),S.toArray(M,0),S.toArray(M,9)):(k.toArray(M,3),k.toArray(M,9),S.toArray(M,0));else{_.subVectors($t,Xt),Y.set(_.y,-_.x),k.addVectors(_,Y).add(Xt),S.subVectors(Y,_).add(Xt);var $e=M.length;Yn?(k.toArray(M,$e-3),S.toArray(M,$e-6)):(k.toArray(M,$e-6),S.toArray(M,$e-3)),S.toArray(M,$e-12)}}}},U);function U(V){var I=h.call(this,V)||this;return I.defaultDPI=90,I.defaultUnit="px",I}o.SVGLoader=D},{three:19}],61:[function(w,r,o){var a,v=this&&this.__extends||(a=function(R,u){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var O in f)Object.prototype.hasOwnProperty.call(f,O)&&(c[O]=f[O])})(R,u)},function(R,u){function c(){this.constructor=R}a(R,u),R.prototype=u===null?Object.create(u):(c.prototype=u.prototype,new c)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxTest=void 0;var h,b,D=w("../Operate/MrxDbgUiPrBase"),U=w("../Operate/MrxDbgUiPrPoint"),V=w("../MxThreeJS"),I=w("three"),g=w("../MxFun"),A=w("../View/MxDbEntity"),M=w("../MrxDbgUtils"),N=w("../Operate/MrxDbgUiPrDist"),F=(w("../MxString"),v(T,h=A.MxDbEntityUserObject),T.prototype.worldDraw=function(R){var u=new I.Vector3(this.pt.x-this.r,this.pt.y-this.r,0),c=new I.Vector3(this.pt.x+this.r,this.pt.y+this.r,0);new I.Vector3(u.x,c.y);var f=new I.Vector3(c.x,u.y);R.setDashLineDisplay(!0),R.setDash(.1,.2),R.drawLine(f,u)},T.prototype.setPoint=function(R){this.pt=R},T.prototype.setR=function(R){this.r=R},T.prototype.getTypeName=function(){return"MxDbTest"},T.prototype.getGripPoints=function(){var R=[];return R.push(this.pt),R},T.prototype.moveGripPointsAt=function(R,u){return R==0&&this.pt.add(u),!0},T.prototype.dwgIn=function(R){return h.prototype.dwgIn.call(this,R),this.pt.copy(R.pt),this.r=R.r,!0},T.prototype.dwgOut=function(R){return h.prototype.dwgOut.call(this,R),R.pt=this.pt,R.r=this.r,R},T.prototype.create=function(){return new T},T);function T(){var R=h!==null&&h.apply(this,arguments)||this;return R.pt=new I.Vector3,R.r=100,R}function _(R){var u=new U.MrxDbgUiPrPoint;u.setMessage(`
|
|
指定第一点:`),u.go(function(c){if(c==0){var f=u.value(),O=new I.Vector3;O.x=f.x,O.y=f.y;var W=new D.McEdGetPointWorldDrawObject;W.setDraw(function(X,J){J.setColor(255),J.drawLine(X,O)}),u.setUserDraw(W),u.setMessage(`
|
|
指定下一点:`),u.go(function(X){if(X==0){var J=u.value(),te=g.MxFun.getCurrentDraw(),ne=V.MxThreeJS.createLine(f,J,16777215);te.addObject(ne)}})}})}function Y(){var R=new U.MrxDbgUiPrPoint;R.setMessage(`
|
|
指定第一点:`),R.go(function(u){if(u==0){var c=g.MxFun.getCurrentDraw(),f=new F;f.setColor(16711680),f.setPoint(R.value()),f.setR(c.viewCoordLong2Cad(100)),c.addMxEntity(f),c.addMxCurrentSelect(f.objectId())}})}function k(){M.MrxDbgUtils.selectEnt("Test").then(function(R){console.log(R)})}function S(){var R=g.MxFun.getCurrentDraw();b?(R.eraseAllMxEntity(),R.loadMxEntityFromJson(b)):(b=R.saveMxEntityToJson(),console.log(b))}function G(){g.MxFun.openFile("demo/buf/hhhh.dwg?token=123456")}function C(){var R=new U.MrxDbgUiPrPoint;R.setMessage(`
|
|
指定第一点:`),R.go(function(u){if(u==0){var c=R.value();M.MrxDbgUtils.getCorner(c,"Test",!0).then(function(f){console.log("xxxdddd"),console.log(f)})}})}function B(){var R=new N.MrxDbgUiPrDist;R.setMessage(`
|
|
输入距离:`),R.go(function(u){if(u==0){var c=R.value();console.log(c)}})}(o.MxTest||(o.MxTest={})).registerCommand=function(){console.log("regist mx test"),new F().init(),g.MxFun.addCommand("MxTest_GetPoint",_),g.MxFun.addCommand("MxTest_GetDist",B),g.MxFun.addCommand("MxTest_DrawCustomEntity",Y),g.MxFun.addCommand("MxTest_EntSel",k),g.MxFun.addCommand("MxTest_SaveMxDbEntityToJson",S),g.MxFun.addCommand("MxTest_OpenFile",G),g.MxFun.addCommand("MxTest_GetCorner",C),g.MxFun.addWindowsEvent(function(R,u){if(R=="mouseup"){if(g.MxFun.isRunningCommand()||u.button!=0)return 0;var c=u.srcElement;if(c&&c.tagName=="CANVAS"){var f=g.MxFun.getCurrentDraw(),O=new I.Vector3(u.offsetX,u.offsetY,0);f.findMxEntityAtPoint(O,!1).length&&u.preventDefault()}return 0}})}},{"../MrxDbgUtils":20,"../MxFun":27,"../MxString":34,"../MxThreeJS":37,"../Operate/MrxDbgUiPrBase":45,"../Operate/MrxDbgUiPrDist":46,"../Operate/MrxDbgUiPrPoint":47,"../View/MxDbEntity":69,three:19}],62:[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(w){this.vecLayoutData=w},MxUiObject.prototype.CallMxCommand=function(w){MxFun_1.MxFun.callCommand(w,"")},MxUiObject.prototype.EvalJs=function(value){eval(value)},MxUiObject.prototype.SetLayerData=function(w){this.vecLayerData=w},MxUiObject.prototype.SetSketchLayerData=function(w){this.vecSketchLayerData=w},MxUiObject.prototype.init=function(){this.onInit()},MxUiObject.prototype.addMenuItem=function(w,r,o,a){r===void 0&&(r=""),o===void 0&&(o=-1),a===void 0&&(a=-1);var v=new MxMenuItem;v.text=w,v.evalString=r,a==-1&&(a=this.idMenuItemCount,this.idMenuItemCount++),v.id=a,v.parentId=o,this.vecMenuItem.push(v)},MxUiObject.prototype.addToolBarItem=function(w,r,o,a,v){r===void 0&&(r=""),o===void 0&&(o=""),a===void 0&&(a=!1),v===void 0&&(v="");var h=new MxToolBarItem;h.image=w,h.evalString=o,h.text=r,h.isMxCommand=a,h.itemid=v,this.vecToolBarItem.push(h)},MxUiObject.prototype.setPath=function(w){this.uiPath=w},MxUiObject.prototype.getPath=function(){return this.uiPath},MxUiObject.prototype.create=function(){this.onCreate()},MxUiObject.prototype.writeUICSS=function(){var w=this.uiPath;MxFun_1.MxFun.isPC()?(document.write("<link rel='stylesheet' href='"+w+"/css/mxbimpcm.css'>"),this.isShowMainMenu&&(document.write("<link rel='stylesheet' href='"+w+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+w+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+w+"/hc-mobile-nav.js'><\/script>"))):(document.write("<link rel='stylesheet' href='"+w+"/css/mxmobile.css'>"),this.isShowMainMenu&&(document.write("<link href='"+w+"/css/font-awesome.min.css' rel='stylesheet'>"),document.write("<link rel='stylesheet' href='"+w+"/css/rightfacefonts1.css'>"),document.write("<link rel='stylesheet' href='"+w+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+w+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+w+"/hc-mobile-nav.js'><\/script>")))},MxUiObject}();exports.MxUiObject=MxUiObject},{"../MxFun":27}],63:[function(w,r,o){var a,v=this&&this.__extends||(a=function(I,g){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,M){A.__proto__=M}||function(A,M){for(var N in M)Object.prototype.hasOwnProperty.call(M,N)&&(A[N]=M[N])})(I,g)},function(I,g){function A(){this.constructor=I}a(I,g),I.prototype=g===null?Object.create(g):(A.prototype=g.prototype,new A)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxUiObjectMobile=void 0;var h,b=w("./MxUiObject"),D=w("../MxFun"),U=(v(V,h=b.MxUiObject),V.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()},V.prototype.onInit=function(){this.InitEvent()},V.prototype.ShowLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0)"),$(".Prompt").fadeIn(100),$(".Prompt span").css("display","none"))},V.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))},V.prototype.ShowObjectProperty=function(I){if(I.length!=0){var g;g=typeof I=="string"?JSON.parse(I):I;var A="";for(var M in g){var N=g[M];for(var F in A+='<tbody class="bf-group undefined bf-collapse">',A+='<tr class="bf-group-title">',A+='<td colspan="2"><i class="bf-icon" style=" padding: 12px;"></i>'+N.name+"</td>",A+="</tr>",N.datas){var T=N.datas[F];A+="<tr class='bf-group-content'>",A+="<td class='bf-key'>"+T.name+"</td>",A+="<td class='bf-value'>"+T.value+"</td>",A+="</tr>"}A+="</tbody>"}document.getElementById("ComponentContent").innerHTML=A,$(".bf-group").click(function(){$(this).hasClass("bf-collapse")?$(this).removeClass("bf-collapse"):$(this).addClass("bf-collapse")})}},V.prototype.HideObjectProp=function(){},V.prototype.SwitchShowLayer=function(){var I=document.getElementById("LayerInterface");I.style.display=="none"?(I.style.display="block",I.style.left="80px",I.style.top="50px"):I.style.display="none"},V.prototype.SwitchShowStructTree=function(){},V.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},V.prototype.ColorChange=function(I){document.getElementById("colorbox").style.backgroundColor=I,D.MxFun.setCurrentColor(I)},V.prototype.SwitchShowLayout=function(){var I=document.getElementById("LayerOutInterface");I.style.display=="none"?I.style.display="block":I.style.display="none"},V.prototype.WriteTitle=function(){var I=this.uiPath;document.write("<div class='bar1'>"),document.write("<img src='"+I+"/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>")},V.prototype.WriteToolbar=function(){document.write("<div id='MainMenuContent' class='bf-toolbar bf-toolbar-bottom'>"),document.write("</div>")},V.prototype.WriteLoading=function(){var I=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='"+I+"/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>")},V.prototype.WriteLayer=function(){var I=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='"+I+"/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>")},V.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>")},V.prototype.WriteTakeColor=function(){var I=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='"+I+"/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='"+I+"/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>"))},V.prototype.WriteLayout=function(){var I=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='"+I+"/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>")},V.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>")},V.prototype.UpDisplayLayout=function(){},V.prototype.UpDisplayLayer=function(){var I=this.uiPath,g=this.vecLayerData,A=this.vecSketchLayerData,M="";if(A!=null){var N=A;for(var F in N){M+="<div>";var T="hide.png";N[F].off==0&&(T="show.png");var _="unlock.png";M+="<table class='bf-table'>",M+="<tbody class='bf-group'>",M+="<tr class='bf-group-title'>",M+='<td><img class="layer-enable" sketch=1 id='+N[F].id+' src="'+I+"/image/"+T+'"/></td>',M+='<td><span class="layer-color" style="background-color:'+N[F].color+'"></span></td>',M+='<td><span class="layer-text">草图_'+N[F].name+"</span></td>",M+='<td><img class="layer-state" src="'+I+"/image/"+_+'"/></td>',M+="</tr>",M+="</tbody>",M+="</table>",M+="</div>"}}if(g!=null)for(var F in N=g)M+="<div>",T="hide.png",N[F].off==0&&(T="show.png"),_="lock.png",M+="<table class='bf-table'>",M+="<tbody class='bf-group'>",M+="<tr class='bf-group-title'>",M+='<td><img class="layer-enable" sketch=0 id='+N[F].id+' src="'+I+"/image/"+T+'"/></td>',M+='<td><span class="layer-color" style="background-color:'+N[F].color+'"></span></td>',M+='<td><span class="layer-text">'+N[F].name+"</span></td>",M+='<td><img class="layer-state" src="'+I+"/image/"+_+'"/></td>',M+="</tr>",M+="</tbody>",M+="</table>",M+="</div>";var Y=document.getElementById("Layer-Info");Y!=null&&(Y.innerHTML=M)},V.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>")},V.prototype.CreateToolBar=function(I){if(this.isShowToolbar){var g="";for(var A in I){var M=I[A],N="uiObj.CallMxCommand";M.isMxCommand||(N="uiObj.EvalJs"),0<M.itemid.length?g+='<div class="bf-button" onclick="'+N+"('"+I[A].evalString+`')"><img class="mainimage-bf-butto" id="`+M.itemid+'" src="'+this.uiPath+"\\image\\"+M.image+'" title="'+I[A].text+'"></div>':g+='<div class="bf-button" onclick="'+N+"('"+I[A].evalString+`')"><img class="mainimage-bf-butto" src="`+this.uiPath+"\\image\\"+M.image+'" title="'+I[A].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=g}},V.prototype.InitEvent=function(){var I=document.getElementById("LayerInterface");this.CreateToolBar(this.vecToolBarItem),I.style.display="none";var g=this.vecMenuItem;this.isShowMainMenu&&function(T){var _="";(function B(R,u){var c=function(O,W){var X=new Array;for(var J in W)W[J].parentId==O&&X.push(W[J]);return X}(R,u);if(0<c.length){for(var f in _+="<ul>",c)c[f].evalString.length!=0?(_+='<li><p class="li_option" ',_+=`onclick="uiObj.EvalJs('`+c[f].evalString+`')"`,_+=">"+c[f].text+"</p>"):(_+="<li><a ",_+=">"+c[f].text+"</a>"),B(c[f].id,u),_+="</li>";_+="</br>",_+="</br>",_+="</br>",_+="</ul>"}})(-1,g),T("#main-nav").append(_);var Y=T("#main-nav"),k=T(".toggle"),S={maxWidth:!1,customToggle:k,levelTitles:!0},G=null,C={};G&&G.remove(),k.off("click"),G=Y.clone(),T.extend(C,{side:"right"}),G.hcMobileNav(T.extend({},S,C))}(jQuery);var A=window.location.href,M=A.length,N=A.indexOf("?"),F=A.substr(N,M).split("=")[1];$(".barspan").html(decodeURIComponent(F)),$("#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=D.MxFun.getUiObj().getPath(),_=parseInt($(this).attr("id")),Y=!0;$(this).attr("src")==T+"/image/show.png"?($(this).attr("src",T+"/image/hide.png"),Y=!1):$(this).attr("src",T+"/image/show.png"),D.MxFun.showLayer(_,Y)})},V.prototype.Fullscreen=function(){var I=document.documentElement;I.requestFullscreen?I.requestFullscreen():I.mozRequestFullScreen?I.mozRequestFullScreen():I.webkitRequestFullScreen&&I.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","取消全屏"))},V.prototype.IsFullStatus=function(){return(document.fullscreenEnabled||document.mozFullscreenElement||document.webkitFullscreenElement)!=null},V);function V(){return h!==null&&h.apply(this,arguments)||this}o.MxUiObjectMobile=U},{"../MxFun":27,"./MxUiObject":62}],64:[function(w,r,o){var a,v=this&&this.__extends||(a=function(I,g){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,M){A.__proto__=M}||function(A,M){for(var N in M)Object.prototype.hasOwnProperty.call(M,N)&&(A[N]=M[N])})(I,g)},function(I,g){function A(){this.constructor=I}a(I,g),I.prototype=g===null?Object.create(g):(A.prototype=g.prototype,new A)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxUiObjectPC=void 0;var h,b=w("./MxUiObject"),D=w("../MxFun"),U=(v(V,h=b.MxUiObject),V.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()},V.prototype.onInit=function(){this.InitEvent()},V.prototype.WriteTitle=function(){var I=this.uiPath;document.write("<div id='all'>"),document.write(" <div class='bar1'>"),document.write(" <img src="+I+"/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>")},V.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>")},V.prototype.WriteLoading=function(){var I=this.uiPath;document.write("<div class='Prompt'>"),document.write("<div style='text-align: center;'>"),document.write("<img src='"+I+"/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>")},V.prototype.WriteLayer=function(){var I=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='"+I+"/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>")},V.prototype.WriteTakeColor=function(){var I=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='"+I+"/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='"+I+"/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>"))},V.prototype.WriteLayout=function(){var I=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='"+I+"/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>")},V.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>")},V.prototype.WriteToolbar=function(){document.write("<div id='MainMenuContent' class='bf-toolbar bf-toolbar-bottom' style='position: fixed'></div>")},V.prototype.CreateToolBar=function(I){if(this.isShowToolbar){var g="";for(var A in I){var M=I[A],N="uiObj.CallMxCommand";M.isMxCommand||(N="uiObj.EvalJs"),0<M.itemid.length?g+='<div class="bf-button" onclick="'+N+"('"+I[A].evalString+`')"><img class="mainimage-bf-butto" id="`+M.itemid+'" src="'+this.uiPath+"\\image\\"+M.image+'" title="'+I[A].text+'"></div>':g+='<div class="bf-button" onclick="'+N+"('"+I[A].evalString+`')"><img class="mainimage-bf-butto" src="`+this.uiPath+"\\image\\"+M.image+'" title="'+I[A].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=g}},V.prototype.UpDisplayLayer=function(){var I=this.uiPath,g=this.vecLayerData,A=this.vecSketchLayerData,M="";if(A!=null){var N=A;for(var F in N){M+="<div>";var T="hide.png";N[F].off==0&&(T="show.png");var _="unlock.png";M+="<table class='bf-table'>",M+="<tbody class='bf-group'>",M+="<tr class='bf-group-title'>",M+='<td><img class="layer-enable" sketch=1 id='+N[F].id+' src="'+I+"/image/"+T+'"/></td>',M+='<td><span class="layer-color" style="background-color:'+N[F].color+'"></span></td>',M+='<td><span class="layer-text">草图_'+N[F].name+"</span></td>",M+='<td><img class="layer-state" src="'+I+"/image/"+_+'"/></td>',M+="</tr>",M+="</tbody>",M+="</table>",M+="</div>"}}if(g!=null)for(var F in N=g)M+="<div>",T="hide.png",N[F].off==0&&(T="show.png"),_="lock.png",M+="<table class='bf-table'>",M+="<tbody class='bf-group'>",M+="<tr class='bf-group-title'>",M+='<td><img class="layer-enable" sketch=0 id='+N[F].id+' src="'+I+"/image/"+T+'"/></td>',M+='<td><span class="layer-color" style="background-color:'+N[F].color+'"></span></td>',M+='<td><span class="layer-text">'+N[F].name+"</span></td>",M+='<td><img class="layer-state" src="'+I+"/image/"+_+'"/></td>',M+="</tr>",M+="</tbody>",M+="</table>",M+="</div>";var Y=document.getElementById("Layer-Info");Y!=null&&(Y.innerHTML=M)},V.prototype.UpDisplayLayout=function(){var I=this.vecLayoutData,g="";if(g+="<div>",g+="<table class='bf-table'>",g+="<tbody class='bf-group'>",g+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",g+="<td class='bf_layerout_td' style='width: 60px' >",g+="<div class='bf_layer_div layer_on'></div>",g+="</td>",g+="<td style='width: 238px' >",g+="<span class='layout-name' name='Model' style='color: white;cursor: pointer;'>Model</span>",g+="</td>",g+="</tr>",I!=null){var A=I;for(var M in A)g+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",g+="<td class='bf_layerout_td' style='width: 60px' >",g+="<div class='bf_layer_div layer_on'></div>",g+="</td>",g+="<td style='width: 238px' >",g+="<span class='layout-name' name='"+A[M]+"' style='color: white;cursor: pointer;'>"+A[M]+"</span>",g+="</td>",g+="</tr>"}g+="</tbody>",g+="</table>",g+="</div>";var N=document.getElementById("layout-Info");N!=null&&(N.innerHTML=g)},V.prototype.InitEvent=function(){var I=document.getElementById("ModelTreeInterface"),g=document.getElementById("LayerInterface"),A=document.getElementById("LayerOutInterface"),M=document.getElementById("tuceng"),N=document.getElementById("mulushu"),F=document.getElementById("buju"),T=0,_=0,Y=0,k=0,S=!1;N.onmousedown=function(f){T=f.clientX,_=f.clientY,Y=I.offsetLeft,k=I.offsetTop,S=!0,I.style.cursor="move"},M.onmousedown=function(f){T=f.clientX,_=f.clientY,Y=g.offsetLeft,k=g.offsetTop,S=!0,g.style.cursor="move"},F.onmousedown=function(f){T=f.clientX,_=f.clientY,Y=A.offsetLeft,k=A.offsetTop,S=!0,A.style.cursor="move"},window.onmousemove=function(f){if(S!=0){var O=f.clientX,W=f.clientY,X=O-(T-Y),J=W-(_-k);I.style.left=X+"px",I.style.top=J+"px",g.style.left=X+"px",g.style.top=J+"px",A.style.left=X+"px",A.style.top=J+"px"}},N.onmouseup=function(){S=!1,I.style.cursor="default"},M.onmouseup=function(){S=!1,g.style.cursor="default"},F.onmouseup=function(){S=!1,A.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 G=$("#StrcutInfoBase");G.bind("mousedown",function(f){var O=$(this)[0].offsetLeft,W=$(this)[0].offsetTop,X=f.pageX,J=f.pageY;$(document).bind("mousemove",function(te){var ne=te.pageX-X,ue=te.pageY-J,be=O+ne+"px",je=W+ue+"px";G.css({top:je,left:be})})}),$(document).bind("mouseup",function(){$(this).unbind("mousemove")}),this.CreateToolBar(this.vecToolBarItem);var C=this.vecMenuItem;if(this.isShowMainMenu&&function(f){var O="";(function ue(be,je){var ve=function(q,ge){var oe=new Array;for(var le in ge)ge[le].parentId==q&&oe.push(ge[le]);return oe}(be,je);if(0<ve.length){for(var Be in O+="<ul>",ve)ve[Be].evalString.length!=0?(O+='<li><p class="li_option" ',O+=`onclick="uiObj.EvalJs('`+ve[Be].evalString+`')"`,O+=">"+ve[Be].text+"</p>"):(O+="<li><a ",O+=">"+ve[Be].text+"</a>"),ue(ve[Be].id,je),O+="</li>";O+="</br>",O+="</br>",O+="</br>",O+="</ul>"}})(-1,C),f("#main-nav").append(O);var W=f("#main-nav"),X=f(".toggle"),J={maxWidth:!1,customToggle:X,levelTitles:!0},te=null,ne={};te&&te.remove(),X.off("click"),te=W.clone(),f.extend(ne,{side:"right"}),te.hcMobileNav(f.extend({},J,ne))}(jQuery),$(".li_option").click(function(){var f=$(this);$(".li_option").each(function(){$(this).removeClass("active")}),f.addClass("active")}),this.sTitle==""){var B=window.location.href,R=B.length,u=B.indexOf("?"),c=B.substr(u,R).split("=")[1];c!=null&&(this.sTitle=c)}$(".barspan").html(decodeURIComponent(this.sTitle)),$(document).on("click",".layer-enable",function(){var f=D.MxFun.getUiObj().getPath(),O=parseInt($(this).attr("id")),W=(parseInt($(this).attr("sketch")),!0);$(this).attr("src")==f+"/image/show.png"?($(this).attr("src",f+"/image/hide.png"),W=!1):$(this).attr("src",f+"/image/show.png"),D.MxFun.showLayer(O,W)}),$(document).on("click",".layout-name",function(){var f=$(this).attr("name");f=="Model"&&(f=""),D.MxFun.getCurrentDraw().gotoLayout(f)})},V.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>")},V.prototype.ShowLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0)"),$(".Prompt").fadeIn(100),$(".Prompt span").css("display","none"))},V.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))},V.prototype.ShowObjectProperty=function(I){if(I.length!=0){var g;g=typeof I=="string"?JSON.parse(I):I;var A="";for(var M in g){var N=g[M];for(var F in A+="<table class='bf-table'>",A+="<tbody class='bf-group'>",A+="<tr class='bf-group-title'>",A+="<td colspan='2'><i class='bf-icon'></i>"+N.name+"</td>",A+="</tr>",N.datas){var T=N.datas[F];A+="<tr class='bf-group-content'>",A+="<td class='bf-key'>"+T.name+"</td>",A+="<td class='bf-value'>"+T.value+"</td>",A+="</tr>"}A+="</tbody>",A+="</table>"}document.getElementById("ComponentContent").innerHTML=A,$(".bf-group").click(function(){$(this).hasClass("bf-collapse")?$(this).removeClass("bf-collapse"):$(this).addClass("bf-collapse")}),$("#StrcutInfoBase").fadeIn(200),$("#StrcutInfoBase").removeClass("hide")}},V.prototype.HideObjectProp=function(){$("#StrcutInfoBase").hasClass("hide")||($("#StrcutInfoBase").fadeOut(200),$("#StrcutInfoBase").addClass("hide"))},V.prototype.SwitchShowLayer=function(){var I=document.getElementById("ModelTreeInterface"),g=document.getElementById("ModelTreeThumbnail"),A=document.getElementById("LayerThumbnail"),M=document.getElementById("LayerInterface"),N=document.getElementById("LayerOut"),F=document.getElementById("LayerOutInterface");I.style.display="none",(F.style.display="none")==M.style.display?(A.style.display="block",M.style.display="block",M.style.left="80px",M.style.top="50px",g!=null&&(g.style.display="block"),N!=null&&(N.style.display="block"),I.style.display="none",F.style.display="none"):(M.style.display="none",g!=null&&(g.style.display="block"),A.style.display="block",N!=null&&(N.style.display="block"))},V.prototype.SwitchShowStructTree=function(){var I=document.getElementById("ModelTreeInterface"),g=document.getElementById("ModelTreeThumbnail"),A=document.getElementById("LayerThumbnail"),M=document.getElementById("LayerInterface"),N=document.getElementById("LayerOut"),F=document.getElementById("LayerOutInterface");M.style.display="none",(F.style.display="none")==I.style.display?(g!=null&&(g.style.display="block"),I.style.display="block",I.style.left="80px",I.style.top="50px",A.style.display="block",N!=null&&(N.style.display="block"),M.style.display="none",F.style.display="none"):(I.style.display="none",g!=null&&(g.style.display="block"),A.style.display="block",N!=null&&(N.style.display="block"))},V.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},V.prototype.ColorChange=function(I){document.getElementById("colorbox").style.backgroundColor=I,D.MxFun.setCurrentColor(I)},V.prototype.SwitchShowLayout=function(){var I=document.getElementById("ModelTreeInterface"),g=document.getElementById("ModelTreeThumbnail"),A=document.getElementById("LayerThumbnail"),M=document.getElementById("LayerInterface"),N=document.getElementById("LayerOut"),F=document.getElementById("LayerOutInterface");I.style.display="none",M.style.display="none",F&&F.style.display=="none"?(N&&(N.style.display="block"),F.style.display="block",F.style.left="80px",F.style.top="120px",g!=null&&(g.style.display="block"),A&&(A.style.display="block"),I.style.display="none",M.style.display="none"):(F&&(F.style.display="none"),g!=null&&(g.style.display="block"),A&&(A.style.display="block"),N&&(N.style.display="block"))},V.prototype.Fullscreen=function(){var I=document.documentElement;I.requestFullscreen?I.requestFullscreen():I.mozRequestFullScreen?I.mozRequestFullScreen():I.webkitRequestFullScreen&&I.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","取消全屏"))},V.prototype.IsFullStatus=function(){return(document.fullscreenEnabled||document.mozFullscreenElement||document.webkitFullscreenElement)!=null},V);function V(){return h!==null&&h.apply(this,arguments)||this}o.MxUiObjectPC=U},{"../MxFun":27,"./MxUiObject":62}],65:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxUiVue=o.MxUiOperations=void 0;var a,v,h,b,D=w("three"),U=w("../MxFun"),V=w("../Operate/MxJigCmdManager"),I=w("../MxTools"),g=w("../Operate/MxCmdRunManager");function A(S){var G=V.MxJigCmdManager.getCurCmd();G!=null&&G.getOsnap().setSpecificOsMode(S)}function M(S){if(S==32||S==13){if(V.MxJigCmdManager.isRunning())V.MxJigCmdManager.OnEnter(S);else{var G=_(),C="";C=G.length==0?g.MxCmdRunManager.GetPrvCmd():G,Y(""),C=I.MxTools.stringTrimLeftSpace(C),U.MxFun.sendStringToExecute(C)}return 1}if(S==38)V.MxJigCmdManager.isRunning()||(g.MxCmdRunManager.MoveUpKey(),(B=g.MxCmdRunManager.GetListCommad()).length!=0&&(Y(B),T()));else if(S==40){var B;V.MxJigCmdManager.isRunning()||(g.MxCmdRunManager.MoveDownKey(),(B=g.MxCmdRunManager.GetListCommad()).length!=0&&(Y(B),T()))}return 0}function N(S,G){G===void 0&&(G=!0);var C=S.length;if(!(C<1)){for(var B=h.getCmdLine(),R=B.getCmdTip(),u=B.getCmdText(),c=S.indexOf(`
|
|
`),f=0,O=!0;c!=-1&&(O?(B.addCmdDisplay(`
|
|
`+R+u+S.substring(f,c-f)),u=R="",O=!1):B.addCmdDisplay(`
|
|
`+S.substring(f,c-f)),(f=c+1)<C);)c=S.indexOf(`
|
|
`,f);if(O){var W=S.substring(f,C-f),X=W.indexOf("\r"),J=W.length;R=X==-1?R+u+W:X+1<J?W.substring(X+1,J-X-1):""}else f<C&&(R=S.substring(f,C));u="",G&&(R+=" "),B.setCmdTip(R),B.setCmdText(u),B.upDisplay()}}function F(S){for(var G=[],C=1;C<arguments.length;C++)G[C-1]=arguments[C];if(h!=null){for(var B=arguments,R=B[0],u=0;u<B.length-1;u++){var c=new RegExp("\\{"+u+"\\}","gm");R=R.replace(c,B[u+1])}N(R,!0)}}function T(){h!=null&&h.getCmdLine().upDisplay()}function _(){if(h==null)return"";var S=h.getCmdLine();return I.MxTools.stringTrimLeftRightSpace(S.getCmdText())}function Y(S){if(h!=null)return h.getCmdLine().setCmdText(S)}function k(S){var G=V.MxJigCmdManager.getCurCmd();return G==null?0:G.getDynImput().onKeyDonw(S)?1:M(S)}o.MxUiOperations={kOkCommand:1,kCancaleCommand:2},a=o.MxUiVue||(o.MxUiVue={}),h=void 0,b=new D.Vector3,a.SetLasetPoint=function(S){b=S},a.GetLasetPoint=function(){return b},(v=a.CursorType||(a.CursorType={}))[v.kNormal=0]="kNormal",v[v.kRect=1]="kRect",v[v.kCross=2]="kCross",v[v.kPan=3]="kPan",a.isNull=function(){return h==null},a.init=function(S){(h=S).mountKeydownEvent(M),h.getDynamicInput().mountKeydownEvent(k),h.mountsetRightMenuSnapTypeFun&&h.mountsetRightMenuSnapTypeFun(A),h.mountTsWeb_MxUiVue&&h.mountTsWeb_MxUiVue(this)},a.executeOperations=function(S){S==o.MxUiOperations.kOkCommand?V.MxJigCmdManager.getCurCmd()&&V.MxJigCmdManager.OnEnter(-1):S==o.MxUiOperations.kCancaleCommand&&V.MxJigCmdManager.getCurCmd()&&V.MxJigCmdManager.stopCmd(V.MxJigCmdManager.DetailedResult.kEcsIn)},a.setTipCoord=function(S){h!=null&&h.setTipCoord(S)},a.setCursorType=function(S){h!=null&&h.setCursorType(S)},a.AcutPrintfNoFormat=N,a.acutPrintf=F,a.cmdLineUpDisplay=T,a.getCmdText=_,a.setCmdText=Y,a.getCmdDisplay=function(){return h==null?"":h.getCmdLine().getCmdDisplay()},a.setCmdDisplay=function(S){if(h!=null)return h.getCmdLine().setCmdDisplay(S)},a.getCmdTip=function(){return h==null?"":h.getCmdLine().getCmdTip()},a.setCmdTip=function(S){if(h!=null)return h.getCmdLine().setCmdTip(S)},a.restoreCmdStatus=function(){if(h!=null){var S=h.getCmdLine();S.getCmdTip()==" "&&S.getCmdText().length==0?(S.setCmdTip(""),F("{0}:","命令")):F(`
|
|
{0}:`,"命令")}},a.DynamicInput_upDisplay=function(){h!=null&&a.OnMxEvent({name:"dynInputUpDisplay"})},a.DynamicInput_setType=function(S){h!=null&&h.getDynamicInput().setType(S)},a.DynamicInput_getType=function(){return h==null?V.MxJigCmdManager.DynamicInputType.kNoInput:h.getDynamicInput().getType()},a.DynamicInput_setPos=function(S){h!=null&&h.getDynamicInput().setPos([S.x,S.y])},a.DynamicInput_setTip=function(S){h!=null&&h.getDynamicInput().setTip(S)},a.DynamicInput_setValue1=function(S){h!=null&&h.getDynamicInput().setValue1(S)},a.DynamicInput_getValue1=function(){return h==null?"":h.getDynamicInput().getValue1()},a.DynamicInput_setValue1Pos=function(S){h!=null&&h.getDynamicInput().setValue1Pos([S.x,S.y])},a.DynamicInput_setValue2=function(S){h!=null&&h.getDynamicInput().setValue2(S)},a.DynamicInput_getValue2=function(){return h==null?"":h.getDynamicInput().getValue2()},a.DynamicInput_getFocusValue=function(){return h==null?"":h.getDynamicInput().getFocusValue()},a.DynamicInput_getFocusIndex=function(){return h==null?0:h.getDynamicInput().getFocusIndex()},a.DynamicInput_setValue2Pos=function(S){h!=null&&h.getDynamicInput().setValue2Pos([S.x,S.y])},a.DynamicInput_setShow=function(S){h!=null&&h.getDynamicInput().setShow(S)},a.DynamicInput_isShow=function(){return h!=null&&h.getDynamicInput().isShow()},a.OnMxEvent=function(S){if(h==null)return!1;h.OnMxEvent(S)},a.DynamicInput_getLockValuesMap=function(){return h==null?new Map:h.getDynamicInput().getLockValuesMap()},a.DynamicInput_clearLockValuesMap=function(){h!=null&&h.getDynamicInput().clearLockValuesMap()}},{"../MxFun":27,"../MxTools":38,"../Operate/MxCmdRunManager":48,"../Operate/MxJigCmdManager":54,three:19}],66:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.ExternalReferenceManager=o.ExternalReferenceDatabase=o.Blocks=o.Block=o.Layer=o.MxNewDisplayMemorySection=o.MxNewDisplayMemorySectionType=o.TextureData=o.BlockInstance=o.BlockRef=o.ClipPlans=o.ClipPlan=void 0;var a=w("three"),v=w("../MxShader"),h=w("./MxBrowseLayerData"),b=w("../MxManager"),D=w("../MxNetData"),U=w("../MxStencilObject"),V=w("../MxFun"),I=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0};o.ClipPlan=I;var g=function(){this.ver=4,this.id=1,this.clipPlanArray=new Array,this.clipPoints=[],this.instansClipePoints=[]};o.ClipPlans=g;var A=function(){this.ver=4,this.mat=new a.Matrix4,this.blkRecId=-1,this.blkOwnerId=0,this.layerId=-1,this.color=16777215,this.clipPlans=new g};o.BlockRef=A;var M=function(){this.mat=new a.Matrix4,this.color=new Array,this.topLayerColor=new Array,this.clipPlans=new g,this.clipMat=new a.Matrix4};o.BlockInstance=M;var N,F,T=function(){};o.TextureData=T,(F=N=o.MxNewDisplayMemorySectionType||(o.MxNewDisplayMemorySectionType={}))[F.kLinesType=1]="kLinesType",F[F.kTriangleType=2]="kTriangleType",F[F.kLinesType_Float=3]="kLinesType_Float",F[F.kTriangleType_Float=4]="kTriangleType_Float",F[F.kPointType_Float=5]="kPointType_Float",F[F.kPointType=6]="kPointType",o.MxNewDisplayMemorySection=function(){this.id=0,this.type=N.kLinesType,this.blockId=0,this.layerId=0,this.color=0,this.points=[]};var _=(Y.prototype.Show=function(c){for(var f=0,O=this._entitys.length;f<O;f++)this._entitys[f].visible=c},Y.prototype.updataClipMaterial=function(c){for(var f=this._material_clip.length,O=.5*c.width,W=.5*c.height,X=0;X<f;X++)this._material_clip[X].uniforms.vieww.value=O,this._material_clip[X].uniforms.viewh.value=W},Y.prototype.createThreejsObjForMesh_Clip=function(c,f,O){c.size!=0&&c.forEach(function(W){var X=W;if(X.length!=0){var J=[],te=[],ne=X[0].clipPlans;ne.ver<=3&&(J.push(ne.clipPlanArray[0].x1,ne.clipPlanArray[0].y1),te.push(ne.clipPlanArray[0].x2,ne.clipPlanArray[0].y2));for(var ue=[],be=[],je=[],ve=[],Be=[],q=[],ge=[],oe=0;oe<X.length;oe++){var le=X[oe];ue=ue.concat(le.mat.elements.slice(0,4)),be=be.concat(le.mat.elements.slice(4,8)),je=je.concat(le.mat.elements.slice(8,12)),ve=ve.concat(le.mat.elements.slice(12,16)),Be.push(0),q=q.concat(X[oe].color)}if(0<this._geometryMeshPositionsByBlock.length)for(oe=0;oe<X.length;oe++)q=q.concat(X[oe].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(oe=0;oe<X.length;oe++)ge=ge.concat(X[oe].topLayerColor);var Pe,Ye=.5*O.width,ze=.5*O.height;ne.ver<=3?(Pe=new a.RawShaderMaterial({uniforms:{clippt1:{value:J},clippt2:{value:te},vieww:{value:Ye},viewh:{value:ze}},vertexShader:v.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:a.DoubleSide}),this._material_clip.push(Pe)):Pe=new a.RawShaderMaterial({vertexShader:v.MxShader.VSHADER_COLOR_POINT,fragmentShader:v.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:a.DoubleSide});for(var se=0;se<this._geometryMeshPostion.length;se++)(De=new a.InstancedBufferGeometry).maxInstancedCount=X.length,De.setAttribute("position",new a.Float32BufferAttribute(this._geometryMeshPostion[se],2)),De.setAttribute("color",new a.Float32BufferAttribute(this._geometryMeshColor[se],3)),De.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(ue),4)),De.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(be),4)),De.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(je),4)),De.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(ve),4)),De.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(Be),1)),(tt=new a.Mesh(De,Pe)).frustumCulled=!1,tt.renderOrder=b.MxData.iCADMeshRenderOrder,f.add(tt),this._entitys.push(tt),4<=ne.ver&&0<ne.instansClipePoints.length&&new U.MxStencilObject().associateObject(tt,ne.instansClipePoints);for(se=0;se<this._geometryMeshPositionsByBlock.length;se++)(De=new a.InstancedBufferGeometry).maxInstancedCount=X.length,De.setAttribute("position",new a.Float32BufferAttribute(this._geometryMeshPositionsByBlock[se],2)),De.setAttribute("color",new a.InstancedBufferAttribute(new Float32Array(q),3)),De.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(ue),4)),De.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(be),4)),De.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(je),4)),De.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(ve),4)),De.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(Be),1)),(tt=new a.Mesh(De,Pe)).frustumCulled=!1,tt.renderOrder=b.MxData.iCADMeshRenderOrder,f.add(tt),this._entitys.push(tt),4<=ne.ver&&0<ne.instansClipePoints.length&&new U.MxStencilObject().associateObject(tt,ne.instansClipePoints);for(se=0;se<this._geometryMeshPositionsByBlock_ZeroLayer.length;se++)(De=new a.InstancedBufferGeometry).maxInstancedCount=X.length,De.setAttribute("position",new a.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[se],2)),De.setAttribute("color",new a.InstancedBufferAttribute(new Float32Array(ge),3)),De.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(ue),4)),De.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(be),4)),De.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(je),4)),De.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(ve),4)),De.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(Be),1)),(tt=new a.Mesh(De,Pe)).frustumCulled=!1,tt.renderOrder=b.MxData.iCADMeshRenderOrder,f.add(tt),this._entitys.push(tt),4<=ne.ver&&0<ne.instansClipePoints.length&&new U.MxStencilObject().associateObject(tt,ne.instansClipePoints);var xe=new a.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:J},clippt2:{value:te},vieww:{value:Ye},viewh:{value:ze}},vertexShader:v.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:a.DoubleSide});for(this._material_clip.push(xe),se=0;se<this._geometryMeshPositionsByLayer.length;se++){var De,tt;(De=new a.InstancedBufferGeometry).maxInstancedCount=X.length,De.setAttribute("position",new a.Float32BufferAttribute(this._geometryMeshPositionsByLayer[se],2)),De.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(ue),4)),De.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(be),4)),De.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(je),4)),De.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(ve),4)),De.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(Be),1)),(tt=new a.Mesh(De,xe)).frustumCulled=!1,tt.renderOrder=b.MxData.iCADMeshRenderOrder,f.add(tt),this._entitys.push(tt),4<=ne.ver&&0<ne.instansClipePoints.length&&new U.MxStencilObject().associateObject(tt,ne.instansClipePoints)}}},this)},Y.prototype.createThreejsObjForCurve_Clip=function(c,f,O){c.size!=0&&c.forEach(function(W,X,J){var te=W;if(te.length!=0){var ne=[],ue=[],be=te[0].clipPlans;be.ver<=3&&(ne.push(be.clipPlanArray[0].x1,be.clipPlanArray[0].y1),ue.push(be.clipPlanArray[0].x2,be.clipPlanArray[0].y2));for(var je=[],ve=[],Be=[],q=[],ge=[],oe=[],le=[],Pe=0;Pe<te.length;Pe++){var Ye=te[Pe];je=je.concat(Ye.mat.elements.slice(0,4)),ve=ve.concat(Ye.mat.elements.slice(4,8)),Be=Be.concat(Ye.mat.elements.slice(8,12)),q=q.concat(Ye.mat.elements.slice(12,16)),ge.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(Pe=0;Pe<te.length;Pe++)oe=oe.concat(te[Pe].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(Pe=0;Pe<te.length;Pe++)le=le.concat(te[Pe].topLayerColor);var ze,se=.5*O.width,xe=.5*O.height;be.ver<=3?(ze=new a.RawShaderMaterial({uniforms:{clippt1:{value:ne},clippt2:{value:ue},vieww:{value:se},viewh:{value:xe}},vertexShader:v.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:a.DoubleSide}),this._material_clip.push(ze)):ze=new a.RawShaderMaterial({vertexShader:v.MxShader.VSHADER_COLOR_POINT,fragmentShader:v.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:a.DoubleSide});for(var De=0;De<this._geometryCurvePostion.length;De++)(st=new a.InstancedBufferGeometry).maxInstancedCount=te.length,st.setAttribute("position",new a.Float32BufferAttribute(this._geometryCurvePostion[De],2)),st.setAttribute("color",new a.Float32BufferAttribute(this._geometryCurveColor[De],3)),st.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(je),4)),st.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(ve),4)),st.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(Be),4)),st.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(q),4)),st.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(ge),1)),(mt=new a.LineSegments(st,ze)).frustumCulled=!1,mt.renderOrder=b.MxData.iCADCurveRenderOrder,f.add(mt),this._entitys.push(mt),4<=be.ver&&0<be.instansClipePoints.length&&new U.MxStencilObject().associateObject(mt,be.instansClipePoints);for(De=0;De<this._geometryCurvePositionsByBlock.length;De++)(st=new a.InstancedBufferGeometry).maxInstancedCount=te.length,st.setAttribute("position",new a.Float32BufferAttribute(this._geometryCurvePositionsByBlock[De],2)),st.setAttribute("color",new a.InstancedBufferAttribute(new Float32Array(oe),3)),st.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(je),4)),st.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(ve),4)),st.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(Be),4)),st.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(q),4)),st.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(ge),1)),(mt=new a.LineSegments(st,ze)).frustumCulled=!1,mt.renderOrder=b.MxData.iCADCurveRenderOrder,f.add(mt),this._entitys.push(mt),4<=be.ver&&0<be.instansClipePoints.length&&new U.MxStencilObject().associateObject(mt,be.instansClipePoints);for(De=0;De<this._geometryCurvePositionsByBlock_ZeroLayer.length;De++)(st=new a.InstancedBufferGeometry).maxInstancedCount=te.length,st.setAttribute("position",new a.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[De],2)),st.setAttribute("color",new a.InstancedBufferAttribute(new Float32Array(le),3)),st.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(je),4)),st.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(ve),4)),st.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(Be),4)),st.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(q),4)),st.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(ge),1)),(mt=new a.LineSegments(st,ze)).frustumCulled=!1,mt.renderOrder=b.MxData.iCADCurveRenderOrder,f.add(mt),this._entitys.push(mt),4<=be.ver&&0<be.instansClipePoints.length&&new U.MxStencilObject().associateObject(mt,be.instansClipePoints);var tt=new a.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:ne},clippt2:{value:ue},vieww:{value:se},viewh:{value:xe}},vertexShader:v.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:a.DoubleSide});for(this._material_clip.push(tt),De=0;De<this._geometryCurvePositionsByLayer.length;De++){var st,mt;(st=new a.InstancedBufferGeometry).maxInstancedCount=te.length,st.setAttribute("position",new a.Float32BufferAttribute(this._geometryCurvePositionsByLayer[De],2)),st.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(je),4)),st.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(ve),4)),st.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(Be),4)),st.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(q),4)),st.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(ge),1)),(mt=new a.LineSegments(st,tt)).frustumCulled=!1,mt.renderOrder=b.MxData.iCADCurveRenderOrder,f.add(mt),this._entitys.push(mt),4<=be.ver&&0<be.instansClipePoints.length&&new U.MxStencilObject().associateObject(mt,be.instansClipePoints)}}},this)},Y.prototype.createThreejsObjForCurve=function(c,f){if(c.length!=0){for(var O=[],W=[],X=[],J=[],te=[],ne=[],ue=[],be=0;be<c.length;be++){var je=c[be];O=O.concat(je.mat.elements.slice(0,4)),W=W.concat(je.mat.elements.slice(4,8)),X=X.concat(je.mat.elements.slice(8,12)),J=J.concat(je.mat.elements.slice(12,16)),te.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(be=0;be<c.length;be++)ne=ne.concat(c[be].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(be=0;be<c.length;be++)ue=ue.concat(c[be].topLayerColor);for(var ve=new a.RawShaderMaterial({vertexShader:v.MxShader.VSHADER_COLOR_POINT,fragmentShader:v.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:a.DoubleSide}),Be=0;Be<this._geometryCurvePostion.length;Be++)(ge=new a.InstancedBufferGeometry).maxInstancedCount=c.length,ge.setAttribute("position",new a.Float32BufferAttribute(this._geometryCurvePostion[Be],2)),ge.setAttribute("color",new a.Float32BufferAttribute(this._geometryCurveColor[Be],3)),ge.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(O),4)),ge.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(W),4)),ge.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(X),4)),ge.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(J),4)),ge.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(te),1)),(oe=new a.LineSegments(ge,ve)).frustumCulled=!1,oe.renderOrder=b.MxData.iCADCurveRenderOrder,f.add(oe),this._entitys.push(oe);for(Be=0;Be<this._geometryCurvePositionsByBlock.length;Be++)(ge=new a.InstancedBufferGeometry).maxInstancedCount=c.length,ge.setAttribute("position",new a.Float32BufferAttribute(this._geometryCurvePositionsByBlock[Be],2)),ge.setAttribute("color",new a.InstancedBufferAttribute(new Float32Array(ne),3)),ge.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(O),4)),ge.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(W),4)),ge.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(X),4)),ge.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(J),4)),ge.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(te),1)),(oe=new a.LineSegments(ge,ve)).frustumCulled=!1,oe.renderOrder=b.MxData.iCADCurveRenderOrder,f.add(oe),this._entitys.push(oe);for(Be=0;Be<this._geometryCurvePositionsByBlock_ZeroLayer.length;Be++)(ge=new a.InstancedBufferGeometry).maxInstancedCount=c.length,ge.setAttribute("position",new a.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[Be],2)),ge.setAttribute("color",new a.InstancedBufferAttribute(new Float32Array(ue),3)),ge.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(O),4)),ge.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(W),4)),ge.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(X),4)),ge.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(J),4)),ge.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(te),1)),(oe=new a.LineSegments(ge,ve)).frustumCulled=!1,oe.renderOrder=b.MxData.iCADCurveRenderOrder,f.add(oe),this._entitys.push(oe);var q=new a.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:v.MxShader.VSHADER_COLOR_POINT_BYLAYER,fragmentShader:v.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:a.DoubleSide});for(Be=0;Be<this._geometryCurvePositionsByLayer.length;Be++){var ge,oe;(ge=new a.InstancedBufferGeometry).maxInstancedCount=c.length,ge.setAttribute("position",new a.Float32BufferAttribute(this._geometryCurvePositionsByLayer[Be],2)),ge.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(O),4)),ge.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(W),4)),ge.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(X),4)),ge.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(J),4)),ge.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(te),1)),(oe=new a.LineSegments(ge,q)).frustumCulled=!1,oe.renderOrder=b.MxData.iCADCurveRenderOrder,f.add(oe),this._entitys.push(oe)}}},Y.prototype.createThreejsObjForMemorySections_clip=function(c,f,O){c.size!=0&&c.forEach(function(W){var X=W;if(X.length!=0){for(var J=X[0].clipPlans,te=[],ne=[],ue=[],be=[],je=[],ve=0;ve<X.length;ve++){var Be=X[ve];te.push.apply(te,Be.mat.elements.slice(0,4)),ne.push.apply(ne,Be.mat.elements.slice(4,8)),ue.push.apply(ue,Be.mat.elements.slice(8,12)),be.push.apply(be,Be.mat.elements.slice(12,16)),je.push(0)}for(var q=this._MemorySections.length,ge=0;ge<q;ge++){var oe=this._MemorySections[ge],le=O.automaticInversionColor2(oe.color),Pe=[];if((4278190080&le)==16777216?Pe=this._color:Pe.push((255&le)/255,(le>>8&255)/255,(le>>16&255)/255),oe.type==N.kLinesType){var Ye=new a.RawShaderMaterial({uniforms:{color:{value:Pe}},vertexShader:v.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:a.DoubleSide});(se=new a.InstancedBufferGeometry).maxInstancedCount=X.length,se.setAttribute("position",new a.Float32BufferAttribute(oe.points,3)),se.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(te),4)),se.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(ne),4)),se.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(ue),4)),se.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(be),4)),se.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(je),1)),(xe=new a.LineSegments(se,Ye)).frustumCulled=!1,xe.renderOrder=b.MxData.iCADCurveRenderOrder,4<=J.ver&&0<J.instansClipePoints.length&&new U.MxStencilObject().associateObject(xe,J.instansClipePoints),f.add(xe),this._entitys.push(xe)}else if(oe.type==N.kTriangleType){Ye=new a.RawShaderMaterial({uniforms:{color:{value:Pe}},vertexShader:v.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:a.DoubleSide}),(se=new a.InstancedBufferGeometry).maxInstancedCount=X.length,se.setAttribute("position",new a.Float32BufferAttribute(oe.points,3)),se.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(te),4)),se.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(ne),4)),se.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(ue),4)),se.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(be),4)),se.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(je),1));var ze=new a.Mesh(se,Ye);ze.frustumCulled=!1,ze.renderOrder=b.MxData.iCADMeshRenderOrder,4<=J.ver&&0<J.instansClipePoints.length&&new U.MxStencilObject().associateObject(ze,J.instansClipePoints),f.add(ze),this._entitys.push(ze)}else if(oe.type==N.kPointType){var se,xe;Ye=new a.RawShaderMaterial({uniforms:{color:{value:Pe}},vertexShader:v.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:a.DoubleSide}),(se=new a.InstancedBufferGeometry).maxInstancedCount=X.length,se.setAttribute("position",new a.Float32BufferAttribute(oe.points,3)),se.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(te),4)),se.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(ne),4)),se.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(ue),4)),se.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(be),4)),se.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(je),1)),(xe=new a.Points(se,Ye)).frustumCulled=!1,xe.renderOrder=b.MxData.iCADCurveRenderOrder,4<=J.ver&&0<J.instansClipePoints.length&&new U.MxStencilObject().associateObject(xe,J.instansClipePoints),f.add(xe),this._entitys.push(xe)}}}},this)},Y.prototype.createThreejsObjForMemorySections=function(c,f,O){if(c.length!=0){for(var W=[],X=[],J=[],te=[],ne=[],ue=0;ue<c.length;ue++){var be=c[ue];W.push.apply(W,be.mat.elements.slice(0,4)),X.push.apply(X,be.mat.elements.slice(4,8)),J.push.apply(J,be.mat.elements.slice(8,12)),te.push.apply(te,be.mat.elements.slice(12,16)),ne.push(0)}for(var je=this._MemorySections.length,ve=0;ve<je;ve++){var Be=this._MemorySections[ve],q=O.automaticInversionColor2(Be.color),ge=[];if((4278190080&q)==16777216?(ge=this._color,this._colorValue):ge.push((255&q)/255,(q>>8&255)/255,(q>>16&255)/255),Be.type==N.kLinesType){var oe=new a.RawShaderMaterial({uniforms:{color:{value:ge}},vertexShader:v.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:a.DoubleSide});(Pe=new a.InstancedBufferGeometry).maxInstancedCount=c.length,Pe.setAttribute("position",new a.Float32BufferAttribute(Be.points,3)),Pe.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(W),4)),Pe.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(X),4)),Pe.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(J),4)),Pe.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(te),4)),Pe.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(ne),1)),(Ye=new a.LineSegments(Pe,oe)).frustumCulled=!1,Ye.renderOrder=b.MxData.iCADCurveRenderOrder,f.add(Ye),this._entitys.push(Ye)}else if(Be.type==N.kTriangleType){oe=new a.RawShaderMaterial({uniforms:{color:{value:ge}},vertexShader:v.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:a.DoubleSide}),(Pe=new a.InstancedBufferGeometry).maxInstancedCount=c.length,Pe.setAttribute("position",new a.Float32BufferAttribute(Be.points,3)),Pe.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(W),4)),Pe.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(X),4)),Pe.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(J),4)),Pe.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(te),4)),Pe.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(ne),1));var le=new a.Mesh(Pe,oe);le.frustumCulled=!1,le.renderOrder=b.MxData.iCADMeshRenderOrder,f.add(le),this._entitys.push(le)}else if(Be.type==N.kPointType){var Pe,Ye;oe=new a.RawShaderMaterial({uniforms:{color:{value:ge},size:1},vertexShader:v.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:a.DoubleSide}),(Pe=new a.InstancedBufferGeometry).maxInstancedCount=c.length,Pe.setAttribute("position",new a.Float32BufferAttribute(Be.points,3)),Pe.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(W),4)),Pe.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(X),4)),Pe.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(J),4)),Pe.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(te),4)),Pe.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(ne),1)),(Ye=new a.Points(Pe,oe)).frustumCulled=!1,Ye.renderOrder=b.MxData.iCADCurveRenderOrder,f.add(Ye),this._entitys.push(Ye)}}}},Y.prototype.createThreejsObjForTexture=function(c,f,O){if(c.length!=0){var W=[],X=[],J=[],te=[],ne=[],ue=O.getCurrentLoadUrl(),be=V.MxFun.dwgDir();be.length!=0&&ue.substring(ue.lastIndexOf("/buf/")).toLowerCase()!="/buf/"&&(ue=ue+be+"/buf/");for(var je=0;je<c.length;je++){var ve=c[je];W=W.concat(ve.mat.elements.slice(0,4)),X=X.concat(ve.mat.elements.slice(4,8)),J=J.concat(ve.mat.elements.slice(8,12)),te=te.concat(ve.mat.elements.slice(12,16)),ne.push(0)}for(var Be=0;Be<this._TextureData.length;Be++){var q=this._TextureData[Be],ge=new a.InstancedBufferGeometry;ge.maxInstancedCount=c.length,ge.setAttribute("position",new a.Float32BufferAttribute(q.pos,2)),ge.setAttribute("uv",new a.Float32BufferAttribute(q.textureCoord,2)),ge.setAttribute("color",new a.Float32BufferAttribute(q.color,3)),ge.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(W),4)),ge.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(X),4)),ge.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(J),4)),ge.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(te),4)),ge.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(ne),1));var oe=ue+q.sFileName,le={texture:{value:new a.TextureLoader().load(oe,function(ze){ze&&O.updateDisplay()})}};le.texture.value.wrapS=le.texture.value.wrapT=a.RepeatWrapping;var Pe=new a.RawShaderMaterial({uniforms:le,vertexShader:v.MxShader.VSHADER_COLOR_POINT_TEXTURE,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_TEXTURE,transparent:!0,side:a.DoubleSide}),Ye=new a.Mesh(ge,Pe);Ye.renderOrder=b.MxData.iCADMeshRenderOrder,Ye.frustumCulled=!1,f.add(Ye),this._entitys.push(Ye)}}},Y.prototype.createThreejsObjForTexture_Clip=function(c,f,O){if(c.size!=0){var W=O.getCurrentLoadUrl(),X=V.MxFun.dwgDir();X.length!=0&&W.substring(W.lastIndexOf("/buf/")).toLowerCase()!="/buf/"&&(W=W+X+"/buf/"),c.forEach(function(J){var te=J;if(te.length!=0){for(var ne=te[0].clipPlans,ue=[],be=[],je=[],ve=[],Be=[],q=0;q<te.length;q++){var ge=te[q];ue=ue.concat(ge.mat.elements.slice(0,4)),be=be.concat(ge.mat.elements.slice(4,8)),je=je.concat(ge.mat.elements.slice(8,12)),ve=ve.concat(ge.mat.elements.slice(12,16)),Be.push(0)}for(var oe=0;oe<this._TextureData.length;oe++){var le=this._TextureData[oe],Pe=new a.InstancedBufferGeometry;Pe.maxInstancedCount=te.length,Pe.setAttribute("position",new a.Float32BufferAttribute(le.pos,2)),Pe.setAttribute("uv",new a.Float32BufferAttribute(le.textureCoord,2)),Pe.setAttribute("color",new a.Float32BufferAttribute(le.color,3)),Pe.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(ue),4)),Pe.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(be),4)),Pe.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(je),4)),Pe.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(ve),4)),Pe.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(Be),1));var Ye=W+le.sFileName,ze={texture:{value:new a.TextureLoader().load(Ye,function(De){De&&O.updateDisplay()})}};ze.texture.value.wrapS=ze.texture.value.wrapT=a.RepeatWrapping;var se=new a.RawShaderMaterial({uniforms:ze,vertexShader:v.MxShader.VSHADER_COLOR_POINT_TEXTURE,fragmentShader:v.MxShader.FSHADER_COLOR_POINT_TEXTURE,transparent:!0,side:a.DoubleSide}),xe=new a.Mesh(Pe,se);xe.renderOrder=b.MxData.iCADMeshRenderOrder,xe.frustumCulled=!1,4<=ne.ver&&0<ne.instansClipePoints.length&&new U.MxStencilObject().associateObject(xe,ne.instansClipePoints),f.add(xe),this._entitys.push(xe)}}},this)}},Y.prototype.createThreejsObjForMesh=function(c,f){if(c.length!=0){for(var O=[],W=[],X=[],J=[],te=[],ne=[],ue=[],be=0;be<c.length;be++){var je=c[be];O=O.concat(je.mat.elements.slice(0,4)),W=W.concat(je.mat.elements.slice(4,8)),X=X.concat(je.mat.elements.slice(8,12)),J=J.concat(je.mat.elements.slice(12,16)),te.push(0),ne=ne.concat(c[be].color)}if(0<this._geometryMeshPositionsByBlock.length)for(be=0;be<c.length;be++)ne=ne.concat(c[be].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(be=0;be<c.length;be++)ue=ue.concat(c[be].topLayerColor);for(var ve=new a.RawShaderMaterial({vertexShader:v.MxShader.VSHADER_COLOR_POINT,fragmentShader:v.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:a.DoubleSide}),Be=0;Be<this._geometryMeshPostion.length;Be++)(ge=new a.InstancedBufferGeometry).maxInstancedCount=c.length,ge.setAttribute("position",new a.Float32BufferAttribute(this._geometryMeshPostion[Be],2)),ge.setAttribute("color",new a.Float32BufferAttribute(this._geometryMeshColor[Be],3)),ge.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(O),4)),ge.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(W),4)),ge.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(X),4)),ge.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(J),4)),ge.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(te),1)),(oe=new a.Mesh(ge,ve)).frustumCulled=!1,oe.renderOrder=b.MxData.iCADMeshRenderOrder,f.add(oe),this._entitys.push(oe);for(Be=0;Be<this._geometryMeshPositionsByBlock.length;Be++)(ge=new a.InstancedBufferGeometry).maxInstancedCount=c.length,ge.setAttribute("position",new a.Float32BufferAttribute(this._geometryMeshPositionsByBlock[Be],2)),ge.setAttribute("color",new a.InstancedBufferAttribute(new Float32Array(ne),3)),ge.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(O),4)),ge.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(W),4)),ge.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(X),4)),ge.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(J),4)),ge.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(te),1)),(oe=new a.Mesh(ge,ve)).frustumCulled=!1,oe.renderOrder=b.MxData.iCADMeshRenderOrder,f.add(oe),this._entitys.push(oe);for(Be=0;Be<this._geometryMeshPositionsByBlock_ZeroLayer.length;Be++)(ge=new a.InstancedBufferGeometry).maxInstancedCount=c.length,ge.setAttribute("position",new a.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[Be],2)),ge.setAttribute("color",new a.InstancedBufferAttribute(new Float32Array(ue),3)),ge.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(O),4)),ge.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(W),4)),ge.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(X),4)),ge.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(J),4)),ge.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(te),1)),(oe=new a.Mesh(ge,ve)).frustumCulled=!1,oe.renderOrder=b.MxData.iCADMeshRenderOrder,f.add(oe),this._entitys.push(oe);var q=new a.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:v.MxShader.VSHADER_COLOR_POINT,fragmentShader:v.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:a.DoubleSide});for(Be=0;Be<this._geometryMeshPositionsByLayer.length;Be++){var ge,oe;(ge=new a.InstancedBufferGeometry).maxInstancedCount=c.length,ge.setAttribute("position",new a.Float32BufferAttribute(this._geometryMeshPositionsByLayer[Be],2)),ge.setAttribute("tran1",new a.InstancedBufferAttribute(new Float32Array(O),4)),ge.setAttribute("tran2",new a.InstancedBufferAttribute(new Float32Array(W),4)),ge.setAttribute("tran3",new a.InstancedBufferAttribute(new Float32Array(X),4)),ge.setAttribute("tran4",new a.InstancedBufferAttribute(new Float32Array(J),4)),ge.setAttribute("ishide",new a.InstancedBufferAttribute(new Float32Array(te),1)),(oe=new a.Mesh(ge,q)).frustumCulled=!1,oe.renderOrder=b.MxData.iCADMeshRenderOrder,f.add(oe),this._entitys.push(oe)}}},Y.prototype.addGeometryCurve=function(c,f,O,W,X){0<c.length&&(this._geometryCurvePostion.push(c),this._geometryCurveColor.push(f)),0<O.length&&this._geometryCurvePositionsByBlock.push(O),0<W.length&&this._geometryCurvePositionsByLayer.push(W),0<X.length&&this._geometryCurvePositionsByBlock_ZeroLayer.push(X)},Y.prototype.addGeometryMesh=function(c,f,O,W,X){0<c.length&&(this._geometryMeshPostion.push(c),this._geometryMeshColor.push(f)),0<O.length&&this._geometryMeshPositionsByBlock.push(O),0<W.length&&this._geometryMeshPositionsByLayer.push(W),0<X.length&&this._geometryMeshPositionsByBlock_ZeroLayer.push(X)},Y.prototype.addGeometryTexture=function(c,f,O,W,X,J,te){var ne=new T;ne.pos=c,ne.textureCoord=f,ne.color=O,ne.sFileName=W,ne.dAngel=X,ne.ptRotationPostionX=J,ne.ptRotationPostionY=te,this._TextureData.push(ne)},Y.prototype.addMemorySections=function(c){this._MemorySections.push(c)},Y.prototype.createThreejsObj=function(c,f,O,W,X){var J=O.getScene(),te=O.getCanvas();if(c.length!=0){if(this._color==null){var ne=W.getColor(X);this._color=[],this._color.push((255&ne)/255,(ne>>8&255)/255,(ne>>16&255)/255),this._colorValue=16777215&ne}this._geometryCurvePostion.length==0&&this._geometryCurvePositionsByBlock.length==0&&this._geometryCurvePositionsByLayer.length==0&&this._geometryCurvePositionsByBlock_ZeroLayer.length==0||this.createThreejsObjForCurve(c,J),this._geometryMeshPostion.length==0&&this._geometryMeshPositionsByBlock.length==0&&this._geometryMeshPositionsByLayer.length==0&&this._geometryMeshPositionsByBlock_ZeroLayer.length==0||this.createThreejsObjForMesh(c,J),this._TextureData.length!=0&&this.createThreejsObjForTexture(c,J,O),this._MemorySections.length!=0&&this.createThreejsObjForMemorySections(c,J,O)}f.size!=0&&(this._color==null&&(ne=W.getColor(X),this._color=[],this._color.push((255&ne)/255,(ne>>8&255)/255,(ne>>16&255)/255),this._colorValue=16777215&ne),this._geometryCurvePostion.length==0&&this._geometryCurvePositionsByBlock.length==0&&this._geometryCurvePositionsByLayer.length==0&&this._geometryCurvePositionsByBlock_ZeroLayer.length==0||this.createThreejsObjForCurve_Clip(f,J,te),this._geometryMeshPostion.length==0&&this._geometryMeshPositionsByBlock.length==0&&this._geometryMeshPositionsByLayer.length==0&&this._geometryMeshPositionsByBlock_ZeroLayer.length==0||this.createThreejsObjForMesh_Clip(f,J,te),this._TextureData.length!=0&&this.createThreejsObjForTexture_Clip(f,J,O),this._MemorySections.length!=0&&this.createThreejsObjForMemorySections_clip(f,J,O)),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=[]},Y);function Y(c){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=c}o.Layer=_;var k=(S.prototype.showLayer=function(c,f){var O=this._layerTogeometry.get(c);O!=null&&O.Show(f)},S.prototype.updataClipMaterial=function(c){var f=c.getCanvas();this._layerTogeometry.forEach(function(O,W,X){O.updataClipMaterial(f)})},S.prototype.getId=function(){return this._id},S.prototype.getBlkRef=function(){return this._blkRef},S.prototype.createThreejsObj=function(c,f){var O=this;this._layerTogeometry.forEach(function(W,X,J){W.createThreejsObj(O._instance,O._instance_clip,c,f,X)})},S.prototype.addGeometryCurve=function(c,f,O,W,X,J){var te=this._layerTogeometry.get(O);te==null&&(te=new _(this._id),this._layerTogeometry.set(O,te)),te.addGeometryCurve(c,f,W,X,J)},S.prototype.addMemorySections=function(c){var f=this._layerTogeometry.get(c.layerId);f==null&&(f=new _(this._id),this._layerTogeometry.set(c.layerId,f)),f.addMemorySections(c)},S.prototype.addGeometryTexture=function(c,f,O,W,X,J,te,ne){var ue=this._layerTogeometry.get(W);ue==null&&(ue=new _(this._id),this._layerTogeometry.set(W,ue)),ue.addGeometryTexture(c,f,O,X,J,te,ne)},S.prototype.addGeometryMesh=function(c,f,O,W,X,J){var te=this._layerTogeometry.get(O);te==null&&(te=new _(this._id),this._layerTogeometry.set(O,te)),te.addGeometryMesh(c,f,W,X,J)},S.prototype.addInstance=function(c){var f;c.clipPlans.ver<=3?c.clipPlans.clipPlanArray.length==0?this._instance.length<5e4&&this._instance.push(c):((f=this._instance_clip.get(c.clipPlans.id))==null&&(f=[],this._instance_clip.set(c.clipPlans.id,f)),f.push(c)):c.clipPlans.instansClipePoints.length==0||100<this._instance_clip.size?this._instance.length<5e4&&this._instance.push(c):((f=this._instance_clip.get(c.clipPlans.id))==null&&(f=[],this._instance_clip.set(c.clipPlans.id,f)),f.push(c))},S.prototype.addBlkRef=function(c){this._blkRef.push(c)},S);function S(c){this._id=0,this._layerTogeometry=new Map,this._blkRef=[],this._instance=[],this._instance_clip=new Map,this._id=c}o.Block=k;var G=(C.prototype.crateBlock=function(c){var f=this._mapBlock.get(c);return f==null&&(f=new k(c),this._mapBlock.set(c,f)),f},C.prototype.getBlock=function(c){return this._mapBlock.get(c)},C.prototype.addBlockRef=function(c){this.crateBlock(c.blkOwnerId).addBlkRef(c)},C.prototype.showLayer=function(c,f){this._mapBlock.forEach(function(O,W){var X=O,J=W;return function(te,ne,ue){te.showLayer(X,J)}}.call(this,c,f))},C.prototype.createBlocks_30=function(c,f){if(!this._isCreate){this.crateBlock(0);for(var O=1,W=c.getInt32(12,!0),X=80,J=0;J<W;J++){var te=c.getInt32(X,!0);X+=4;var ne=c.getInt32(X,!0);X+=4;var ue=c.getInt32(X,!0);X+=4;var be=c.getInt32(X,!0);X+=4;for(var je=new Array,ve=0;ve<16;ve++){var Be=c.getFloat32(X,!0);X+=4,je.push(Be)}var q=c.getInt32(X,!0);X+=4;var ge=new g;ge.id=O,ge.ver=3,O++,ge.clipPlanArray=[];for(var oe=0;oe<q;oe++){var le=c.getFloat32(X,!0);X+=4;var Pe=c.getFloat32(X,!0);X+=4;var Ye=c.getFloat32(X,!0);X+=4;var ze=c.getFloat32(X,!0);X+=4;var se=new I;se.x1=le,se.y1=Pe,se.x2=Ye,se.y2=ze,ge.clipPlanArray.push(se)}var xe=new A;xe.ver=3,xe.mat=new a.Matrix4,xe.mat.fromArray(je),xe.blkRecId=ue,xe.blkOwnerId=te,xe.layerId=ne,xe.color=be,xe.clipPlans=ge,this.crateBlock(ue),this.addBlockRef(xe)}this._isGetAllBlocks=!0,this._isCreate=!0}},C.prototype.createBlocks_40=function(c,f){if(!this._isCreate){this.crateBlock(0);for(var O=1,W=c.getInt32(12,!0),X=80,J=0;J<W;J++){var te=c.getInt32(X,!0);X+=4;var ne=c.getInt32(X,!0);X+=4;var ue=c.getInt32(X,!0);X+=4;var be=c.getInt32(X,!0);X+=4;for(var je=new Array,ve=0;ve<16;ve++){var Be=c.getFloat32(X,!0);X+=4,je.push(Be)}var q=c.getInt32(X,!0);X+=4;var ge=new g;ge.id=O,ge.ver=4,O++,ge.clipPoints=[];for(var oe=0;oe<q;oe++){var le=new a.Vector2;le.x=c.getFloat32(X,!0),X+=4,le.y=c.getFloat32(X,!0),X+=4,ge.clipPoints.push(le)}var Pe=new A;Pe.ver=4,Pe.mat=new a.Matrix4,Pe.mat.fromArray(je),Pe.blkRecId=ue,Pe.blkOwnerId=te,Pe.layerId=ne,Pe.color=be,Pe.clipPlans=ge,this.crateBlock(ue),this.addBlockRef(Pe)}this._isGetAllBlocks=!0,this._isCreate=!0}},C.prototype.createBlocks=function(c,f){this._isCreate||(new D.MxNetData(c).getVersion_MwBlobHead()<=3?this.createBlocks_30(c,f):this.createBlocks_40(c,f))},C.prototype.updataClipMaterial=function(c){this._mapBlock.forEach(function(f,O,W){f.updataClipMaterial(c)})},C.prototype.createAllInstance=function(c){var f=this.getBlock(0);if(f==null||this._rootBlockRef==null)return!1;var O=new a.Matrix4,W=new Map,X=new g;return this._iClipIdCount=1,X.id=this._iClipIdCount,this._iClipIdCount++,this.createAllInstanceCall(f,this._rootBlockRef,O,W,16777215,c,void 0,X),!0},C.prototype.createThreejsObj=function(c,f,O){this._mapNeedCreateThreejsObj.get(c.getId())==null&&this._mapNeedCreateThreejsObj.set(c.getId(),c),this._isCreateAllInstance||this._isGetAllBlocks&&O.isInitComplete()&&(this._isCreateAllInstance=this.createAllInstance(O)),this._isCreateAllInstance&&(this._mapNeedCreateThreejsObj.forEach(function(W,X,J){W.createThreejsObj(f,O)}),this._mapNeedCreateThreejsObj.clear())},C.prototype.createAllInstanceCall=function(c,f,O,W,X,J,te,ne){if(W[c.getId()]!=1){W[c.getId()]=!0;var ue=new M;if(ue.mat=new a.Matrix4,ue.mat.copy(O),ue.mat.multiply(f.mat),f.ver<=3)if(f.clipPlans.clipPlanArray.length==0)ue.clipPlans=ne;else{ue.clipPlans=f.clipPlans,ue.clipPlans.ver=3;for(var be,je,ve,Be,q=ue.clipPlans.clipPlanArray.length,ge=function(){be=new a.Vector3(ue.clipPlans.clipPlanArray[oe].x1,ue.clipPlans.clipPlanArray[oe].y1,0),je=new a.Vector3(ue.clipPlans.clipPlanArray[oe].x2,ue.clipPlans.clipPlanArray[oe].y2,0),ve=new a.Vector3(ue.clipPlans.clipPlanArray[oe].x1,ue.clipPlans.clipPlanArray[oe].y2,0),Be=new a.Vector3(ue.clipPlans.clipPlanArray[oe].x2,ue.clipPlans.clipPlanArray[oe].y1,0),be.applyMatrix4(ue.mat),je.applyMatrix4(ue.mat),ve.applyMatrix4(ue.mat),Be.applyMatrix4(ue.mat);var mt=be.x,Rt=be.x,Ot=be.y,He=be.y,Vt=[];Vt.push(je),Vt.push(ve),Vt.push(Be),Vt.forEach(function(jt){mt>jt.x&&(mt=jt.x),Rt<jt.x&&(Rt=jt.x),Ot>jt.y&&(Ot=jt.y),He<jt.y&&(He=jt.y)}),ue.clipPlans.clipPlanArray[oe].x1=mt,ue.clipPlans.clipPlanArray[oe].y1=Ot,ue.clipPlans.clipPlanArray[oe].x2=Rt,ue.clipPlans.clipPlanArray[oe].y2=He},oe=0;oe<q;oe++)ge()}else if(f.clipPlans.clipPoints.length==0)ue.clipPlans=ne;else{ue.clipPlans=new g,ue.clipPlans.ver=4,ue.clipPlans.id=this._iClipIdCount,this._iClipIdCount++,ue.clipPlans.instansClipePoints=ne.instansClipePoints.slice(0);var le=[],Pe=f.clipPlans.clipPoints;for(q=Pe.length,oe=0;oe<q;oe++){var Ye=new a.Vector3(Pe[oe].x,Pe[oe].y,0);Ye.applyMatrix4(ue.mat),le.push(new a.Vector2(Ye.x,Ye.y))}ue.clipPlans.instansClipePoints.push(le)}te==null?ue.topLayerColor.push(1,1,1):ue.topLayerColor.push(te[0],te[1],te[2]);var ze=f.color>>24&255;if(ze==2)ue.color.push((255&X)/255,(X>>8&255)/255,(X>>16&255)/255);else if(ze==1){var se=J.getColor(f.layerId);ue.color.push((255&se)/255,(se>>8&255)/255,(se>>16&255)/255),X=se}else ue.color.push((255&f.color)/255,(f.color>>8&255)/255,(f.color>>16&255)/255),X=f.color;c.addInstance(ue);for(var xe=c.getBlkRef(),De=te==null,tt=0;tt<xe.length;tt++)if(xe[tt].blkRecId!=0){var st=this.getBlock(xe[tt].blkRecId);if(st==null)return;De&&(te=[],se=J.getColor(xe[tt].layerId),te.push((255&se)/255,(se>>8&255)/255,(se>>16&255)/255)),this.createAllInstanceCall(st,xe[tt],ue.mat,W,X,J,te,ue.clipPlans)}W[c.getId()]=!1}},C.prototype.initRootBlockRef=function(c){c==null&&((c=new A).mat=new a.Matrix4,c.blkRecId=0,c.blkOwnerId=-1,c.layerId=-1,c.color=16777215),this._rootBlockRef=c},C);function C(){this._mapBlock=new Map,this._mapNeedCreateThreejsObj=new Map,this._isCreate=!1,this._isGetAllBlocks=!1,this._isCreateAllInstance=!1,this._rootBlockRef=void 0,this._iClipIdCount=1}o.Blocks=G;var B=function(){this.blocks=new G,this.layers=new h.MxBrowseLayerData};o.ExternalReferenceDatabase=B;var R=(u.prototype.createTzDwgExternalReferences=function(c){this._mapId2ExternalDatabase.get(c)||this.getBlocks(c).initRootBlockRef()},u.prototype.createExternalReferences=function(c){for(var f=c.getInt32(12,!0),O=80,W=0;W<f;W++){for(var X=new Array,J=0;J<16;J++){var te=c.getFloat32(O,!0);O+=4,X.push(te)}var ne=c.getInt32(O,!0);O+=4;var ue=c.getInt32(O,!0);if(O+=4,c.getInt32(O,!0),O+=4,ne!=0){var be=this.getBlocks(ne),je=new A;je.mat=new a.Matrix4,je.mat.fromArray(X),je.blkRecId=0,je.blkOwnerId=-1,je.layerId=-1,je.color=ue,be.initRootBlockRef(je)}else console.log("mx error iDatabaseIndex")}},u.prototype.getBlocks=function(c){if(c!=0){var f=this._mapId2ExternalDatabase.get(c);return f==null&&(f=new B,this._mapId2ExternalDatabase.set(c,f)),f.blocks}console.log("mx error iDatabaseIndex")},u.prototype.getLayers=function(c){if(c!=0){var f=this._mapId2ExternalDatabase.get(c);return f==null&&(f=new B,this._mapId2ExternalDatabase.set(c,f)),f.layers}console.log("mx error iDatabaseIndex")},u);function u(){this._mapId2ExternalDatabase=new Map}o.ExternalReferenceManager=R},{"../MxFun":27,"../MxManager":29,"../MxNetData":31,"../MxShader":32,"../MxStencilObject":33,"./MxBrowseLayerData":67,three:19}],67:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxBrowseLayerData=void 0;var a=(v.prototype.add=function(h,b,D){this._layerColor[h]=b,this._nametoId[D]=h},v.prototype.setZeroLayerId=function(h){this._zeroLayerId=h},v.prototype.getZeroLayerId=function(){return this._zeroLayerId},v.prototype.getLayerIdForName=function(h){return this._nametoId[h]==null?0:this._nametoId[h]},v.prototype.getColor=function(h){return this._layerColor[h]==null?16777215:this._layerColor[h]},v.prototype.initComplete=function(){this._isSetInstanceComplete=!0},v.prototype.isInitComplete=function(){return this._isSetInstanceComplete},v);function v(){this._isSetInstanceComplete=!1,this._layerColor=new Map,this._nametoId=new Map,this._zeroLayerId=0}o.MxBrowseLayerData=a},{}],68:[function(w,r,o){var a=this&&this.__awaiter||function(_,Y,k,S){return new(k=k||Promise)(function(G,C){function B(c){try{u(S.next(c))}catch(f){C(f)}}function R(c){try{u(S.throw(c))}catch(f){C(f)}}function u(c){var f;c.done?G(c.value):((f=c.value)instanceof k?f:new k(function(O){O(f)})).then(B,R)}u((S=S.apply(_,Y||[])).next())})},v=this&&this.__generator||function(_,Y){var k,S,G,C,B={label:0,sent:function(){if(1&G[0])throw G[1];return G[1]},trys:[],ops:[]};return C={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function R(u){return function(c){return function(f){if(k)throw new TypeError("Generator is already executing.");for(;B;)try{if(k=1,S&&(G=2&f[0]?S.return:f[0]?S.throw||((G=S.return)&&G.call(S),0):S.next)&&!(G=G.call(S,f[1])).done)return G;switch(S=0,G&&(f=[2&f[0],G.value]),f[0]){case 0:case 1:G=f;break;case 4:return B.label++,{value:f[1],done:!1};case 5:B.label++,S=f[1],f=[0];continue;case 7:f=B.ops.pop(),B.trys.pop();continue;default:if(!(G=0<(G=B.trys).length&&G[G.length-1])&&(f[0]===6||f[0]===2)){B=0;continue}if(f[0]===3&&(!G||f[1]>G[0]&&f[1]<G[3])){B.label=f[1];break}if(f[0]===6&&B.label<G[1]){B.label=G[1],G=f;break}if(G&&B.label<G[2]){B.label=G[2],B.ops.push(f);break}G[2]&&B.ops.pop(),B.trys.pop();continue}f=Y.call(_,B)}catch(O){f=[6,O],S=0}finally{k=G=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.MxDbDatabase=void 0;var h=w("three"),b=w("../MxFun"),D=w("./MxDbEntity"),U=w("./MxDbEntityGrip"),V=w("./MxDbEntitySelect"),I=w("../MxManager"),g=w("../MxType"),A=w("./MxDbLayerTable"),M=w("./MxDbGroup"),N=w("../MxTools"),F=(T.prototype.getAllEntity=function(){return this.mapIdToEntity},T.prototype.getGroupDictionary=function(){return this.groupDictionary},T.prototype.regenAllMxDbEntity=function(){return this.mapIdToEntity.forEach(function(_){_.upDisplay(),_.setDirtyDisplay(!1)}),!0},T.prototype.upDirtyDisplay=function(){var _=!1;return this.mapIdToEntity.forEach(function(Y){Y.getDirtyDisplay()&&(Y.upDisplay(),Y.setDirtyDisplay(!1),_=!0)}),_},T.prototype.onViewChange=function(){var _=!1;return this.mapIdToEntity.forEach(function(Y){Y.onViewChange()&&(_=!0)}),_},T.prototype.toJsonObject=function(_){var Y={ver:1},k=new h.Vector3(0,0,0),S=new h.Vector3(this.mxObj.getViewWidth(),this.mxObj.getViewHeight(),0),G=g.MxType.MxCloneType.kMxFileClone;_&&(G=g.MxType.MxCloneType.kSaveDwgClone);var C=this.mxObj.screenCoord2Current(k.x,k.y,0),B=this.mxObj.screenCoord2Current(S.x,S.y,0);Y.view={ptView1:C,ptView2:B};var R=[];return this.mapNameToLayer.forEach(function(u){var c={type:G};u.dwgOut(c),c.TypeName="MxDbLayerTableRecord",R.push(c)}),Y.layers=R,this.groupDictionary.dwgOut(Y),Y},T.prototype.saveJson=function(_){var Y=this,k=this.toJsonObject(_),S=g.MxType.MxCloneType.kMxFileClone;_&&(S=g.MxType.MxCloneType.kSaveDwgClone);var G=[];return this.mapIdToEntity.forEach(function(C){var B=C.getUserObject(),R={type:S};B.dwgOut(R),R.TypeName=B.getTypeName(),R.group=Y.groupDictionary.getEntityInGroupName(C.objectId()),G.push(R)}),k.entitys=G,k},T.prototype.reInit=function(){this.eraseAllEntity(),this.groupDictionary=new M.MxDbGroupDictionary;var _=this.parentObject.matrix;this.init(this.mxObj),this.initObjectMatrix(_)},T.prototype.init=function(_){this.mxObj=_,this.scene=_.getScene(),b.MxFun.removeThreejsObject(this.parentObject,this.scene),b.MxFun.removeThreejsObject(this.parentObject_SmallCoord,this.scene),this.parentObject=new h.Object3D,this.parentObject.renderOrder=I.MxData.iMxEntityRenderOrder,this.scene.add(this.parentObject),this.parentObject_SmallCoord=new h.Object3D,this.parentObject_SmallCoord.renderOrder=I.MxData.iMxEntityRenderOrder,this.scene.add(this.parentObject_SmallCoord),this.initLayerTable()},T.prototype.loadJson=function(_){return a(this,void 0,void 0,function(){var Y,k,S,G,C,B,R,u,c,f,O=this;return v(this,function(W){switch(W.label){case 0:if(this.reInit(),(Y=_).view&&(k=Y.view,this.mxObj.zoomW(new h.Vector3(k.ptView1.x,k.ptView1.y,0),new h.Vector3(k.ptView2.x,k.ptView2.y,0),!1)),S=Y.layers)for(G=S.length,f=0;f<G;f++)C=S[f],this.addLayer(C.name).dwgIn(C);this.groupDictionary.dwgIn(Y),B=Y.entitys,R=B.length,u=function(X){var J,te,ne,ue;return v(this,function(be){switch(be.label){case 0:return J=B[X],[4,I.MxManager.getMxDbEntityClassHierarchy().createMxEntity(J.TypeName)];case 1:return(te=be.sent())?(te.dwgIn(J),(ne=new D.MxDbEntity).initUserObject(te),c.addEntityImp(ne),(ue=J.group)&&0<ue.length&&ue.forEach(function(je){O.groupDictionary.add(je).append(ne.objectId())}),[2]):[2,"continue"]}})},c=this,f=0,W.label=1;case 1:return f<R?[5,u(f)]:[3,4];case 2:W.sent(),W.label=3;case 3:return f++,[3,1];case 4:return[2,new Promise(function(X){X(!0)})]}})})},T.prototype.getMxObject=function(){return this.mxObj},T.prototype.getGripManager=function(){return this.gripManager},T.prototype.getSelectManager=function(){return this.selectManager},T.prototype.clearMxCurrentSelect=function(){var _=!1;return this.gripManager.removeAllGrips()&&(_=!0),this.selectManager.removeAllEntity()&&(_=!0),_},T.prototype.eraseAllEntity=function(){this.mapIdToEntity.forEach(function(_){_.clearDisplayImp()}),this.mapIdToEntity=new Map,this.clearMxCurrentSelect()},T.prototype.initObjectMatrix=function(_){this.parentObject.matrix=_,this.parentObject.matrixAutoUpdate=!1,this.parentObject_SmallCoord.matrix=new h.Matrix4,this.parentObject_SmallCoord.matrixAutoUpdate=!1},T.prototype.initLayerTable=function(){this.mapNameToLayer=new Map,this.curLayer="0";var _=new A.MxDbLayerTableRecord;_.init(this.curLayer,this.parentObject,this.parentObject_SmallCoord),this.mapNameToLayer.set(this.curLayer,_)},T.prototype.getEntity=function(_){return this.mapIdToEntity.get(_)},T.prototype.isValidId=function(_){return this.mapIdToEntity.has(_)},T.prototype.setRenderOrder=function(_){var Y=this.parentObject.renderOrder;return this.parentObject.renderOrder=_,this.parentObject_SmallCoord.renderOrder=_,Y},T.prototype.eraseEntity=function(_){this.gripManager.deleteGripData(_),this.selectManager.deleteSelect(_),this.mapIdToEntity.delete(_)},T.prototype.showLayer=function(_,Y){var k=this.getLayer(_);k&&k.setVisible(Y)},T.prototype.setCurrentLayer=function(_){if(_.length!=0)return this.curLayer=_,this.addLayer(_)},T.prototype.addLayer=function(_){var Y=this.mapNameToLayer.get(_);return Y||((Y=new A.MxDbLayerTableRecord).init(_,this.parentObject,this.parentObject_SmallCoord),this.mapNameToLayer.set(_,Y),Y)},T.prototype.getLayer=function(_){return this.mapNameToLayer.get(_)},T.prototype.addMxEntity=function(_){if(_.getImp())return _.objectId();var Y=new D.MxDbEntity;return Y.initUserObject(_),_.initGuid(N.MxTools.generateUUID()),this.addEntityImp(Y)},T.prototype.addEntityImp=function(_){return this.mapIdToEntity.set(this.idCount,_),_.setMxDatabase(this),_.setObjectId(this.idCount),_.getLayer().length==0&&_.setLayer(this.curLayer),_.upDisplay(),this.idCount++},T.prototype.getThreeJSParentObject=function(){return this.parentObject},T.prototype.getThreeJSParentObject_SmallCoord=function(){return this.parentObject_SmallCoord},T.prototype.getIntersectObjects=function(_){var Y=this.getIntersectObjects_imp(_),k=this.getIntersectObjects_SmallCoord_imp(_);return Y.concat(k)},T.prototype.getIntersectObjects_imp=function(_){return this.mxObj.getMxDrawThreeJs().createRaycaster(_).intersectObjects(this.parentObject.children,!0)},T.prototype.getIntersectObjects_SmallCoord_imp=function(_){return this.mxObj.getMxDrawThreeJs().createRaycaster(_).intersectObjects(this.parentObject_SmallCoord.children,!0)},T);function T(){this.mapIdToEntity=new Map,this.mxObj=null,this.scene=null,this.idCount=1,this.parentObject=null,this.parentObject_SmallCoord=null,this.mapNameToLayer=new Map,this.curLayer="0",this.gripManager=new U.MxDbEntityGrip(this),this.selectManager=new V.MxDbEntitySelect(this),this.groupDictionary=new M.MxDbGroupDictionary}o.MxDbDatabase=F},{"../MxFun":27,"../MxManager":29,"../MxTools":38,"../MxType":39,"./MxDbEntity":69,"./MxDbEntityGrip":70,"./MxDbEntitySelect":71,"./MxDbGroup":72,"./MxDbLayerTable":73,three:19}],69:[function(w,r,o){var a=this&&this.__awaiter||function(T,_,Y,k){return new(Y=Y||Promise)(function(S,G){function C(u){try{R(k.next(u))}catch(c){G(c)}}function B(u){try{R(k.throw(u))}catch(c){G(c)}}function R(u){var c;u.done?S(u.value):((c=u.value)instanceof Y?c:new Y(function(f){f(c)})).then(C,B)}R((k=k.apply(T,_||[])).next())})},v=this&&this.__generator||function(T,_){var Y,k,S,G,C={label:0,sent:function(){if(1&S[0])throw S[1];return S[1]},trys:[],ops:[]};return G={next:B(0),throw:B(1),return:B(2)},typeof Symbol=="function"&&(G[Symbol.iterator]=function(){return this}),G;function B(R){return function(u){return function(c){if(Y)throw new TypeError("Generator is already executing.");for(;C;)try{if(Y=1,k&&(S=2&c[0]?k.return:c[0]?k.throw||((S=k.return)&&S.call(k),0):k.next)&&!(S=S.call(k,c[1])).done)return S;switch(k=0,S&&(c=[2&c[0],S.value]),c[0]){case 0:case 1:S=c;break;case 4:return C.label++,{value:c[1],done:!1};case 5:C.label++,k=c[1],c=[0];continue;case 7:c=C.ops.pop(),C.trys.pop();continue;default:if(!(S=0<(S=C.trys).length&&S[S.length-1])&&(c[0]===6||c[0]===2)){C=0;continue}if(c[0]===3&&(!S||c[1]>S[0]&&c[1]<S[3])){C.label=c[1];break}if(c[0]===6&&C.label<S[1]){C.label=S[1],S=c;break}if(S&&C.label<S[2]){C.label=S[2],C.ops.push(c);break}S[2]&&C.ops.pop(),C.trys.pop();continue}c=_.call(T,C)}catch(f){c=[6,f],k=0}finally{Y=S=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([R,u])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.MxDbEntity=o.MxDbEntityClassHierarchy=o.MxDbEntityUserObject=void 0;var h=w("three"),b=w("../Operate/McGiWorldDraw"),D=w("../MxManager"),U=w("../MxTools"),V=w("../MxType"),I=(g.prototype.getClosestPointTo=function(T,_){return null},g.prototype.getTypeName=function(){return""},g.prototype.isUseSmallcoordDisplay=function(){return this.use_smallcoord_display},g.prototype.toSmallcoord=function(T,_){return this.use_smallcoord_display?T.toSmallcoord(_):_},g.prototype.initGuid=function(T){0<this.sGuid.length?console.log("mx: init guid error"):this.sGuid=T},g.prototype.guid=function(){return this.sGuid},g.prototype.setGuid=function(T){this.sGuid=T},g.prototype.setLayer=function(T){var _=this.getImp();_&&_.nodifySetLayer(),this.layer=T},g.prototype.getLayer=function(){return this.layer},g.prototype.setDash=function(T,_){this.dDashArray=T,this.dDashRatio=_,this.dLineWidth==0&&(this.dLineWidth=6,this.lineWidthByPixels=!0)},g.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},g.prototype.setDashLineDisplay=function(T){T?(this.dDashArray=.03,this.dDashRatio=.1,this.dLineWidth==0&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},g.prototype.isDashLineDisplay=function(){return 0<this.dDashArray&&0<this.dDashRatio},g.prototype.setLineWidthByPixels=function(T){this.lineWidthByPixels=T},g.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},g.prototype.setLineWidth=function(T){this.dLineWidth=T},g.prototype.getLineWidth=function(){return this.dLineWidth},g.prototype.getMxObject=function(){var T=this.getImp();return T?T.getMxObject():null},g.prototype.onViewChange=function(){return!1},g.prototype.getImp=function(){return this.MxDbEntityImp},g.prototype.upDisplay=function(){var T=this.getImp();return!!T&&T.upDisplay()},g.prototype.erase=function(){var T=this.getImp();return!!T&&T.erase()},g.prototype.setColor=function(T){this.iColor=T},g.prototype.getColor=function(){return this.iColor},g.prototype.setRenderOrder=function(T){this.iRenderOrder=T},g.prototype.getRenderOrder=function(){return this.iRenderOrder},g.prototype.onEndGripEidt=function(){},g.prototype.onStartGripEidt=function(){},g.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},g.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},g.prototype.clone=function(T){var _=this.create(),Y={type:T||V.MxType.MxCloneType.kClone};return this.dwgOut(Y),_.dwgIn(Y),_.sGuid="",_},g.prototype.init=function(){D.MxManager.getMxDbEntityClassHierarchy().init(this)},g.prototype.transformBy=function(T){},g.prototype.objectId=function(){var T=this.getImp();return T?T.objectId():0},g);function g(){this.iColor=16777215,this.iRenderOrder=D.MxData.iMxEntityRenderOrder,this.opacity=1,this.visible=!0,this.dLineWidth=0,this.lineWidthByPixels=!0,this.dDashArray=0,this.dDashRatio=0,this.layer="",this.sGuid="",this.use_smallcoord_display=!1}o.MxDbEntityUserObject=I;var A=(M.prototype.init=function(T){var _=T.getTypeName();this.mapType2Create.get(_)&&console.log("MxError:already has this class name "+_),this.mapType2Create.set(_,{type:0,createfun:T})},M.prototype.initDynamic=function(T){this.dynmaicCreate=T},M.prototype.createMxEntity=function(T){return a(this,void 0,void 0,function(){var _,Y;return v(this,function(k){switch(k.label){case 0:return(_=this.mapType2Create.get(T))?[3,3]:this.dynmaicCreate?[4,this.dynmaicCreate(T)]:[3,2];case 1:return(Y=k.sent())?(this.mapType2Create.set(T,{type:1,createfun:Y}),[2,new Promise(function(S,G){S(new Y)})]):[2,new Promise(function(S,G){S(null)})];case 2:return[2,new Promise(function(S,G){S(null)})];case 3:return _.type==0?[2,new Promise(function(S,G){S(_.createfun.create())})]:_.type==1?[2,new Promise(function(S,G){S(new _.createfun)})]:[2,new Promise(function(S,G){S(null)})]}})})},M);function M(){this.mapType2Create=new Map,this.dynmaicCreate=null}o.MxDbEntityClassHierarchy=A;var N=(F.prototype.setObjectId=function(T){this.id=T},F.prototype.nodifySetLayer=function(){this.layerObjectGroup&&this.clearDisplayImp()},F.prototype.setLayer=function(T){this.userObject.setLayer(T)},F.prototype.getLayer=function(){return this.userObject.getLayer()},F.prototype.setDirtyDisplay=function(T){this.isDirtyDisplay=T},F.prototype.getDirtyDisplay=function(){return this.isDirtyDisplay},F.prototype.setMxDatabase=function(T){this.mxDatabase=T},F.prototype.objectId=function(){return this.id},F.prototype.initUserObject=function(T){(this.userObject=T).MxDbEntityImp=this},F.prototype.upDisplay=function(){if(!this.mxDatabase)return console.log("mxassert(0) this.mxDatabase is null"),!1;this.updateDisplayImp(this.mxDatabase.getMxObject())},F.prototype.erase=function(){if(this.id==0)return!1;this.clearDisplayImp(),this.userObject=null,this.mxDatabase.eraseEntity(this.id),this.id=0,this.mxDatabase=null},F.prototype.clearDisplayImp=function(){this.layerObjectGroup&&(this.threeObjectGroup&&(this.threeObjectGroup.traverse(function(T){T.type==="Mesh"&&(T.geometry.dispose(),T.material.dispose())}),this.layerObjectGroup.remove(this.threeObjectGroup)),this.threeObjectGroup=null,this.layerObjectGroup=null)},F.prototype.updateDisplayImp=function(T){if(this.clearDisplayImp(),this.userObject){if(this.userObject.visible){var _=this.mxDatabase.addLayer(this.userObject.getLayer());if(!_)return console.log("mxassert(0) this.layerRecord is null"),!1;this.threeObjectGroup=new h.Object3D;var Y=new b.McGiWorldDraw(T,b.McGiWorldDrawType.kWorldDraw);Y.setupForEntity(this.userObject),this.worldDraw(Y);for(var k=Y.getEntitys(),S=k.length,G=0;G<S;G++){var C=k[G];(C.MxDbEntity=this).threeObjectGroup.add(C)}this.userObject.isUseSmallcoordDisplay()?this.layerObjectGroup=_.getGroup_SmallCoord():this.layerObjectGroup=_.getGroup(),this.layerObjectGroup.add(this.threeObjectGroup)}}else U.MxTools.MxASSERT(!1,"this.userObject == null")},F.prototype.worldDraw=function(T){this.userObject.worldDraw(T)},F.prototype.getGripPoints=function(){return this.userObject.getGripPoints()},F.prototype.getClosestPointTo=function(T,_){return this.userObject.getClosestPointTo(T,_)},F.prototype.getUserObject=function(){return this.userObject},F.prototype.clone=function(T){var _=new F;return _.initUserObject(this.userObject.clone(T)),_},F.prototype.transformBy=function(T){this.userObject.transformBy(T)},F.prototype.setColor=function(T){this.userObject.setColor(T)},F.prototype.onEndGripEidt=function(){this.userObject.onEndGripEidt()},F.prototype.onStartGripEidt=function(){return this.userObject.onStartGripEidt()},F.prototype.getColor=function(){return this.userObject.getColor()},F.prototype.getMxObject=function(){return this.mxDatabase?this.mxDatabase.getMxObject():null},F.prototype.onViewChange=function(){return!!this.userObject&&this.userObject.onViewChange()},F);function F(){this.threeObjectGroup=null,this.userObject=null,this.mxDatabase=null,this.isDirtyDisplay=!1,this.layerObjectGroup=null,this.id=0}o.MxDbEntity=N},{"../MxManager":29,"../MxTools":38,"../MxType":39,"../Operate/McGiWorldDraw":44,three:19}],70:[function(w,r,o){var a,v=this&&this.__extends||(a=function(S,G){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,B){C.__proto__=B}||function(C,B){for(var R in B)Object.prototype.hasOwnProperty.call(B,R)&&(C[R]=B[R])})(S,G)},function(S,G){function C(){this.constructor=S}a(S,G),S.prototype=G===null?Object.create(G):(C.prototype=G.prototype,new C)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxDbEntityGrip=o.MxDbEntityGripJig=o.MxGetWordDrawxDataForThreeJsObject=o.MxGetMxDbEntitForThreeJsObject=o.MxDbEntityGripData=void 0;var h=w("three"),b=w("../MxFun"),D=w("../MxDrawData"),U=w("../Operate/MxJig"),V=w("../Operate/MxJigCmdManager"),I=w("../Operate/McGiWorldDraw"),g=w("../MxManager"),A=w("../MxType"),M=function(){this.threeObject=null};function N(S){for(var G=null;S&&!(G=S.MxDbEntity)&&S.parent;)S=S.parent;return G}o.MxDbEntityGripData=M,o.MxGetMxDbEntitForThreeJsObject=N,o.MxGetWordDrawxDataForThreeJsObject=function(S){for(var G=null;S&&!(G=S.MxWordDrawXData)&&S.parent;)S=S.parent;return G};var F,T=(v(_,F=U.McEdJigCommand),_.prototype.sampler=function(){var S=V.MxJigCmdManager.InType.kGetBegan|V.MxJigCmdManager.InType.kGetEnd,G=this.acquirePoint(S);return G.status==V.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=G.pt),G.status},_.prototype.getTypeName=function(){return"MxGripEdit"},_.prototype.onStartCommand=function(){this.iscallOnStartCommand=!0,F.prototype.onStartCommand.call(this)},_.prototype.done=function(S){if(S==V.MxJigCmdManager.DragStatus.kNormal){var G=this.currPt.clone();G.sub(this.dragBasePt);for(var C=this.getMxObject(),B=C.getMxDatabase(),R=C.getMxDatabase().getGripManager(),u=this.grips.length,c=new Set,f=[],O=0;O<u;O++){var W=this.grips[O],X=this.ents[O];R.deleteGripData(X.objectId()),X.getUserObject().moveGripPointsAt(W.iIndex,G),R.addGripFromEntity(X),X.upDisplay(),c.add(X.objectId());var J={type:"mxdraw",id:X.objectId(),index:W.iIndex,curentPoint:this.currPt,point:W.point,offset_x:G.x,offset_y:G.y};f.push(J)}C.updateDisplay(),0<f.length&&C.callEvent("objectGripEdit",f),B.getSelectManager().upSelectDilsplay(c)}var te=this.ents.length;for(O=0;O<te;O++)(X=this.ents[O]).onEndGripEidt(),S!=V.MxJigCmdManager.DragStatus.kNormal&&X.upDisplay();return V.MxJigCmdManager.DoneStatius.kExitCommand},_.prototype.upDisplay=function(){var S=this.currPt.clone();if(S.sub(this.dragBasePt),!(S.length()<.001)){if(this.iscallOnStartCommand){for(var G=this.ents.length,C=0;C<G;C++){var B=this.ents[C];this.aryParam.push(B.onStartGripEidt())}this.iscallOnStartCommand=!1}var R=this.getMxObject(),u=this.grips.length;for(C=0;C<u;C++){var c=this.grips[C],f=(B=this.ents[C],this.aryParam[C]),O=B.clone(A.MxType.MxCloneType.kDragClone);O.getUserObject().moveGripPointsAt(c.iIndex,S);var W=new I.McGiWorldDraw(R,I.McGiWorldDrawType.kDynDragDraw);W.setupForEntity(O.getUserObject()),O.worldDraw(W);var X=W.getEntitys(),J=X.length,te=31;f&&f.renderOrder&&(te=f.renderOrder);for(var ne=0;ne<J;ne++)this.drawEntity(X[ne],te,O.getUserObject().isUseSmallcoordDisplay())}}},_);function _(S,G,C){var B=F.call(this)||this;return B.aryParam=[],B.iscallOnStartCommand=!0,B.dragBasePt=S,B.grips=G,B.ents=C,B.currPt=S,B.iscallOnStartCommand=!0,B}o.MxDbEntityGripJig=T;var Y=(k.prototype.getAllSelect=function(){var S=[];return this.mapGrips.forEach(function(G,C){S.push(C)}),S},k.prototype.getParentGroup=function(){return this.drawGroup||(this.drawGroup=new h.Group,this.drawGroup.renderOrder=g.MxData.iGripRenderOrder,this.database.getMxObject().getTheTempDrawContainer_SmallCoord().add(this.drawGroup)),this.drawGroup},k.prototype.reInit=function(){this.removeAllGrips(),this.drawGroup&&b.MxFun.removeThreejsObject(this.drawGroup,this.database.getMxObject().getTheTempDrawContainer_SmallCoord()),this.drawGroup=null},k.prototype.removeAllGrips=function(){if(this.mapGrips.size==0)return!1;var S=this.getParentGroup();return this.mapGrips.forEach(function(G,C,B){for(var R=G.length,u=0;u<R;u++){var c=G[u];b.MxFun.removeThreejsObject(c.threeObject,S)}}),this.mapGrips=new Map,!0},k.prototype.deleteGripData=function(S){var G=this.getParentGroup(),C=this.mapGrips.get(S);if(C)for(var B=C.length,R=0;R<B;R++){var u=C[R];b.MxFun.removeThreejsObject(u.threeObject,G)}this.mapGrips.delete(S)},k.prototype.createGripDisplayObject=function(S){var G=this.database.getMxObject(),C=this.getParentGroup();S.geometry=new h.Geometry;var B=G.toSmallcoord2(S.point.x,S.point.y,S.point.z),R=G.screenCoordLong2World(D.MxDrawData.m_dInputRectWidth/2);S.geometry.vertices.push(new h.Vector3(B.x-R,B.y-R,0)),S.geometry.vertices.push(new h.Vector3(B.x-R,B.y+R,0)),S.geometry.vertices.push(new h.Vector3(B.x+R,B.y+R,0)),S.geometry.vertices.push(new h.Vector3(B.x+R,B.y-R,0)),S.geometry.faces.push(new h.Face3(0,1,2)),S.geometry.faces.push(new h.Face3(2,3,0)),S.geometry.computeFaceNormals(),S.geometry.computeVertexNormals();var u=new h.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:h.DoubleSide,opacity:.9}),c=new h.Mesh(S.geometry,u);C.add(c),S.threeObject=c},k.prototype.addGripData=function(S,G,C){var B=this.mapGrips.get(S);B==null&&(B=new Array,this.mapGrips.set(S,B));var R=new M;return R.iIndex=G,R.point=new h.Vector3(C.x,C.y,0),B.push(R),R},k.prototype.hitTest=function(S){var G=this,C={grips:new Array,ents:new Array,pt:S},B=new h.Vector3(S.x,S.y,0),R=this.database.getMxObject(),u=R.viewCoordLong2Cad(D.MxDrawData.m_dInputRectWidth/2);return this.mapGrips.forEach(function(c,f){for(var O=c.length,W=0;W<O;W++){var X=c[W];if(X.point.distanceTo(B)<=u){var J=G.database.getEntity(f),te=!0;R.hasEvent("whetherEditTheGripPoint")&&(te=R.callEvent("whetherEditTheGripPoint",{entity:J.getUserObject(),index:X.iIndex})),te&&(C.grips.push(X),C.ents.push(J));break}}}),C},k.prototype.onMouseLBDown=function(S){if(!D.MxDrawData.m_isEnableGripEidt)return!1;var G=this.hitTest(S);return G.grips.length!=0&&(b.MxFun.sendStringToExecute("Mx_FrontEndWebpageGripEdit",G),!0)},k.prototype.gripEditImp=function(S){var G=S.grips,C=S.ents,B=S.pt,R=new T(B,G,C);R.setDisableDynInput(!0),R.setDisableOsnap(!0),V.MxJigCmdManager.runCmd(R)},k.prototype.doWindowsSelect=function(S,G){},k.prototype.addGripFromEntity=function(S){if(D.MxDrawData.m_isEnableGripEidt){var G=S.getGripPoints(),C=S.objectId();this.deleteGripData(C);for(var B=0;B<G.length;B++){var R=this.addGripData(C,B,G[B]);this.createGripDisplayObject(R)}}},k.prototype.addSelect=function(S,G,C){C===void 0&&(C=!0);var B=this.database.getSelectManager(),R=!1;if(this.getAllSelect().forEach(function(f){f==S&&(R=!0)}),R)return!1;var u=this.database.getMxObject().getMxEntity(S);if(!u)return!1;var c=new Set;return c.add(S),C&&this.addGripFromEntity(u),B.upSelectDilsplay(c),G&&this.fireMxEntitySelectChange(),!0},k.prototype.fireMxEntitySelectChange=function(){var S=this.database.getMxObject();this.isCallingMxEntitySelectChange||(this.isCallingMxEntitySelectChange=!0,S.callEvent("mxdrawSelectChange",this.getAllSelect()),this.isCallingMxEntitySelectChange=!1)},k.prototype.doPointSelect=function(S){for(var G=!1,C=this.database.getSelectManager(),B=this.database.getMxObject(),R=C.isEmptySelect(),u=!1,c=B.viewCoordLong2Cad(.5*D.MxDrawData.m_dInputRectWidth),f=function(){B.pointMultipleSelect()||(O.removeAllGrips()&&(u=!0),C.removeAllEntity()&&(u=!0),B.getMcObject().isValid()&&(u=B.getMcObject().getGripManager().clearAll()));var W=O.database.getIntersectObjects(S);if(W.length==0)return B.updateDisplay(),"break";var X=B.screenCoord2Current(S.x,S.y,S.z),J=O,te=new Set;W.forEach(function(be){var je=N(be.object);if(je){var ve=je.objectId();if(J.database.isValidId(ve)&&!te.has(ve)){var Be=je.getClosestPointTo(X,1),q=!1;(!Be||Be.distanceTo(X)<c)&&(q=!0),q&&(te.add(ve),J.addGripFromEntity(je))}}});var ne=new Set,ue=O.database.getGroupDictionary();return te.forEach(function(be){ne.add(be),ue.getEntityInGroup(be).forEach(function(je){je.getAll().forEach(function(ve){J.database.isValidId(ve)&&ne.add(ve)})})}),u=!0,C.upSelectDilsplay(ne),B.updateDisplay(),G=!0,"break"},O=this;f()!=="break";);return!u&&R==C.isEmptySelect()||this.fireMxEntitySelectChange(),G},k);function k(S){this.database=null,this.mapGrips=new Map,this.isCallingMxEntitySelectChange=!1,this.drawGroup=null,this.database=S}o.MxDbEntityGrip=Y},{"../MxDrawData":22,"../MxFun":27,"../MxManager":29,"../MxType":39,"../Operate/McGiWorldDraw":44,"../Operate/MxJig":53,"../Operate/MxJigCmdManager":54,three:19}],71:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxDbEntitySelect=void 0;var a=w("three"),v=w("../MxFun"),h=w("three.meshline"),b=w("../Operate/McGiWorldDraw"),D=w("../MxManager"),U=(V.prototype.setRenderOrder=function(I){this.iRenderOrder=I},V.prototype.getRenderOrder=function(){return this.iRenderOrder},V.prototype.setCanvasSize=function(I,g){this.canvasWidth==I&&this.canvasHeight==g||(this.canvasWidth=I,this.canvasHeight=g,this.material.resolution=new a.Vector2(this.canvasWidth,this.canvasHeight),this.material.needsUpdate=!0)},V.prototype.removeAllEntity=function(){return this.mapIdToThreeObject.size!=0&&(this.mapIdToThreeObject.forEach(function(I){for(var g=I.length,A=0;A<g;A++){var M=I[A];v.MxFun.removeThreejsObject(M,M.parentObject)}}),this.mapIdToThreeObject.clear(),!0)},V.prototype.isEmptySelect=function(){return this.mapIdToThreeObject.size==0},V.prototype.getParentObject=function(I){return I?this.mxDatabase.getMxObject().getTheTempDrawContainer_SmallCoord():this.mxDatabase.getMxObject().getTheTempDrawContainer()},V.prototype.getAllSelect=function(){var I=[];return this.mapIdToThreeObject.forEach(function(g,A){I.push(A)}),I},V.prototype.setPrvCommandSelect=function(I){this.aryPrvCommandSelect=I},V.prototype.getPrvCommandSelect=function(){return this.aryPrvCommandSelect},V.prototype.deleteSelect=function(I){var g=this.mapIdToThreeObject.get(I);if(g){for(var A=g.length,M=0;M<A;M++){var N=g[M];v.MxFun.removeThreejsObject(N,N.parentObject)}this.mapIdToThreeObject.delete(I)}},V.prototype.upSelectDilsplayFromId=function(I){var g=new Set;g.add(I),this.upSelectDilsplay(g)},V.prototype.upSelectDilsplay=function(I){var g=this,A=new b.McGiWorldDrawSelect(this.mxDatabase.getMxObject(),this);I.forEach(function(M){g.deleteSelect(M);var N=g.mxDatabase.getEntity(M);N&&(A.setSmallCoordDraw(N.getUserObject().isUseSmallcoordDisplay()),A.setCurEntityId(M),N.worldDraw(A))})},V.prototype.addCircleDisplay=function(I,g,A,M){var N=new a.CircleGeometry(A,64,3,2*Math.PI);if(N.vertices.shift(),N.vertices.length!=0){N.vertices.push(N.vertices[0]);var F=3*N.vertices.length;if(F!=0){for(var T=this.getParentObject(M),_=new Float32Array(F),Y=0,k=0;Y+2<F;Y+=3,k++)_[Y]=N.vertices[k].x+g.x,_[Y+1]=N.vertices[k].y+g.y,_[Y+2]=g.z;var S=new h.MeshLine;S.setGeometry(_);var G=new a.Mesh(S.geometry,this.material);G.renderOrder=this.iRenderOrder,(G.parentObject=T).add(G);var C=this.mapIdToThreeObject.get(I);C||(C=new Array,this.mapIdToThreeObject.set(I,C)),C.push(G)}}},V.prototype.addLineDisplay=function(I,g,A,M){var N=this.getParentObject(M),F=new Float32Array(6);F[0]=g.x,F[1]=g.y,F[2]=0,F[3]=A.x,F[4]=A.y,F[5]=0;var T=new h.MeshLine;T.setGeometry(F);var _=new a.Mesh(T.geometry,this.material);_.renderOrder=this.iRenderOrder,(_.parentObject=N).add(_);var Y=this.mapIdToThreeObject.get(I);Y||(Y=new Array,this.mapIdToThreeObject.set(I,Y)),Y.push(_)},V);function V(I){this.mapIdToThreeObject=new Map,this.canvasWidth=800,this.canvasHeight=500,this.mxDatabase=null,this.material=new h.MeshLineMaterial({useMap:!1,color:new a.Color(2641557),opacity:.8,resolution:new a.Vector2(800,500),sizeAttenuation:!1,lineWidth:10,transparent:!0,depthTest:!1}),this.iRenderOrder=D.MxData.iSelectRenderOrder,this.aryPrvCommandSelect=[],this.mxDatabase=I}o.MxDbEntitySelect=U},{"../MxFun":27,"../MxManager":29,"../Operate/McGiWorldDraw":44,three:19,"three.meshline":18}],72:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxDbGroupDictionary=o.MxDbGroup=void 0;var a=(v.prototype.name=function(){return this.sName},v.prototype.append=function(D){this.has(D)||this.setId.add(D)},v.prototype.clear=function(){this.setId=new Set},v.prototype.getAll=function(){var D=[];return this.setId.forEach(function(U){D.push(U)}),D},v.prototype.has=function(D){return this.setId.has(D)},v.prototype.delete=function(D){return this.setId.delete(D)},v);function v(D){this.setId=new Set,this.sName="",this.sName=D}o.MxDbGroup=a;var h=(b.prototype.getAt=function(D){return this.mapNameToGroup.get(D)},b.prototype.delete=function(D){return!!this.mapNameToGroup.has(D)&&this.mapNameToGroup.delete(D)},b.prototype.add=function(D){var U=this.mapNameToGroup.get(D);return U||(U=new a(D),this.mapNameToGroup.set(D,U),U)},b.prototype.dwgOut=function(D){var U=[];return this.mapNameToGroup.forEach(function(V,I){U.push(I)}),D.groups=U,D},b.prototype.dwgIn=function(D){var U=this;return D.groups.forEach(function(V){var I=new a(V);U.mapNameToGroup.set(V,I)}),!0},b.prototype.getEntityInGroup=function(D){var U=[];return this.mapNameToGroup.forEach(function(V){V.has(D)&&U.push(V)}),U},b.prototype.getEntityInGroupName=function(D){var U=[];return this.mapNameToGroup.forEach(function(V,I){V.has(D)&&U.push(I)}),U},b);function b(){this.mapNameToGroup=new Map}o.MxDbGroupDictionary=h},{}],73:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxDbLayerTableRecord=void 0;var a=w("three"),v=(h.prototype.getGroup=function(){return this.group},h.prototype.getGroup_SmallCoord=function(){return this.group_SmallCoord},h.prototype.getName=function(){return this.name},h.prototype.setName=function(b){this.name=b},h.prototype.setVisible=function(b){this.visible=b,this.group.visible=b,this.group_SmallCoord.visible=b},h.prototype.getVisible=function(){return this.visible},h.prototype.init=function(b,D,U){return this.name=b,D.add(this.group),U.add(this.group_SmallCoord),!0},h.prototype.dwgIn=function(b){return this.visible=b.visible,this.name=b.name,this.group.visible=this.visible,this.group_SmallCoord.visible=this.visible,!0},h.prototype.dwgOut=function(b){return b.visible=this.visible,b.name=this.name,b},h);function h(){this.group=new a.Group,this.group_SmallCoord=new a.Group,this.name="",this.visible=!0}o.MxDbLayerTableRecord=v},{three:19}],74:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.MxDbTextureManager=void 0;var a=w("three"),v=(h.prototype.loadImage=function(b,D){var U=this.mapImageUrlToMaterialTexture.get(b);if(U)D(U);else{var V=this;new a.TextureLoader().load(b,function(I){var g=new a.MeshLambertMaterial({map:I,transparent:!0,side:a.DoubleSide});g.map&&(g.map.needsUpdate=!0),V.mapImageUrlToMaterialTexture.set(b,g),D&&D(g)},void 0,function(I){console.log(I),D&&D(null)})}},h);function h(){this.mapImageUrlToMaterialTexture=new Map}o.MxDbTextureManager=v},{three:19}],75:[function(w,r,o){var a,v=this&&this.__extends||(a=function(u,c){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,O){f.__proto__=O}||function(f,O){for(var W in O)Object.prototype.hasOwnProperty.call(O,W)&&(f[W]=O[W])})(u,c)},function(u,c){function f(){this.constructor=u}a(u,c),u.prototype=c===null?Object.create(c):(f.prototype=c.prototype,new f)});Object.defineProperty(o,"__esModule",{value:!0}),o.MxDrawObject3dThreeJS=o.MxDrawMapBoxThreeJS=o.MxDrawObject2dThreeJS=o.MxDrawThreeJS=o.MxThreeJSType=void 0;var h,b,D,U=w("three"),V=w("../Operate/MxJigCmdManager"),I=w("three-orbitcontrols"),g=w("../UI/MxUiVue"),A=(v(M,h=I.OrbitControls),M.prototype.update=function(){},M);function M(u,c){return h.call(this,u,c)||this}(D=b=o.MxThreeJSType||(o.MxThreeJSType={}))[D.k2d=0]="k2d",D[D.k3d=1]="k3d",D[D.kMapBox=2]="kMapBox";var N=(F.prototype.screenCoord2World=function(u,c,f){return this.mxObject.screenCoord2World_mxdrawThreeJS_call(u,c,f)},F.prototype.worldCoord2Screen=function(u,c,f){return this.mxObject.worldCoord2Screen_mxdrawThreeJS_call(u,c,f)},F.prototype.getDomMousePos=function(u){},F.prototype.createRaycaster=function(u){var c=new U.Raycaster;c.linePrecision=this.mxObject.screenCoordLong2World(10);var f=this.mxObject.getCanvas(),O=f.clientWidth,W=f.clientHeight,X=new U.Vector2(u.x/O*2-1,-u.y/W*2+1);return c.setFromCamera(X,this.mxObject.getCamera()),c},F.prototype.zoomW=function(u,c,f,O,W){return this.mxObject.zoomW_call(u,c,f,W)},F.prototype.zoomCenter=function(u,c,f){return this.mxObject.zoomCenter_call(u,c)},F.prototype.zoomScale=function(u,c){return this.mxObject.zoomScale_call(u)},F.prototype.setViewAngle=function(u){return this.mxObject.setViewAngle_call(u)},F.prototype.startPanCommand=function(){return this.mxObject.startPanCommand_call()},F.prototype.endPanCommand=function(){return this.mxObject.endPanCommand_call()},F.prototype.isPaningCommand=function(){return this.mxObject.isPaningCommand_call()},F);function F(u){this.mxObject=u}o.MxDrawThreeJS=N;var T,_=(v(Y,T=N),Y.prototype.onInitThreejs=function(){this.proxyObj.onInitThreejs()},Y.prototype.onInitScene=function(){this.proxyObj.onInitScene()},Y.prototype.getType=function(){return b.k2d},Y.prototype.updateCameraDisplayRange=function(u,c,f){this.proxyObj.updateCameraDisplayRangeImp(u,c,f)},Y.prototype.updateCameraForm3dViewData=function(u){this.proxyObj.updateCameraForm3dViewDataImp(u)},Y.prototype.addControlsChangeEvent=function(){var u=this.mxObject;this.mxObject.getOrbitControls().addEventListener("change",function(){V.MxJigCmdManager.OnThreeControlsChage(),u.callViewChange(),u.getMxDatabase().onViewChange(),u.getMcObject().isValid()&&u.getMcObject().getGripManager().onControlsChage(),u.getTempMarkDraw().clear(!0),u.updateDisplay()})},Y.prototype.updateDisplay=function(u){u===void 0&&(u=!1),this.mxObject.updateDisplayImplement(u)},Y.prototype.getRegistEventObject=function(){return this.mxObject.getCanvas()},Y);function Y(u){var c=T.call(this,u)||this;return c.proxyObj=u,c}o.MxDrawObject2dThreeJS=_;var k,S=(v(G,k=N),G.prototype.startPanCommand=function(){this.mapBox.map&&(this.isPaning=!0,this.bakPan=this.mapBox.map.dragPan.useMouseMiddle(!1),g.MxUiVue.setCursorType(g.MxUiVue.CursorType.kPan))},G.prototype.endPanCommand=function(){this.mapBox.map&&this.isPaning&&(this.isPaning=!1,this.mapBox.map.dragPan.useMouseMiddle(this.bakPan),g.MxUiVue.setCursorType(g.MxUiVue.CursorType.kNormal))},G.prototype.isPaningCommand=function(){return this.mapBox.map,this.isPaning},G.prototype.mercatorCoord2CAD=function(u,c){var f=new U.Vector3(u,c,0);return f.applyMatrix4(this.mapBox.matMapToCad),f},G.prototype.cadToMercatorCoord=function(u){return u.applyMatrix4(this.mapBox.matCadToMap),u},G.prototype.setViewAngle=function(u){this.mapBox.map&&this.mapBox.map.setBearing(180*u/Math.PI)},G.prototype.zoomCenter=function(u,c,f){if(this.mapBox.map){var O=this.cadToMercatorCoord(new U.Vector3(u,c,0)),W=this.mapBox.map.mercator_to_lnglat(O.x,O.y,0),X=this.mapBox.map.getBounds(),J=.5*(X._ne.wrap().lng-X._sw.wrap().lng),te=.5*(X._ne.wrap().lat-X._sw.wrap().lat);this.mapBox.map.fitBounds([[W.lng-J,W.lat-te],[W.lng+J,W.lat+te]],{animate:!!f})}},G.prototype.zoomScale=function(u,c){if(this.mapBox.map){var f=this.mapBox.map.getBounds(),O=.5*(f._ne.wrap().lng-f._sw.wrap().lng),W=.5*(f._ne.wrap().lat-f._sw.wrap().lat),X=f._sw.wrap().lng+O,J=f._sw.wrap().lat+W;O*=u,W*=u,this.mapBox.map.fitBounds([[X-O,J-W],[X+O,J+W]],{animate:!!c})}},G.prototype.zoomW=function(u,c,f,O,W){if(this.mapBox.map)if(u.distanceTo(c)<1e-7)console.log("Mx:ZoomW param invalid");else{f!==void 0&&f&&(u=this.mxObject2d.docCoord2Cad(u.x,u.y,0),c=this.mxObject2d.docCoord2Cad(c.x,c.y,0));var X=this.cadToMercatorCoord(u),J=this.cadToMercatorCoord(c),te=this.mapBox.map.mercator_to_lnglat(X.x,X.y,0),ne=this.mapBox.map.mercator_to_lnglat(J.x,J.y,0),ue=Math.min(te.lng,ne.lng),be=Math.max(te.lng,ne.lng),je=Math.min(te.lat,ne.lat),ve=Math.max(te.lat,ne.lat);this.mapBox.map.fitBounds([[ue,je],[be,ve]],{animate:!!O})}},G.prototype.onInitScene=function(){},G.prototype.addControlsChangeEvent=function(){},G.prototype.updateDisplay=function(u){this.mapBox.map&&(this.mapBox.map.repaint=!0)},G.prototype.createRaycaster=function(u){if(this.mapBox.map){var c=u.x/this.mapBox.map.transform.width*2-1,f=-u.y/this.mapBox.map.transform.height*2+1,O=this.mxObject2d.getCamera(),W=new U.Raycaster;W.linePrecision=this.mxObject2d.screenCoordLong2World(10);var X=new U.Matrix4().getInverse(O.projectionMatrix),J=new U.Vector3().applyMatrix4(X),te=new U.Vector3(c,f,1).applyMatrix4(X).clone().sub(J).normalize();return W.setFromCamera(new U.Vector2(c,f),O),W.set(J,te),W}return k.prototype.createRaycaster.call(this,u)},G.prototype.getRegistEventObject=function(){return this.mapBox.canvasContainer},G.prototype.getType=function(){return b.kMapBox},G.prototype.getDomMousePos=function(u){return this.mapBox.map?this.mapBox.map.dom_mousePos(u):void 0},G.prototype.screenCoord2World=function(u,c,f){if(this.mapBox.map){var O=this.mapBox.map.unproject({x:u,y:c}),W=this.mapBox.map.lnglat_to_mercator(O.lng,O.lat),X=new U.Vector3(W.x,W.y,0);return X.applyMatrix4(this.mapBox.matMapToCADDrawCoord),X}return k.prototype.screenCoord2World.call(this,u,c,f)},G.prototype.worldCoord2Screen=function(u,c,f){if(this.mapBox.map){var O=new U.Vector3(u,c,f);O.applyMatrix4(this.mapBox.matCADDrawCoordToMap);var W=this.mapBox.map.mercator_to_lnglat(O.x,O.y,0),X=this.mapBox.map.project([W.lng,W.lat]);return new U.Vector3(X.x,X.y,0)}k.prototype.worldCoord2Screen.call(this,u,c,f)},G.prototype.onInitThreejs=function(){var u=this,c=this.mapBox.threebox;if(c){var f=c.camera,O=c.scene,W=this.mapBox.canvas,X=c.renderer;this.canvas=W,X.autoClear=!1;var J=new A(f,W);this.mxObject2d.mapBoxInitThreeJSObject(O,f,X,J)}else{this.mxObject2d.onInitViewScene(),O=new U.Scene;var te=(W=this.mapBox.canvas).clientHeight,ne=W.clientWidth;f=new U.OrthographicCamera(ne/-2,ne/2,te/2,te/-2,.1,1e21),this.canvas=W;var ue=new U.DirectionalLight(16777215);ue.position.set(0,-70,100).normalize(),O.add(ue);var be=new U.DirectionalLight(16777215);be.position.set(0,70,100).normalize(),O.add(be);var je=this.mxObject2d.getRendererParam();(je=je||{}).canvas=W,je.context=this.mapBox.gl,(X=new U.WebGLRenderer(je)).autoClear=!1,(J=new A(new U.Camera,W)).enabled=!1,this.mxObject2d.mapBoxInitThreeJSObject(O,f,X,J)}this.mxObject2d.initRendererParam({retver:"webgl2",webgl2:!0});var ve=this;this.mapBox.render=function(Be,q){var ge=new U.Matrix4().fromArray(q);ge.multiply(u.matCADDrawCoordToMap);var oe=new U.Vector3(0,0,0);if(oe.applyMatrix4(ge),1<oe.z){var le=1-oe.z-1e-5;ge=new U.Matrix4().makeTranslation(0,0,le).multiply(ge)}ve.mxObject2d.mapBoxRender(Be,ge,!!ve.mapBox.threebox),ve.mxObject2d.isRenderLoop()&&u.mapBox.map&&(u.mapBox.map.repaint=!0)},this.mapBox.onResize=function(){ve.mxObject2d.mapBox_onResizeImp(ve.canvas.clientWidth,ve.canvas.clientHeight)}},G.prototype.updateCameraForm3dViewData=function(u){console.log("assert(0) map does not support 3ddwg")},G.prototype.updateCameraDisplayRange=function(u,c,f){if(this.mxObject2d.isCppMxCAD()){(X=new U.Matrix4).makeTranslation(-this.mapBox.cadOrigin.x,-this.mapBox.cadOrigin.y,-this.mapBox.cadOrigin.z),(J=new U.Matrix4).makeTranslation(this.mapBox.mapOrigin.x,this.mapBox.mapOrigin.y,this.mapBox.elevation),(te=new U.Matrix4).makeScale(this.mapBox.mapLenInCADUnits,-this.mapBox.mapLenInCADUnits,this.mapBox.mapLenInCADUnits);var O=J.multiply(te).multiply(X),W=this.mxObject2d.getDoc2CADMatrix();this.matCADDrawCoordToMap=O.clone().multiply(W),this.mapBox.matcadtsmall=new U.Matrix4,this.mapBox.matcadtsmall.getInverse(W),this.mapBox.matCADDrawCoordToMap=this.matCADDrawCoordToMap,this.mapBox.matMapToCADDrawCoord=new U.Matrix4,this.mapBox.matMapToCADDrawCoord.getInverse(this.matCADDrawCoordToMap),this.mapBox.matCadToMap=O,this.mapBox.matMapToCad=new U.Matrix4,this.mapBox.matMapToCad.getInverse(O),1e-5<Math.abs(f)&&this.setViewAngle(f),this.zoomW(u,c,!0,!1)}else{var X,J,te;(X=new U.Matrix4).makeTranslation(-this.mapBox.cadOrigin.x,-this.mapBox.cadOrigin.y,-this.mapBox.cadOrigin.z),(J=new U.Matrix4).makeTranslation(this.mapBox.mapOrigin.x,this.mapBox.mapOrigin.y,this.mapBox.elevation),(te=new U.Matrix4).makeScale(this.mapBox.mapLenInCADUnits,-this.mapBox.mapLenInCADUnits,this.mapBox.mapLenInCADUnits);var ne=J.multiply(te).multiply(X),ue=this.mxObject2d.getWorldToDoc();this.matCADDrawCoordToMap=ne.clone().multiply(ue),this.mapBox.matcadtsmall=new U.Matrix4,this.mapBox.matcadtsmall.getInverse(ue),this.mapBox.matCADDrawCoordToMap=this.matCADDrawCoordToMap,this.mapBox.matMapToCADDrawCoord=new U.Matrix4,this.mapBox.matMapToCADDrawCoord.getInverse(this.matCADDrawCoordToMap),this.mapBox.matCadToMap=ne,this.mapBox.matMapToCad=new U.Matrix4,this.mapBox.matMapToCad.getInverse(ne)}},G);function G(u,c){var f=k.call(this,c)||this;return f.matCADDrawCoordToMap=new U.Matrix4,f.isPaning=!1,f.bakPan=!0,f.mapBox=u,f.mxObject2d=c,f.mapBox.matMapToCad=f.mapBox.matCadToMap=f.mapBox.matCADDrawCoordToMap=f.mapBox.matMapToCADDrawCoord=new U.Matrix4,f}o.MxDrawMapBoxThreeJS=S;var C,B=(v(R,C=N),R.prototype.onInitThreejs=function(){this.proxyObj.onInitThreejs()},R.prototype.onInitScene=function(){this.proxyObj.onInitScene()},R.prototype.getType=function(){return b.k3d},R.prototype.updateCameraDisplayRange=function(u,c,f){},R.prototype.updateCameraForm3dViewData=function(u){},R.prototype.addControlsChangeEvent=function(){var u=this.mxObject;this.mxObject.getOrbitControls().addEventListener("change",function(){V.MxJigCmdManager.OnThreeControlsChage(),u.callViewChange(),u.getMxDatabase().onViewChange(),u.getMcObject().isValid()&&u.getMcObject().getGripManager().onControlsChage(),u.getTempMarkDraw().clear(!0),u.updateDisplay()})},R.prototype.updateDisplay=function(u){u===void 0&&(u=!1),this.mxObject.updateDisplayImplement(u)},R.prototype.getRegistEventObject=function(){return this.mxObject.getCanvas()},R);function R(u){var c=C.call(this,u)||this;return c.proxyObj=u,c}o.MxDrawObject3dThreeJS=B},{"../Operate/MxJigCmdManager":54,"../UI/MxUiVue":65,three:19,"three-orbitcontrols":17}],76:[function(w,r,o){var a,v=this&&this.__extends||(a=function(T,_){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,k){Y.__proto__=k}||function(Y,k){for(var S in k)Object.prototype.hasOwnProperty.call(k,S)&&(Y[S]=k[S])})(T,_)},function(T,_){function Y(){this.constructor=T}a(T,_),T.prototype=_===null?Object.create(_):(Y.prototype=_.prototype,new Y)});function h(){}Object.defineProperty(o,"__esModule",{value:!0}),o.McDraw2d=o.McDraw3d=o.McDraw3dViewData=o.McDraw3dBase=void 0;var b=w("three"),D=w("../MxDrawData");o.McDraw3dBase=h;var U=(V.prototype.updateCamera=function(T,_,Y,k){var S=this.width,G=this.height;S<1e-5&&(S=1e-5),G<1e-5&&(G=1e-5);var C=Y/k,B=C*G;S<B?S=B:G=S/C,T.left=.5*-S,T.right=.5*S,T.top=.5*G,T.bottom=.5*-G,T.far=this.frontClip,T.near=this.backClip,T.up=this.up,T.zoom=1;var R=this.target.clone().add(this.dir);T.position.set(R.x,R.y,R.z),T.lookAt(this.target),T.updateProjectionMatrix(),_.target.x=this.target.x,_.target.y=this.target.y,_.target.z=this.target.z,_.update()},V);function V(){}o.McDraw3dViewData=U;var I,g=(v(A,I=h),A.prototype.is3DMode=function(){return!0},A.prototype.onResize=function(T,_,Y,k){var S=T.right-T.left,G=T.top-T.bottom;S<1e-5&&(S=1e-5),G<1e-5&&(G=1e-5);var C=Y/k,B=C*G;return S<B?S=B:G=S/C,T.left=.5*-S,T.right=.5*S,T.top=.5*G,T.bottom=.5*-G,T.updateProjectionMatrix(),_.update(),!0},A.prototype.initDisplayRange=function(T){var _=this.mcObject.mxObject;_.intiDoc2Wold(new b.Matrix4),_.initCAD2Doc(JSON.parse(T.DToSMat)),_.initializingObjectMatrix();var Y=new U;Y.dir=new b.Vector3(T.vecDirectionx,T.vecDirectiony,T.vecDirectionz),Y.up=new b.Vector3(T.vecUpx,T.vecUpy,T.vecUpz),Y.target=new b.Vector3(T.targetx,T.targety,T.targetz),Y.height=T.height,Y.width=T.width,Y.backClip=T.backClip,Y.frontClip=T.frontClip,_.updateCameraForm3dViewData(Y)},A);function A(){return I!==null&&I.apply(this,arguments)||this}o.McDraw3d=g;var M,N=(v(F,M=h),F.prototype.is3DMode=function(){return!1},F.prototype.initDisplayRange=function(T){var _=this.mcObject.mxObject;_.intiDoc2Wold(new b.Matrix4),_.initCAD2Doc(JSON.parse(T.DToSMat)),_.initializingObjectMatrix(),_.updateCameraDisplayRange(new b.Vector3(T.pt1x,T.pt1y,0),new b.Vector3(T.pt2x,T.pt2y,0),D.MxDrawData.m_isEnableDrawingViewAngle?T.viewangle:0)},F.prototype.onResize=function(T,_,Y,k){return this.mcObject.mxObject.callOnResizeImp(Y,k)},F);function F(){return M!==null&&M.apply(this,arguments)||this}o.McDraw2d=N},{"../MxDrawData":22,three:19}],77:[function(w,r,o){var a,v=this&&this.__extends||(a=function(S,G){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,B){C.__proto__=B}||function(C,B){for(var R in B)Object.prototype.hasOwnProperty.call(B,R)&&(C[R]=B[R])})(S,G)},function(S,G){function C(){this.constructor=S}a(S,G),S.prototype=G===null?Object.create(G):(C.prototype=G.prototype,new C)});Object.defineProperty(o,"__esModule",{value:!0}),o.McDrawGripJig=o.McDrawGrip=o.McDrawSlect=o.McDrawGripData=void 0;var h=w("three"),b=w("../MxFun"),D=w("../Operate/MxJig"),U=w("../Operate/MxJigCmdManager"),V=w("../MxManager"),I=w("../MxDrawData"),g=w("../MxTools"),A=function(){this.threeObject=null};o.McDrawGripData=A;var M=(N.prototype.add=function(S){return!this.setId.has(S)&&(this.setId.add(S),this.mcObj.HighlightEntity(S,!0),!0)},N.prototype.remove=function(S){this.setId.has(S)&&(this.setId.delete(S),this.mcObj.HighlightEntity(S,!1))},N.prototype.removeAll=function(){var S=this;this.setId.forEach(function(G){S.mcObj.HighlightEntity(G,!1)}),this.setId.clear()},N.prototype.getAllSelect=function(){var S=[];return this.setId.forEach(function(G,C){S.push(C)}),S},N.prototype.getSelectCount=function(){return this.setId.size},N.prototype.isEmpty=function(){return this.setId.size==0},N);function N(S){this.mcObj=null,this.setId=new Set,this.mcObj=S}o.McDrawSlect=M;var F=(T.prototype.fireSelectChange=function(){this.isCallingSelectChange||(this.isCallingSelectChange=!0,this.mxObj.callEvent("selectChange",this.getAllSelect()),this.isCallingSelectChange=!1)},T.prototype.getParentGroup=function(){return this.drawGroup||(this.drawGroup=new h.Group,this.drawGroup.renderOrder=V.MxData.iGripRenderOrder,this.mxObj.getTheTempDrawContainer_SmallCoord().add(this.drawGroup)),this.drawGroup},T.prototype.reInit=function(){this.clearAll(),this.drawGroup&&b.MxFun.removeThreejsObject(this.drawGroup,this.mxObj.getTheTempDrawContainer_SmallCoord()),this.drawGroup=null,this.selectPoint1=null,this.selectPoint2=null},T.prototype.removeAllEntity=function(){var S=this.getParentGroup();this.mapGrips.forEach(function(G,C,B){for(var R=G.length,u=0;u<R;u++){var c=G[u];b.MxFun.removeThreejsObject(c.threeObject,S)}}),this.mapGrips=new Map},T.prototype.deleteGripData=function(S){var G=this.getParentGroup(),C=this.mapGrips.get(S);if(C)for(var B=C.length,R=0;R<B;R++){var u=C[R];b.MxFun.removeThreejsObject(u.threeObject,G)}this.mapGrips.delete(S)},T.prototype.addGripData=function(S,G,C,B){var R=this.mapGrips.get(S);R==null&&(R=new Array,this.mapGrips.set(S,R));var u=new A;return u.iIndex=G,u.point=new h.Vector3(C,B),R.push(u),u},T.prototype.createGripDisplayObject=function(S){var G=this.getParentGroup();S.geometry=new h.Geometry;var C=this.mxObj.toSmallcoord2(S.point.x,S.point.y,S.point.z),B=this.mxObj.screenCoordLong2World(.5*I.MxDrawData.m_dInputRectWidth);S.geometry.vertices.push(new h.Vector3(C.x-B,C.y-B,0)),S.geometry.vertices.push(new h.Vector3(C.x-B,C.y+B,0)),S.geometry.vertices.push(new h.Vector3(C.x+B,C.y+B,0)),S.geometry.vertices.push(new h.Vector3(C.x+B,C.y-B,0)),S.geometry.faces.push(new h.Face3(0,1,2)),S.geometry.faces.push(new h.Face3(2,3,0)),S.geometry.computeFaceNormals(),S.geometry.computeVertexNormals();var R=g.MxTools.getColor(I.MxDrawData.m_gripPointColor),u=g.MxTools.getOpacity(I.MxDrawData.m_gripPointColor),c=new h.MeshBasicMaterial({color:R,transparent:!0,depthTest:!1,side:h.DoubleSide,opacity:u}),f=new h.Mesh(S.geometry,c);G.add(f),S.threeObject=f},T.prototype.setPrvCommandSelect=function(S){this.aryPrvCommandSelect=S},T.prototype.getPrvCommandSelect=function(){return this.aryPrvCommandSelect},T.prototype.getAllSelect=function(){return this.mcSelect.getAllSelect()},T.prototype.getSelectPoints=function(){var S=this.selectPoint1!==null;return S&&this.mcSelect.getSelectCount()==0&&this.aryPrvCommandSelect.length==0&&(S=!1),{point1:this.selectPoint1,point2:this.selectPoint2,isvalid:S}},T.prototype.clearAll=function(){var S=this.mcSelect.isEmpty();return this.mcSelect.removeAll(),this.mapGrips.size==0?!S:(this.removeAllEntity(),!0)},T.prototype.onControlsChage=function(){var S=this;if(this.mapGrips.size!=0){var G=this.mxObj.screenCoordLong2World(.5*I.MxDrawData.m_dInputRectWidth),C=!1;this.mapGrips.forEach(function(B,R,u){for(var c=B.length,f=0;f<c;f++){var O=B[f];if(O.geometry.vertices.length==4){var W=S.mxObj.cadCoord2Doc(O.point.x,O.point.y,O.point.z);O.geometry.vertices[0].x=W.x-G,O.geometry.vertices[0].y=W.y-G,O.geometry.vertices[1].x=W.x-G,O.geometry.vertices[1].y=W.y+G,O.geometry.vertices[2].x=W.x+G,O.geometry.vertices[2].y=W.y+G,O.geometry.vertices[3].x=W.x+G,O.geometry.vertices[3].y=W.y-G,O.geometry.computeFaceNormals(),O.geometry.computeVertexNormals(),O.geometry.verticesNeedUpdate=!0,C=!0}}}),C&&this.mxObj.resetRenderer()}},T.prototype.getGripNum=function(S){for(var G=new Set,C=S.length(),B=0;B<C;B++)G.add(S.at(B));var R=0;return this.mapGrips.forEach(function(u,c){G.has(c)||(R+=u.length)}),R},T.prototype.hitTest=function(S){var G={grips:new Array,ids:new Array,pt:S},C=new h.Vector3(S.x,S.y,0),B=this.mxObj.viewCoordLong2Cad(32);return this.mapGrips.forEach(function(R,u){for(var c=R.length,f=0;f<c;f++){var O=R[f];if(O.point.distanceTo(C)<=B){G.grips.push(O),G.ids.push(u),G.pt=O.point;break}}}),G},T.prototype.onMouseLBDown=function(S){if(I.MxDrawData.m_isEnableCADEntityGripEidt==1){if(!I.MxDrawData.m_isEnableGripEidt)return!1}else if(I.MxDrawData.m_isEnableCADEntityGripEidt==0)return!1;var G=this.hitTest(S);return G.grips.length!=0&&(b.MxFun.sendStringToExecute("McDraw_GripEdit",G),!0)},T.prototype.gripEditImp=function(S){var G=S.grips,C=S.ids,B=S.pt,R=new Y(B,G,C,this.mcObj);U.MxJigCmdManager.runCmd(R)},T.prototype.addGridDisplay=function(S,G){var C=this;S&&S.length()!=0&&(this.deleteGripData(G),S.forEach(function(B,R){var u=C.addGripData(G,R,B.x,B.y);C.createGripDisplayObject(u)}))},T.prototype.upEntityGridDisplay=function(S){if(!I.MxDrawData.m_isEnableGripEidt||S==0)return 0;var G=this.mcObj.ObjectIdToObject(S);if(!G)return 0;var C=G.getGripPoints();return this.addGridDisplay(C,S),C.length()},T.prototype.doPointSelect=function(S){if(!this.mcObj.mcObjectImp)return!1;var G=this.mxObj.docCoordLong2Cad(this.mxObj.screenCoordLong2Doc(10)),C=this.mxObj.screenCoord2Doc(S.x,S.y,0),B=this.mxObj.docCoord2Cad(C.x,C.y,C.z),R=this.mcObj.mcObjectImp.IntelliSelect_PointSelect(B.x,B.y,G),u=R.length();if(u==0)return this.mcObj.mxappimp.DestroyMdGeLongArray(R),!1;this.mxObj.pointMultipleSelect()||(this.mxObj.getMxDatabase().clearMxCurrentSelect(),this.clearAll());for(var c=u+this.mcSelect.getSelectCount(),f=0;f<u;f++){var O=R.at(f);this.mcSelect.add(O),c<100&&this.upEntityGridDisplay(O)}return this.selectPoint1=B,this.selectPoint2=B,this.fireSelectChange(),this.mcObj.mxappimp.DestroyMdGeLongArray(R),!0},T.prototype.doRangeSelect=function(S,G){if(this.mcObj.mcObjectImp){var C,B=S.clone(),R=G.clone();C=G.x<S.x?0:1;for(var u=this.mcObj.mcObjectImp.IntelliSelect_RangeSelect(B.x,B.y,R.x,R.y,C),c=u.length(),f=c+this.mcSelect.getSelectCount(),O=this.getGripNum(u),W=0;W<c;W++){var X=u.at(W);this.mcSelect.add(X),f<50&&O<200&&(O+=this.upEntityGridDisplay(X))}0<c&&(this.selectPoint1=B,this.selectPoint2=R,this.fireSelectChange()),this.mcObj.mxappimp.DestroyMdGeLongArray(u)}},T.prototype.addSelect=function(S,G,C){if(C===void 0&&(C=!0),S==0)return!1;var B=this.mcSelect.add(S);return C&&this.upEntityGridDisplay(S),G&&this.fireSelectChange(),B},T);function T(S,G){this.mxObj=null,this.mcObj=null,this.mcSelect=null,this.mapGrips=new Map,this.aryPrvCommandSelect=[],this.drawGroup=null,this.isCallingSelectChange=!1,this.selectPoint1=null,this.selectPoint2=null,this.mxObj=S,this.mcObj=G,this.mcSelect=new M(G)}o.McDrawGrip=F;var _,Y=(v(k,_=D.McEdJigCommand),k.prototype.onExitCommand=function(S){this.tempEntity=null,this.tempEntityWordDraw=null,_.prototype.onExitCommand.call(this,S)},k.prototype.sampler=function(){var S=U.MxJigCmdManager.InType.kGetBegan|U.MxJigCmdManager.InType.kGetEnd,G=this.acquirePoint(S);if(G.status==U.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=G.pt,this.tempEntity)){var C=new h.Vector3(G.pt.x,G.pt.y,G.pt.z),B=new h.Vector3(this.pt.x,this.pt.y,this.pt.z);this.tempEntityWordDraw=this.tempEntity.clone(),this.tempEntityWordDraw&&this.tempEntityWordDraw.moveGripPointsAt(this.grips[0].iIndex,C.x-B.x,C.y-B.y,C.z-B.z)}return G.status},k.prototype.getTypeName=function(){return"McDrawGripEdit"},k.prototype.done=function(S){if(S==U.MxJigCmdManager.DragStatus.kNormal){for(var G=new h.Vector3(this.pt.x,this.pt.y,this.pt.z),C=new h.Vector3(this.currPt.x,this.currPt.y,this.currPt.z),B=C.x-G.x,R=C.y-G.y,u=this.getMxObject().getMcObject().getGripManager(),c=this.grips.length,f=[],O=0;O<c;O++){var W=this.grips[O],X=this.ids[O],J=this.mcObj.ObjectIdToObject(X);J&&J.moveGripPointsAt(W.iIndex,B,R,0),u.upEntityGridDisplay(X),f.push({type:"mxcad",id:X,index:W.iIndex,curentPoint:this.currPt,point:W.point,offset_x:B,offset_y:R})}0<f.length&&this._mxObject.callEvent("objectGripEdit",f)}return U.MxJigCmdManager.DoneStatius.kExitCommand},k.prototype.upDisplay=function(){this.mcObj.onReadyJigUpdateDispla(1,this.currPt),this.tempEntityWordDraw.tempRelationObject(),this.mcObj.onJigDrawEntityDisplay(this.tempEntityWordDraw.getImp()),this.tempEntityWordDraw.freeTempRelationObject()},k);function k(S,G,C,B){var R=_.call(this)||this;return R.pt=S,R.grips=G,R.ids=C,R.currPt=S,R.mcObj=B,R.ids.length&&(R.tempEntity=B.ObjectIdToObject(R.ids[0])),R}o.McDrawGripJig=Y},{"../MxDrawData":22,"../MxFun":27,"../MxManager":29,"../MxTools":38,"../Operate/MxJig":53,"../Operate/MxJigCmdManager":54,three:19}],78:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.McDrawObject=void 0;var a=w("../MxManager"),v=w("three"),h=w("../MxFun"),b=w("./McDrawGrip"),D=w("./McTextureManager"),U=w("./McDraw3D"),V=window;V.McDrawObjectEvent_openFileComplete=function(A,M,N){var F=a.MxManager.getMxObject(M);F&&F.getMcObject().openFileComplete(A,N)},V.McDrawObjectEvent_call=function(A,M,N){if(M=="mxpost")try{var F=JSON.parse(N);if(F&&F.url&&F.data){var T=new XMLHttpRequest;T.open("POST",F.url,!0),T.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),T.onreadystatechange=function(){T.readyState===4&&T.status},T.send(F.data)}}catch(Y){}else if(M=="regen_complete"){if(!(_=a.MxManager.getMxObject(A)))return;_.regenAllMxDbEntity()}else{var _;if(!(_=a.MxManager.getMxObject(A)))return;_.callEvent(M,N)}},V.McDrawObjectEvent_synchronizeuUdateDisplayRange=function(A,M){var N=a.MxManager.getMxObject(A);N&&N.getMcObject().updateDisplayRange(M==1)},V.McDrawObjectEvent_osnapComplete=function(A,M){var N=a.MxManager.getMxObject(A);N&&N.getMcObject().callOsnapComplete(M)},V.McDrawObjectEvent_mcutPrintf=function(A){h.MxFun.acutPrintf(A)},V.McDrawObjectEvent_updateDisplay=function(A){var M=a.MxManager.getMxObject(A);M&&M.updateDisplay()},V.McDrawObjectEvent_loadImages=function(A,M,N,F){var T=a.MxManager.getMxObject(A);if(T){T.getMcObject().getTextureManager().clear();var _=0,Y=[];F.substring(0,5)=="blob:"&&(F=F.substring(5)),M.forEach(function(k){var S=a.MxManager.getMxCpp().decodeFromGb2312(k),G=S;S.lastIndexOf("/")==-1?(N&&0<N.length&&(G=N+"/"+G),F&&0<F.length&&(G=F+"/"+G)):S=S.substring(S.lastIndexOf("/")+1).toLowerCase(),Y.push(G),T.getMcObject().getTextureManager().loadImage(G,S,function(){++_==M.length&&(Y.forEach(function(C){T.getMcObject().getTextureManager().createOpenGLTexture(C)}),T.updateDisplay(!1))})})}},V.McDrawObjectEvent_loadImagesBase64=function(A,M){var N=a.MxManager.getMxObject(A);if(N){var F=M.indexOf("data:image/png;base64");if(F!=-1){var T=M.substring(0,F);M=M.substring(F),N.getMcObject().getTextureManager().loadImageBase64(T,M,function(){N.getMcObject().getTextureManager().createOpenGLTexture(T),N.updateDisplay(!1)})}}};var I=(g.prototype.getTextureManager=function(){return this.textureManager},g.prototype.isValid=function(){return this.mcObjectImp!==null},g.prototype.isPaperSpaceDisplay=function(){return!!this.mcObjectImp&&this.mcObjectImp.isPaperSpaceDisplay()},g.prototype.fireStartRunCommand=function(A,M){this.mcObjectImp&&this.mcObjectImp.fireStartRunCommand(A,M)},g.prototype.fireEndRunCommand=function(A,M){this.mcObjectImp&&this.mcObjectImp.fireEndRunCommand(A,M)},g.prototype.undo=function(){this.mcObjectImp&&this.mcObjectImp.undo()},g.prototype.redo=function(){this.mcObjectImp&&this.mcObjectImp.redo()},g.prototype.initCAD2Doc=function(A,M){this.matCad2doc=A,this.matDoc2cad=M},g.prototype.getSysVarLong=function(A){return this.mcObjectImp.GetSysVarLong(A)},g.prototype.getSysVarDouble=function(A){return this.mcObjectImp.GetSysVarDouble(A)},g.prototype.getSysVarPoint=function(A){var M=this.mcObjectImp.GetSysVarPoint(A);return new v.Vector3(M.x,M.y,M.z)},g.prototype.ObjectIdToMdObjectImp=function(A){return this.mcObjectImp?this.mxcpp.App.getImp().ObjectIdToMdObject(A):null},g.prototype.DestroyObject=function(A){if(!this.mcObjectImp)return null;this.mcObject.destroyObject(A)},g.prototype.onJigCommandEnd=function(){this.mcObjectImp&&this.mcObjectImp.EntityTempWordDraw_onJigCommandEnd()},g.prototype.callOsnapComplete=function(A){if(this.m_retCall&&A)try{var M=A;if(typeof A=="string"&&(M=JSON.parse(A)),M.callId!=this.m_lOsnapCallCount)return;this.m_retCall(M)}catch(N){}},g.prototype.doc2cad1=function(A){return A},g.prototype.doc2cad2=function(A,M){return new v.Vector3(A,M,0)},g.prototype.cad2doc1=function(A){return A},g.prototype.cad2doc2=function(A,M){return new v.Vector3(A,M,0)},g.prototype.onNotifyOsnap=function(A,M){if(this.mcObjectImp){this.m_lOsnapCallCount++,this.m_retCall=M,1e5<this.m_lOsnapCallCount&&(this.m_lOsnapCallCount=1);var N,F=this.doc2cad2(A.ptx,A.pty);A.isValidPrvInputPoint&&(N=this.doc2cad2(A.prvPtx,A.prvPty)),this.mcObjectImp.Osnap_NotifyOsnap(F.x,F.y,A.isValidPrvInputPoint,A.isValidPrvInputPoint?N.x:0,A.isValidPrvInputPoint?N.y:0,A.osmode,A.SearchRnge,this.m_lOsnapCallCount)}},g.prototype.DrawEntity=function(A,M,N){A&&this.mcObjectImp&&(M&&A.SetTrueColor(this.THREEColor2MdCmColor(M)),this.mcObjectImp.DrawEntity(A,N))},g.prototype.onJigDrawEntityDisplay=function(A,M,N){A&&this.mcObjectImp&&(M&&A.SetTrueColor(this.THREEColor2MdCmColor(M)),this.mcObjectImp.EntityTempWordDraw_onJigDrawEntityDisplay(A,N===!0))},g.prototype.THREEColor2MdCmColor=function(A){var M=new v.Color(A),N=new this.mxcppImp.MdCmColor;return N.setRGB(255*M.r,255*M.g,255*M.b),N},g.prototype.onJigDrawEntityDisplay_line=function(A,M,N,F,T,_,Y){if(this.mcObjectImp){var k=new this.mxcppImp.MdDbLine,S=new this.mxcppImp.MdGePoint3d;S.x=A,S.y=M,S.z=N,k.setStartPoint(S);var G=new this.mxcppImp.MdGePoint3d;G.x=F,G.y=T,G.z=_,k.setEndPoint(G),k.SetTrueColor(this.THREEColor2MdCmColor(Y)),this.mcObjectImp.EntityTempWordDraw_onJigDrawEntityDisplay(k,!1)}},g.prototype.DrawLine=function(A,M,N,F,T,_,Y){if(this.mcObjectImp){var k=new this.mxcppImp.MdDbLine,S=new this.mxcppImp.MdGePoint3d;S.x=A,S.y=M,S.z=N,k.setStartPoint(S);var G=new this.mxcppImp.MdGePoint3d;G.x=F,G.y=T,G.z=_,k.setEndPoint(G),k.SetTrueColor(this.THREEColor2MdCmColor(Y)),this.mcObjectImp.DrawEntity(k,!1)}},g.prototype.HighlightEntity=function(A,M){if(!this.mcDrawUtility)return!1;this.mcDrawUtility.highlightEntity(A,M)},g.prototype.onReadyJigUpdateDispla=function(A,M){A===void 0&&(A=0),M===void 0&&(M=void 0),this.mcObjectImp&&this.mcObjectImp.EntityTempWordDraw_onReadyJigUpdateDispla(A,M?M.x:0,M?M.y:0)},g.prototype.onJigClearDisplay=function(){this.mcObjectImp&&this.mcObjectImp.EntityTempWordDraw_onJigClearDisplay()},g.prototype.ObjectIdToObject=function(A){return this.mcObject?this.mxcpp.App.objectIdToObject(A):null},g.prototype.initMxObject=function(A){this.mxObject=A},g.prototype.init=function(A,M){M.initMxObject(A),this.mxObject=A,this.mcObject=M,this.mcObjectImp=M.getImp(),this.mxcpp=M.getMxCpp(),this.mxcppImp=this.mxcpp.mxcadassemblyimp,this.mxapp=this.mxcpp.App,this.mxappimp=this.mxapp.getImp(),this.grip=new b.McDrawGrip(A,this),this.mcDrawUtility=new this.mxcppImp.McDrawUtility,this.textureManager=new D.McTextureManager(this,A.getRenderer().getContext());var N=this;this.mxObject.addEvent("dragWillEnd",function(){N.mcObjectImp.fireEventDragWillEnd()})},g.prototype.setSize=function(A,M){if(!this.mcObjectImp)return!1;this.mcObjectImp.fireEventWindowSize(A,M)},g.prototype.getGripManager=function(){return this.grip},g.prototype.updateDisplayRange=function(A){if(A===void 0&&(A=!1),this.mcObjectImp){var M=this.mcObjectImp.getViewDataJsonParam(A);M=M.replace(/\\/g,"\\\\");try{var N=JSON.parse(M),F=this.mxObject;if(N!=null){N.is3d?this.mxdraw3d.is3DMode()||(this.mxdraw3d=new U.McDraw3d,this.mxdraw3d.mcObject=this):this.mxdraw3d.is3DMode()&&(this.mxdraw3d=new U.McDraw2d,this.mxdraw3d.mcObject=this),this.mxdraw3d.initDisplayRange(N),F.initAllLayoutName(JSON.parse(N.layout)),F.updateDisplay(!0);var T=h.MxFun.getUiObj();T!=null&&(T.SetLayoutData(N.layout),T.UpDisplayLayout())}}catch(_){console.log("getViewDataJsonParam exception")}}},g.prototype.openFileComplete=function(A,M){this.updateDisplayRange(),this.mxObject.callOpenFileComplete(A,M)},g.prototype.updateDisplayMapBox=function(A){return!!this.mcObjectImp&&(this.mxObject.getScene().background!==null&&console.log("mxerror: background must be empty"),this.mcObjectImp_updateDisplay(new v.Matrix4().elements,A.elements))},g.prototype.mcObjectImp_updateDisplay=function(A,M){if(this.m_isCallingUpDisplay)return!0;var N=!(this.m_isCallingUpDisplay=!0);try{N=this.mcObjectImp.updateDisplay(A,M),this.m_isCallingUpDisplay=!1}catch(F){this.m_isCallingUpDisplay=!1,console.log(F)}return N},g.prototype.updateDisplay=function(){if(!this.mcObjectImp)return!1;var A=this.mxObject.getCamera();this.mxObject.getScene().background!==null&&console.log("mxerror: background must be empty");var M=new v.Matrix4;M.multiplyMatrices(A.matrixWorldInverse,this.mxObject.getDoc2World());var N=A.projectionMatrix;return this.mcObjectImp_updateDisplay(M.elements,N.elements)},g.prototype.updateDisplayMatrixData=function(A){if(this.mcObjectImp){var M=this.mxObject.getCamera(),N=new v.Matrix4;N.multiplyMatrices(M.matrixWorldInverse,this.mxObject.getDoc2World());var F=M.projectionMatrix;return this.mcObjectImp.updateDisplayMatrixData(N.elements,F.elements,!!A)}},g.prototype.setViewAngle=function(A){this.mcObjectImp&&this.mcObjectImp.fireViewAngleChange(A)},g.prototype.createTexture=function(){return this.mcObjectImp.createTexture()},g.prototype.deleteTexture=function(A){return this.mcObjectImp.deleteTexture(A)},g.prototype.bindTexture=function(A,M){return this.mcObjectImp.bindTexture(A,M)},g.prototype.allocTextureHandle=function(A){return this.mcObjectImp.allocTextureHandle(A)},g.prototype.registTexture=function(A,M){return this.mcObjectImp.registTexture(A,M)},g.prototype.makeCurrent=function(){this.mcObjectImp&&this.mcObjectImp.makeCurrent()},g);function g(){this.grip=null,this.mcObjectImp=null,this.mxcppImp=null,this.mxcpp=null,this.mcObject=null,this.mxapp=null,this.mxappimp=null,this.mcDrawUtility=null,this.m_lOsnapCallCount=1,this.m_retCall=null,this.matCad2doc=new v.Matrix4,this.matDoc2cad=new v.Matrix4,this.m_isCallingUpDisplay=!1,this.mxdraw3d=new U.McDraw2d,this.mxdraw3d.mcObject=this}o.McDrawObject=I},{"../MxFun":27,"../MxManager":29,"./McDraw3D":76,"./McDrawGrip":77,"./McTextureManager":79,three:19}],79:[function(w,r,o){Object.defineProperty(o,"__esModule",{value:!0}),o.McTextureManager=void 0;var a=w("three"),v=w("../MxManager"),h=(b.prototype.get=function(V){if(this.extensions[V]!==void 0)return this.extensions[V];var I;switch(V){case"WEBGL_depth_texture":I=this.gl.getExtension("WEBGL_depth_texture")||this.gl.getExtension("MOZ_WEBGL_depth_texture")||this.gl.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":I=this.gl.getExtension("EXT_texture_filter_anisotropic")||this.gl.getExtension("MOZ_EXT_texture_filter_anisotropic")||this.gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":I=this.gl.getExtension("WEBGL_compressed_texture_s3tc")||this.gl.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||this.gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":I=this.gl.getExtension("WEBGL_compressed_texture_pvrtc")||this.gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:I=this.gl.getExtension(V)}return I===null&&console.warn("THREE.WebGLRenderer: "+V+" extension not supported."),this.extensions[V]=I},b);function b(V){this.extensions={},this.gl=V}var D=(U.prototype.allocHandle=function(V){return this.mcObject.allocTextureHandle(v.MxManager.getMxCpp().encodeToGb2312(V))},U.prototype.convert=function(V){var I;if(V===a.UnsignedByteType)return 5121;if(V===a.UnsignedShort4444Type)return 32819;if(V===a.UnsignedShort5551Type)return 32820;if(V===a.UnsignedShort565Type)return 33635;if(V===a.ByteType)return 5120;if(V===a.ShortType)return 5122;if(V===a.UnsignedShortType)return 5123;if(V===a.IntType)return 5124;if(V===a.UnsignedIntType)return 5125;if(V===a.FloatType)return 5126;if(V===a.HalfFloatType)return this.isWebGL2?5131:(I=this.extensions.get("OES_texture_half_float"))!==null?I.HALF_FLOAT_OES:null;if(V===a.AlphaFormat)return 6406;if(V===a.RGBFormat)return 6407;if(V===a.RGBAFormat)return 6408;if(V===a.LuminanceFormat)return 6409;if(V===a.LuminanceAlphaFormat)return 6410;if(V===a.DepthFormat)return 6402;if(V===a.DepthStencilFormat)return 34041;if(V===a.RedFormat)return 6403;if(V===a.RedIntegerFormat)return 36244;if(V===a.RGFormat)return 33319;if(V===a.RGIntegerFormat)return 33320;if(V===a.RGBIntegerFormat)return 36248;if(V===a.RGBAIntegerFormat)return 36249;if(V===a.RGB_S3TC_DXT1_Format||V===a.RGBA_S3TC_DXT1_Format||V===a.RGBA_S3TC_DXT3_Format||V===a.RGBA_S3TC_DXT5_Format){if((I=this.extensions.get("WEBGL_compressed_texture_s3tc"))===null)return null;if(V===a.RGB_S3TC_DXT1_Format)return I.COMPRESSED_RGB_S3TC_DXT1_EXT;if(V===a.RGBA_S3TC_DXT1_Format)return I.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(V===a.RGBA_S3TC_DXT3_Format)return I.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(V===a.RGBA_S3TC_DXT5_Format)return I.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(V===a.RGB_PVRTC_4BPPV1_Format||V===a.RGB_PVRTC_2BPPV1_Format||V===a.RGBA_PVRTC_4BPPV1_Format||V===a.RGBA_PVRTC_2BPPV1_Format){if((I=this.extensions.get("WEBGL_compressed_texture_pvrtc"))===null)return null;if(V===a.RGB_PVRTC_4BPPV1_Format)return I.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(V===a.RGB_PVRTC_2BPPV1_Format)return I.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(V===a.RGBA_PVRTC_4BPPV1_Format)return I.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(V===a.RGBA_PVRTC_2BPPV1_Format)return I.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return V===a.RGB_ETC1_Format?(I=this.extensions.get("WEBGL_compressed_texture_etc1"))!==null?I.COMPRESSED_RGB_ETC1_WEBGL:null:V===a.RGBA_ASTC_4x4_Format||V===a.RGBA_ASTC_5x4_Format||V===a.RGBA_ASTC_5x5_Format||V===a.RGBA_ASTC_6x5_Format||V===a.RGBA_ASTC_6x6_Format||V===a.RGBA_ASTC_8x5_Format||V===a.RGBA_ASTC_8x6_Format||V===a.RGBA_ASTC_8x8_Format||V===a.RGBA_ASTC_10x5_Format||V===a.RGBA_ASTC_10x6_Format||V===a.RGBA_ASTC_10x8_Format||V===a.RGBA_ASTC_10x10_Format||V===a.RGBA_ASTC_12x10_Format||V===a.RGBA_ASTC_12x12_Format?(I=this.extensions.get("WEBGL_compressed_texture_astc"))!==null?V:null:V===a.UnsignedInt248Type?this.isWebGL2?34042:(I=this.extensions.get("WEBGL_depth_texture"))!==null?I.UNSIGNED_INT_24_8_WEBGL:null:void 0},U.prototype.textureNeedsPowerOfTwo=function(V){return V.wrapS!==1001||V.wrapT!==1001||V.minFilter!==1003&&V.minFilter!==1006},U.prototype.createCanvas=function(V,I){return document.createElementNS("http://www.w3.org/1999/xhtml","canvas")},U.prototype.floorPowerOfTwo=function(V){return Math.pow(2,Math.floor(Math.log(V)/Math.LN2))},U.prototype.resizeImage=function(V,I,g,A){var M=1;if((V.width>A||V.height>A)&&(M=A/Math.max(V.width,V.height)),M<1||I===!0){if(typeof HTMLImageElement!="undefined"&&V instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&V instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&V instanceof ImageBitmap){var N=I?this.floorPowerOfTwo:Math.floor,F=N(M*V.width),T=N(M*V.height);this._canvas===void 0&&(this._canvas=this.createCanvas(F,T));var _=g?this.createCanvas(F,T):this._canvas;return _.width=F,_.height=T,_.getContext("2d").drawImage(V,0,0,F,T),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+V.width+"x"+V.height+") to ("+F+"x"+T+")."),_}return"data"in V&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+V.width+"x"+V.height+")."),V}return V},U.prototype.mathIsPowerOfTwo=function(V){return(V&V-1)==0&&V!==0},U.prototype.isPowerOfTwo=function(V){return this.mathIsPowerOfTwo(V.width)&&this.mathIsPowerOfTwo(V.height)},U.prototype.getInternalFormat=function(V,I,g){if(this.isWebGL2===!1)return I;if(V!==null){if(this._gl[V]!==void 0)return this._gl[V];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+V+"'")}var A=I;return I===6403&&(g===5126&&(A=33326),g===5131&&(A=33325),g===5121&&(A=33321)),I===6407&&(g===5126&&(A=34837),g===5131&&(A=34843),g===5121&&(A=32849)),I===6408&&(g===5126&&(A=34836),g===5131&&(A=34842),g===5121&&(A=32856)),A===33325||A===33326||A===34842||A===34836?this.extensions.get("EXT_color_buffer_float"):A!==34843&&A!==34837||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),A},U.prototype.filterFallback=function(V){return V===a.NearestFilter||V===a.NearestMipmapNearestFilter||V===a.NearestMipmapLinearFilter?9728:9729},U.prototype.setTextureParameters=function(V,I,g){var A={};A[a.RepeatWrapping]=10497,A[a.ClampToEdgeWrapping]=33071,A[a.MirroredRepeatWrapping]=33648;var M={};M[a.NearestFilter]=9728,M[a.NearestMipmapNearestFilter]=9984,M[a.NearestMipmapLinearFilter]=9986,M[a.LinearFilter]=9729,M[a.LinearMipmapNearestFilter]=9985,M[a.LinearMipmapLinearFilter]=9987,g?(this._gl.texParameteri(V,10242,A[I.wrapS]),this._gl.texParameteri(V,10243,A[I.wrapT]),V!==32879&&V!==35866||this._gl.texParameteri(V,32882,A[I.wrapR]),this._gl.texParameteri(V,10240,M[I.magFilter]),this._gl.texParameteri(V,10241,M[I.minFilter])):(this._gl.texParameteri(V,10242,33071),this._gl.texParameteri(V,10243,33071),V!==32879&&V!==35866||this._gl.texParameteri(V,32882,33071),I.wrapS===a.ClampToEdgeWrapping&&I.wrapT===a.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),this._gl.texParameteri(V,10240,this.filterFallback(I.magFilter)),this._gl.texParameteri(V,10241,this.filterFallback(I.minFilter)),I.minFilter!==a.NearestFilter&&I.minFilter!==a.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."))},U.prototype.textureNeedsGenerateMipmaps=function(V,I){return V.generateMipmaps&&I&&V.minFilter!==a.NearestFilter&&V.minFilter!==a.LinearFilter},U.prototype.generateMipmap=function(V,I,g,A,M){this._gl.generateMipmap(I)},U.prototype.clear=function(){var V=this;Object.keys(this.mapImagePathToTexture).forEach(function(I){var g=V.mapImagePathToTexture[I];g&&g.webglTexture&&V.mcObject.deleteTexture(g.webglTexture)}),this.mapImagePathToTexture={}},U.prototype.loadImage=function(V,I,g){if(this.mapImagePathToTexture[V]){var A=this.mapImagePathToTexture[V];return A&&A.isload&&A.texture?g(!0,A.texture.image):g(!1,void 0),0}var M={isload:!1,texture:null,handle:this.allocHandle(I),webglTexture:void 0};this.mapImagePathToTexture[V]=M;var N=v.MxManager.getLoadImageFuction();return N&&N(V,function(F){M.isload=!0,M.texture=F,g(!0,F.image)},function(F){M.isload=!1,g(!1,void 0)})!=0||new a.TextureLoader().load(V,function(F){M.isload=!0,M.texture=F,g(!0,F.image)},void 0,function(F){M.isload=!1,g(!1,void 0)}),M.handle},U.prototype.loadImageBase64=function(V,I,g){if(this.mapImagePathToTexture[V]){var A=this.mapImagePathToTexture[V];return A&&A.isload&&A.texture?g(!0,A.texture.image):g(!1,void 0),0}var M={isload:!1,texture:null,handle:this.allocHandle(V),webglTexture:void 0};return this.mapImagePathToTexture[V]=M,new a.TextureLoader().load(I,function(N){M.isload=!0,M.texture=N,g(!0,N.image)},void 0,function(N){M.isload=!1,g(!1,void 0)}),M.handle},U.prototype.createOpenGLTexture=function(V){var I=this.mapImagePathToTexture[V];if(!I||!I.isload||I.webglTexture)return!1;var g=I.texture;I.webglTexture=this.mcObject.createTexture(),this._gl.activeTexture(33984),this.mcObject.bindTexture(3553,I.webglTexture),this._gl.pixelStorei(37440,g.flipY),this._gl.pixelStorei(37441,g.premultiplyAlpha),this._gl.pixelStorei(3317,g.unpackAlignment);var A=this._gl.getParameter(3379),M=this.textureNeedsPowerOfTwo(g)&&this.isPowerOfTwo(g.image)===!1,N=this.resizeImage(g.image,M,!1,A),F=this.isPowerOfTwo(N)||this.isWebGL2,T=this.convert(g.format),_=this.convert(g.type),Y=this.getInternalFormat(g.internalFormat,T,_);this.setTextureParameters(3553,g,F);var k,S=g.mipmaps;if(g.isDataTexture){var G=!0;if(this._gl.texStorage2D||(G=!1),0<S.length&&F){for(var C=0,B=S.length;C<B;C++)k=S[C],this._gl.texImage2D(3553,C,Y,k.width,k.height,0,T,_,k.data);g.generateMipmaps=!1}else G?(this._gl.texStorage2D(3553,1,Y,N.width,N.height),this._gl.texSubImage2D(3553,0,0,0,N.width,N.height,T,_,N.data)):this._gl.texImage2D(3553,0,Y,N.width,N.height,0,T,_,N.data)}else if(0<S.length&&F){for(C=0,B=S.length;C<B;C++)k=S[C],this._gl.texImage2D(3553,C,Y,T,_,k);g.generateMipmaps=!1}else this._gl.texImage2D(3553,0,Y,T,_,N);this.textureNeedsGenerateMipmaps(g,F)&&this.generateMipmap(I,3553,g,N.width,N.height),this.mcObject.registTexture(I.handle,I.webglTexture)},U);function U(V,I){this.mapImagePathToTexture={},this.mcObject=V,this._gl=I,this.extensions=new h(I),this.isWebGL2=typeof WebGL2RenderingContext!="undefined"&&I instanceof WebGL2RenderingContext}o.McTextureManager=D},{"../MxManager":29,three:19}]},{},[58])}function registerMxDbEntity(){store.events.emit("MxDbEntityRegister")}let registerList=[];function addRegisterMxDbEntity(w){w.isRegister=!1;const r=()=>{!w.isRegister&&w.register&&w.register(),store.events.off("stateChange",r)};registerList.push(r)}const callRegisterMxDbEntityLists=()=>{registerList.forEach(w=>{w&&w()}),registerList=[]};store.events.on("MxDbEntityRegister",callRegisterMxDbEntityLists);var commonjsGlobal=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function unwrapExports(w){return w&&w.__esModule&&Object.prototype.hasOwnProperty.call(w,"default")?w.default:w}function createCommonjsModule(w,r){return w(r={exports:{}},r.exports),r.exports}var jquery=createCommonjsModule(function(w){var r,o;r=typeof window!="undefined"?window:commonjsGlobal,o=function(a,v){var h=[],b=Object.getPrototypeOf,D=h.slice,U=h.flat?function(y){return h.flat.call(y)}:function(y){return h.concat.apply([],y)},V=h.push,I=h.indexOf,g={},A=g.toString,M=g.hasOwnProperty,N=M.toString,F=N.call(Object),T={},_=function(y){return typeof y=="function"&&typeof y.nodeType!="number"&&typeof y.item!="function"},Y=function(y){return y!=null&&y===y.window},k=a.document,S={type:!0,src:!0,nonce:!0,noModule:!0};function G(y,E,K){var re,de,fe=(K=K||k).createElement("script");if(fe.text=y,E)for(re in S)(de=E[re]||E.getAttribute&&E.getAttribute(re))&&fe.setAttribute(re,de);K.head.appendChild(fe).parentNode.removeChild(fe)}function C(y){return y==null?y+"":typeof y=="object"||typeof y=="function"?g[A.call(y)]||"object":typeof y}var B="3.7.0",R=/HTML$/i,u=function(y,E){return new u.fn.init(y,E)};function c(y){var E=!!y&&"length"in y&&y.length,K=C(y);return!_(y)&&!Y(y)&&(K==="array"||E===0||typeof E=="number"&&E>0&&E-1 in y)}function f(y,E){return y.nodeName&&y.nodeName.toLowerCase()===E.toLowerCase()}u.fn=u.prototype={jquery:B,constructor:u,length:0,toArray:function(){return D.call(this)},get:function(y){return y==null?D.call(this):y<0?this[y+this.length]:this[y]},pushStack:function(y){var E=u.merge(this.constructor(),y);return E.prevObject=this,E},each:function(y){return u.each(this,y)},map:function(y){return this.pushStack(u.map(this,function(E,K){return y.call(E,K,E)}))},slice:function(){return this.pushStack(D.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(u.grep(this,function(y,E){return(E+1)%2}))},odd:function(){return this.pushStack(u.grep(this,function(y,E){return E%2}))},eq:function(y){var E=this.length,K=+y+(y<0?E:0);return this.pushStack(K>=0&&K<E?[this[K]]:[])},end:function(){return this.prevObject||this.constructor()},push:V,sort:h.sort,splice:h.splice},u.extend=u.fn.extend=function(){var y,E,K,re,de,fe,_e=arguments[0]||{},Me=1,Se=arguments.length,Ve=!1;for(typeof _e=="boolean"&&(Ve=_e,_e=arguments[Me]||{},Me++),typeof _e=="object"||_(_e)||(_e={}),Me===Se&&(_e=this,Me--);Me<Se;Me++)if((y=arguments[Me])!=null)for(E in y)re=y[E],E!=="__proto__"&&_e!==re&&(Ve&&re&&(u.isPlainObject(re)||(de=Array.isArray(re)))?(K=_e[E],fe=de&&!Array.isArray(K)?[]:de||u.isPlainObject(K)?K:{},de=!1,_e[E]=u.extend(Ve,fe,re)):re!==void 0&&(_e[E]=re));return _e},u.extend({expando:"jQuery"+(B+Math.random()).replace(/\D/g,""),isReady:!0,error:function(y){throw new Error(y)},noop:function(){},isPlainObject:function(y){var E,K;return!(!y||A.call(y)!=="[object Object]"||(E=b(y))&&(typeof(K=M.call(E,"constructor")&&E.constructor)!="function"||N.call(K)!==F))},isEmptyObject:function(y){var E;for(E in y)return!1;return!0},globalEval:function(y,E,K){G(y,{nonce:E&&E.nonce},K)},each:function(y,E){var K,re=0;if(c(y))for(K=y.length;re<K&&E.call(y[re],re,y[re])!==!1;re++);else for(re in y)if(E.call(y[re],re,y[re])===!1)break;return y},text:function(y){var E,K="",re=0,de=y.nodeType;if(de){if(de===1||de===9||de===11)return y.textContent;if(de===3||de===4)return y.nodeValue}else for(;E=y[re++];)K+=u.text(E);return K},makeArray:function(y,E){var K=E||[];return y!=null&&(c(Object(y))?u.merge(K,typeof y=="string"?[y]:y):V.call(K,y)),K},inArray:function(y,E,K){return E==null?-1:I.call(E,y,K)},isXMLDoc:function(y){var E=y&&y.namespaceURI,K=y&&(y.ownerDocument||y).documentElement;return!R.test(E||K&&K.nodeName||"HTML")},merge:function(y,E){for(var K=+E.length,re=0,de=y.length;re<K;re++)y[de++]=E[re];return y.length=de,y},grep:function(y,E,K){for(var re=[],de=0,fe=y.length,_e=!K;de<fe;de++)!E(y[de],de)!==_e&&re.push(y[de]);return re},map:function(y,E,K){var re,de,fe=0,_e=[];if(c(y))for(re=y.length;fe<re;fe++)(de=E(y[fe],fe,K))!=null&&_e.push(de);else for(fe in y)(de=E(y[fe],fe,K))!=null&&_e.push(de);return U(_e)},guid:1,support:T}),typeof Symbol=="function"&&(u.fn[Symbol.iterator]=h[Symbol.iterator]),u.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(y,E){g["[object "+E+"]"]=E.toLowerCase()});var O=h.pop,W=h.sort,X=h.splice,J="[\\x20\\t\\r\\n\\f]",te=new RegExp("^"+J+"+|((?:^|[^\\\\])(?:\\\\.)*)"+J+"+$","g");u.contains=function(y,E){var K=E&&E.parentNode;return y===K||!(!K||K.nodeType!==1||!(y.contains?y.contains(K):y.compareDocumentPosition&&16&y.compareDocumentPosition(K)))};var ne=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function ue(y,E){return E?y==="\0"?"�":y.slice(0,-1)+"\\"+y.charCodeAt(y.length-1).toString(16)+" ":"\\"+y}u.escapeSelector=function(y){return(y+"").replace(ne,ue)};var be=k,je=V;(function(){var y,E,K,re,de,fe,_e,Me,Se,Ve,rt=je,ft=u.expando,ct=0,Lt=0,kn=li(),Pt=li(),Hn=li(),Yr=li(),zr=function(ke,ot){return ke===ot&&(de=!0),0},ca="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",Ta="(?:\\\\[\\da-fA-F]{1,6}"+J+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",dr="\\["+J+"*("+Ta+")(?:"+J+"*([*^$|!~]?=)"+J+`*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(`+Ta+"))|)"+J+"*\\]",Ca=":("+Ta+`)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|`+dr+")*)|.*)\\)|)",vr=new RegExp(J+"+","g"),Wn=new RegExp("^"+J+"*,"+J+"*"),lo=new RegExp("^"+J+"*([>+~]|"+J+")"+J+"*"),Uo=new RegExp(J+"|>"),ua=new RegExp(Ca),Ho=new RegExp("^"+Ta+"$"),Sa={ID:new RegExp("^#("+Ta+")"),CLASS:new RegExp("^\\.("+Ta+")"),TAG:new RegExp("^("+Ta+"|[*])"),ATTR:new RegExp("^"+dr),PSEUDO:new RegExp("^"+Ca),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+J+"*(even|odd|(([+-]|)(\\d*)n|)"+J+"*(?:([+-]|)"+J+"*(\\d+)|))"+J+"*\\)|)","i"),bool:new RegExp("^(?:"+ca+")$","i"),needsContext:new RegExp("^"+J+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+J+"*((?:-\\d)?\\d*)"+J+"*\\)|)(?=[^-]|$)","i")},Ki=/^(?:input|select|textarea|button)$/i,co=/^h\d$/i,zi=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Zr=/[+~]/,Kr=new RegExp("\\\\[\\da-fA-F]{1,6}"+J+"?|\\\\([^\\r\\n\\f])","g"),Li=function(ke,ot){var Qe="0x"+ke.slice(1)-65536;return ot||(Qe<0?String.fromCharCode(Qe+65536):String.fromCharCode(Qe>>10|55296,1023&Qe|56320))},Ha=function(){Ui()},bi=Oo(function(ke){return ke.disabled===!0&&f(ke,"fieldset")},{dir:"parentNode",next:"legend"});try{rt.apply(h=D.call(be.childNodes),be.childNodes),h[be.childNodes.length].nodeType}catch(ke){rt={apply:function(ot,Qe){je.apply(ot,D.call(Qe))},call:function(ot){je.apply(ot,D.call(arguments,1))}}}function Jn(ke,ot,Qe,Ct){var kt,mn,gn,Rn,It,_r,Tn,Qt=ot&&ot.ownerDocument,Rr=ot?ot.nodeType:9;if(Qe=Qe||[],typeof ke!="string"||!ke||Rr!==1&&Rr!==9&&Rr!==11)return Qe;if(!Ct&&(Ui(ot),ot=ot||fe,Me)){if(Rr!==11&&(It=zi.exec(ke)))if(kt=It[1]){if(Rr===9){if(!(gn=ot.getElementById(kt)))return Qe;if(gn.id===kt)return rt.call(Qe,gn),Qe}else if(Qt&&(gn=Qt.getElementById(kt))&&Jn.contains(ot,gn)&&gn.id===kt)return rt.call(Qe,gn),Qe}else{if(It[2])return rt.apply(Qe,ot.getElementsByTagName(ke)),Qe;if((kt=It[3])&&ot.getElementsByClassName)return rt.apply(Qe,ot.getElementsByClassName(kt)),Qe}if(!(Yr[ke+" "]||Se&&Se.test(ke))){if(Tn=ke,Qt=ot,Rr===1&&(Uo.test(ke)||lo.test(ke))){for((Qt=Zr.test(ke)&&ha(ot.parentNode)||ot)==ot&&T.scope||((Rn=ot.getAttribute("id"))?Rn=u.escapeSelector(Rn):ot.setAttribute("id",Rn=ft)),mn=(_r=Wa(ke)).length;mn--;)_r[mn]=(Rn?"#"+Rn:":scope")+" "+bo(_r[mn]);Tn=_r.join(",")}try{return rt.apply(Qe,Qt.querySelectorAll(Tn)),Qe}catch(tr){Yr(ke,!0)}finally{Rn===ft&&ot.removeAttribute("id")}}}return Dl(ke.replace(te,"$1"),ot,Qe,Ct)}function li(){var ke=[];return function ot(Qe,Ct){return ke.push(Qe+" ")>E.cacheLength&&delete ot[ke.shift()],ot[Qe+" "]=Ct}}function ri(ke){return ke[ft]=!0,ke}function Pr(ke){var ot=fe.createElement("fieldset");try{return!!ke(ot)}catch(Qe){return!1}finally{ot.parentNode&&ot.parentNode.removeChild(ot),ot=null}}function Da(ke){return function(ot){return f(ot,"input")&&ot.type===ke}}function _s(ke){return function(ot){return(f(ot,"input")||f(ot,"button"))&&ot.type===ke}}function Cl(ke){return function(ot){return"form"in ot?ot.parentNode&&ot.disabled===!1?"label"in ot?"label"in ot.parentNode?ot.parentNode.disabled===ke:ot.disabled===ke:ot.isDisabled===ke||ot.isDisabled!==!ke&&bi(ot)===ke:ot.disabled===ke:"label"in ot&&ot.disabled===ke}}function ia(ke){return ri(function(ot){return ot=+ot,ri(function(Qe,Ct){for(var kt,mn=ke([],Qe.length,ot),gn=mn.length;gn--;)Qe[kt=mn[gn]]&&(Qe[kt]=!(Ct[kt]=Qe[kt]))})})}function ha(ke){return ke&&ke.getElementsByTagName!==void 0&&ke}function Ui(ke){var ot,Qe=ke?ke.ownerDocument||ke:be;return Qe!=fe&&Qe.nodeType===9&&Qe.documentElement&&(_e=(fe=Qe).documentElement,Me=!u.isXMLDoc(fe),Ve=_e.matches||_e.webkitMatchesSelector||_e.msMatchesSelector,be!=fe&&(ot=fe.defaultView)&&ot.top!==ot&&ot.addEventListener("unload",Ha),T.getById=Pr(function(Ct){return _e.appendChild(Ct).id=u.expando,!fe.getElementsByName||!fe.getElementsByName(u.expando).length}),T.disconnectedMatch=Pr(function(Ct){return Ve.call(Ct,"*")}),T.scope=Pr(function(){return fe.querySelectorAll(":scope")}),T.cssHas=Pr(function(){try{return fe.querySelector(":has(*,:jqfake)"),!1}catch(Ct){return!0}}),T.getById?(E.filter.ID=function(Ct){var kt=Ct.replace(Kr,Li);return function(mn){return mn.getAttribute("id")===kt}},E.find.ID=function(Ct,kt){if(kt.getElementById!==void 0&&Me){var mn=kt.getElementById(Ct);return mn?[mn]:[]}}):(E.filter.ID=function(Ct){var kt=Ct.replace(Kr,Li);return function(mn){var gn=mn.getAttributeNode!==void 0&&mn.getAttributeNode("id");return gn&&gn.value===kt}},E.find.ID=function(Ct,kt){if(kt.getElementById!==void 0&&Me){var mn,gn,Rn,It=kt.getElementById(Ct);if(It){if((mn=It.getAttributeNode("id"))&&mn.value===Ct)return[It];for(Rn=kt.getElementsByName(Ct),gn=0;It=Rn[gn++];)if((mn=It.getAttributeNode("id"))&&mn.value===Ct)return[It]}return[]}}),E.find.TAG=function(Ct,kt){return kt.getElementsByTagName!==void 0?kt.getElementsByTagName(Ct):kt.querySelectorAll(Ct)},E.find.CLASS=function(Ct,kt){if(kt.getElementsByClassName!==void 0&&Me)return kt.getElementsByClassName(Ct)},Se=[],Pr(function(Ct){var kt;_e.appendChild(Ct).innerHTML="<a id='"+ft+"' href='' disabled='disabled'></a><select id='"+ft+"-\r\\' disabled='disabled'><option selected=''></option></select>",Ct.querySelectorAll("[selected]").length||Se.push("\\["+J+"*(?:value|"+ca+")"),Ct.querySelectorAll("[id~="+ft+"-]").length||Se.push("~="),Ct.querySelectorAll("a#"+ft+"+*").length||Se.push(".#.+[+~]"),Ct.querySelectorAll(":checked").length||Se.push(":checked"),(kt=fe.createElement("input")).setAttribute("type","hidden"),Ct.appendChild(kt).setAttribute("name","D"),_e.appendChild(Ct).disabled=!0,Ct.querySelectorAll(":disabled").length!==2&&Se.push(":enabled",":disabled"),(kt=fe.createElement("input")).setAttribute("name",""),Ct.appendChild(kt),Ct.querySelectorAll("[name='']").length||Se.push("\\["+J+"*name"+J+"*="+J+`*(?:''|"")`)}),T.cssHas||Se.push(":has"),Se=Se.length&&new RegExp(Se.join("|")),zr=function(Ct,kt){if(Ct===kt)return de=!0,0;var mn=!Ct.compareDocumentPosition-!kt.compareDocumentPosition;return mn||(1&(mn=(Ct.ownerDocument||Ct)==(kt.ownerDocument||kt)?Ct.compareDocumentPosition(kt):1)||!T.sortDetached&&kt.compareDocumentPosition(Ct)===mn?Ct===fe||Ct.ownerDocument==be&&Jn.contains(be,Ct)?-1:kt===fe||kt.ownerDocument==be&&Jn.contains(be,kt)?1:re?I.call(re,Ct)-I.call(re,kt):0:4&mn?-1:1)}),fe}for(y in Jn.matches=function(ke,ot){return Jn(ke,null,null,ot)},Jn.matchesSelector=function(ke,ot){if(Ui(ke),Me&&!Yr[ot+" "]&&(!Se||!Se.test(ot)))try{var Qe=Ve.call(ke,ot);if(Qe||T.disconnectedMatch||ke.document&&ke.document.nodeType!==11)return Qe}catch(Ct){Yr(ot,!0)}return Jn(ot,fe,null,[ke]).length>0},Jn.contains=function(ke,ot){return(ke.ownerDocument||ke)!=fe&&Ui(ke),u.contains(ke,ot)},Jn.attr=function(ke,ot){(ke.ownerDocument||ke)!=fe&&Ui(ke);var Qe=E.attrHandle[ot.toLowerCase()],Ct=Qe&&M.call(E.attrHandle,ot.toLowerCase())?Qe(ke,ot,!Me):void 0;return Ct!==void 0?Ct:ke.getAttribute(ot)},Jn.error=function(ke){throw new Error("Syntax error, unrecognized expression: "+ke)},u.uniqueSort=function(ke){var ot,Qe=[],Ct=0,kt=0;if(de=!T.sortStable,re=!T.sortStable&&D.call(ke,0),W.call(ke,zr),de){for(;ot=ke[kt++];)ot===ke[kt]&&(Ct=Qe.push(kt));for(;Ct--;)X.call(ke,Qe[Ct],1)}return re=null,ke},u.fn.uniqueSort=function(){return this.pushStack(u.uniqueSort(D.apply(this)))},(E=u.expr={cacheLength:50,createPseudo:ri,match:Sa,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(ke){return ke[1]=ke[1].replace(Kr,Li),ke[3]=(ke[3]||ke[4]||ke[5]||"").replace(Kr,Li),ke[2]==="~="&&(ke[3]=" "+ke[3]+" "),ke.slice(0,4)},CHILD:function(ke){return ke[1]=ke[1].toLowerCase(),ke[1].slice(0,3)==="nth"?(ke[3]||Jn.error(ke[0]),ke[4]=+(ke[4]?ke[5]+(ke[6]||1):2*(ke[3]==="even"||ke[3]==="odd")),ke[5]=+(ke[7]+ke[8]||ke[3]==="odd")):ke[3]&&Jn.error(ke[0]),ke},PSEUDO:function(ke){var ot,Qe=!ke[6]&&ke[2];return Sa.CHILD.test(ke[0])?null:(ke[3]?ke[2]=ke[4]||ke[5]||"":Qe&&ua.test(Qe)&&(ot=Wa(Qe,!0))&&(ot=Qe.indexOf(")",Qe.length-ot)-Qe.length)&&(ke[0]=ke[0].slice(0,ot),ke[2]=Qe.slice(0,ot)),ke.slice(0,3))}},filter:{TAG:function(ke){var ot=ke.replace(Kr,Li).toLowerCase();return ke==="*"?function(){return!0}:function(Qe){return f(Qe,ot)}},CLASS:function(ke){var ot=kn[ke+" "];return ot||(ot=new RegExp("(^|"+J+")"+ke+"("+J+"|$)"))&&kn(ke,function(Qe){return ot.test(typeof Qe.className=="string"&&Qe.className||Qe.getAttribute!==void 0&&Qe.getAttribute("class")||"")})},ATTR:function(ke,ot,Qe){return function(Ct){var kt=Jn.attr(Ct,ke);return kt==null?ot==="!=":!ot||(kt+="",ot==="="?kt===Qe:ot==="!="?kt!==Qe:ot==="^="?Qe&&kt.indexOf(Qe)===0:ot==="*="?Qe&&kt.indexOf(Qe)>-1:ot==="$="?Qe&&kt.slice(-Qe.length)===Qe:ot==="~="?(" "+kt.replace(vr," ")+" ").indexOf(Qe)>-1:ot==="|="&&(kt===Qe||kt.slice(0,Qe.length+1)===Qe+"-"))}},CHILD:function(ke,ot,Qe,Ct,kt){var mn=ke.slice(0,3)!=="nth",gn=ke.slice(-4)!=="last",Rn=ot==="of-type";return Ct===1&&kt===0?function(It){return!!It.parentNode}:function(It,_r,Tn){var Qt,Rr,tr,ci,Mi,pi=mn!==gn?"nextSibling":"previousSibling",we=It.parentNode,_i=Rn&&It.nodeName.toLowerCase(),an=!Tn&&!Rn,Cr=!1;if(we){if(mn){for(;pi;){for(tr=It;tr=tr[pi];)if(Rn?f(tr,_i):tr.nodeType===1)return!1;Mi=pi=ke==="only"&&!Mi&&"nextSibling"}return!0}if(Mi=[gn?we.firstChild:we.lastChild],gn&&an){for(Cr=(ci=(Qt=(Rr=we[ft]||(we[ft]={}))[ke]||[])[0]===ct&&Qt[1])&&Qt[2],tr=ci&&we.childNodes[ci];tr=++ci&&tr&&tr[pi]||(Cr=ci=0)||Mi.pop();)if(tr.nodeType===1&&++Cr&&tr===It){Rr[ke]=[ct,ci,Cr];break}}else if(an&&(Cr=ci=(Qt=(Rr=It[ft]||(It[ft]={}))[ke]||[])[0]===ct&&Qt[1]),Cr===!1)for(;(tr=++ci&&tr&&tr[pi]||(Cr=ci=0)||Mi.pop())&&(!(Rn?f(tr,_i):tr.nodeType===1)||!++Cr||(an&&((Rr=tr[ft]||(tr[ft]={}))[ke]=[ct,Cr]),tr!==It)););return(Cr-=kt)===Ct||Cr%Ct==0&&Cr/Ct>=0}}},PSEUDO:function(ke,ot){var Qe,Ct=E.pseudos[ke]||E.setFilters[ke.toLowerCase()]||Jn.error("unsupported pseudo: "+ke);return Ct[ft]?Ct(ot):Ct.length>1?(Qe=[ke,ke,"",ot],E.setFilters.hasOwnProperty(ke.toLowerCase())?ri(function(kt,mn){for(var gn,Rn=Ct(kt,ot),It=Rn.length;It--;)kt[gn=I.call(kt,Rn[It])]=!(mn[gn]=Rn[It])}):function(kt){return Ct(kt,0,Qe)}):Ct}},pseudos:{not:ri(function(ke){var ot=[],Qe=[],Ct=ki(ke.replace(te,"$1"));return Ct[ft]?ri(function(kt,mn,gn,Rn){for(var It,_r=Ct(kt,null,Rn,[]),Tn=kt.length;Tn--;)(It=_r[Tn])&&(kt[Tn]=!(mn[Tn]=It))}):function(kt,mn,gn){return ot[0]=kt,Ct(ot,null,gn,Qe),ot[0]=null,!Qe.pop()}}),has:ri(function(ke){return function(ot){return Jn(ke,ot).length>0}}),contains:ri(function(ke){return ke=ke.replace(Kr,Li),function(ot){return(ot.textContent||u.text(ot)).indexOf(ke)>-1}}),lang:ri(function(ke){return Ho.test(ke||"")||Jn.error("unsupported lang: "+ke),ke=ke.replace(Kr,Li).toLowerCase(),function(ot){var Qe;do if(Qe=Me?ot.lang:ot.getAttribute("xml:lang")||ot.getAttribute("lang"))return(Qe=Qe.toLowerCase())===ke||Qe.indexOf(ke+"-")===0;while((ot=ot.parentNode)&&ot.nodeType===1);return!1}}),target:function(ke){var ot=a.location&&a.location.hash;return ot&&ot.slice(1)===ke.id},root:function(ke){return ke===_e},focus:function(ke){return ke===function(){try{return fe.activeElement}catch(ot){}}()&&fe.hasFocus()&&!!(ke.type||ke.href||~ke.tabIndex)},enabled:Cl(!1),disabled:Cl(!0),checked:function(ke){return f(ke,"input")&&!!ke.checked||f(ke,"option")&&!!ke.selected},selected:function(ke){return ke.parentNode&&ke.parentNode.selectedIndex,ke.selected===!0},empty:function(ke){for(ke=ke.firstChild;ke;ke=ke.nextSibling)if(ke.nodeType<6)return!1;return!0},parent:function(ke){return!E.pseudos.empty(ke)},header:function(ke){return co.test(ke.nodeName)},input:function(ke){return Ki.test(ke.nodeName)},button:function(ke){return f(ke,"input")&&ke.type==="button"||f(ke,"button")},text:function(ke){var ot;return f(ke,"input")&&ke.type==="text"&&((ot=ke.getAttribute("type"))==null||ot.toLowerCase()==="text")},first:ia(function(){return[0]}),last:ia(function(ke,ot){return[ot-1]}),eq:ia(function(ke,ot,Qe){return[Qe<0?Qe+ot:Qe]}),even:ia(function(ke,ot){for(var Qe=0;Qe<ot;Qe+=2)ke.push(Qe);return ke}),odd:ia(function(ke,ot){for(var Qe=1;Qe<ot;Qe+=2)ke.push(Qe);return ke}),lt:ia(function(ke,ot,Qe){var Ct;for(Ct=Qe<0?Qe+ot:Qe>ot?ot:Qe;--Ct>=0;)ke.push(Ct);return ke}),gt:ia(function(ke,ot,Qe){for(var Ct=Qe<0?Qe+ot:Qe;++Ct<ot;)ke.push(Ct);return ke})}}).pseudos.nth=E.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})E.pseudos[y]=Da(y);for(y in{submit:!0,reset:!0})E.pseudos[y]=_s(y);function Ts(){}function Wa(ke,ot){var Qe,Ct,kt,mn,gn,Rn,It,_r=Pt[ke+" "];if(_r)return ot?0:_r.slice(0);for(gn=ke,Rn=[],It=E.preFilter;gn;){for(mn in Qe&&!(Ct=Wn.exec(gn))||(Ct&&(gn=gn.slice(Ct[0].length)||gn),Rn.push(kt=[])),Qe=!1,(Ct=lo.exec(gn))&&(Qe=Ct.shift(),kt.push({value:Qe,type:Ct[0].replace(te," ")}),gn=gn.slice(Qe.length)),E.filter)!(Ct=Sa[mn].exec(gn))||It[mn]&&!(Ct=It[mn](Ct))||(Qe=Ct.shift(),kt.push({value:Qe,type:mn,matches:Ct}),gn=gn.slice(Qe.length));if(!Qe)break}return ot?gn.length:gn?Jn.error(ke):Pt(ke,Rn).slice(0)}function bo(ke){for(var ot=0,Qe=ke.length,Ct="";ot<Qe;ot++)Ct+=ke[ot].value;return Ct}function Oo(ke,ot,Qe){var Ct=ot.dir,kt=ot.next,mn=kt||Ct,gn=Qe&&mn==="parentNode",Rn=Lt++;return ot.first?function(It,_r,Tn){for(;It=It[Ct];)if(It.nodeType===1||gn)return ke(It,_r,Tn);return!1}:function(It,_r,Tn){var Qt,Rr,tr=[ct,Rn];if(Tn){for(;It=It[Ct];)if((It.nodeType===1||gn)&&ke(It,_r,Tn))return!0}else for(;It=It[Ct];)if(It.nodeType===1||gn)if(Rr=It[ft]||(It[ft]={}),kt&&f(It,kt))It=It[Ct]||It;else{if((Qt=Rr[mn])&&Qt[0]===ct&&Qt[1]===Rn)return tr[2]=Qt[2];if(Rr[mn]=tr,tr[2]=ke(It,_r,Tn))return!0}return!1}}function Sl(ke){return ke.length>1?function(ot,Qe,Ct){for(var kt=ke.length;kt--;)if(!ke[kt](ot,Qe,Ct))return!1;return!0}:ke[0]}function di(ke,ot,Qe,Ct,kt){for(var mn,gn=[],Rn=0,It=ke.length,_r=ot!=null;Rn<It;Rn++)(mn=ke[Rn])&&(Qe&&!Qe(mn,Ct,kt)||(gn.push(mn),_r&&ot.push(Rn)));return gn}function Ii(ke,ot,Qe,Ct,kt,mn){return Ct&&!Ct[ft]&&(Ct=Ii(Ct)),kt&&!kt[ft]&&(kt=Ii(kt,mn)),ri(function(gn,Rn,It,_r){var Tn,Qt,Rr,tr,ci=[],Mi=[],pi=Rn.length,we=gn||function(an,Cr,xr){for(var $i=0,Ja=Cr.length;$i<Ja;$i++)Jn(an,Cr[$i],xr);return xr}(ot||"*",It.nodeType?[It]:It,[]),_i=!ke||!gn&&ot?we:di(we,ci,ke,It,_r);if(Qe?Qe(_i,tr=kt||(gn?ke:pi||Ct)?[]:Rn,It,_r):tr=_i,Ct)for(Tn=di(tr,Mi),Ct(Tn,[],It,_r),Qt=Tn.length;Qt--;)(Rr=Tn[Qt])&&(tr[Mi[Qt]]=!(_i[Mi[Qt]]=Rr));if(gn){if(kt||ke){if(kt){for(Tn=[],Qt=tr.length;Qt--;)(Rr=tr[Qt])&&Tn.push(_i[Qt]=Rr);kt(null,tr=[],Tn,_r)}for(Qt=tr.length;Qt--;)(Rr=tr[Qt])&&(Tn=kt?I.call(gn,Rr):ci[Qt])>-1&&(gn[Tn]=!(Rn[Tn]=Rr))}}else tr=di(tr===Rn?tr.splice(pi,tr.length):tr),kt?kt(null,Rn,tr,_r):rt.apply(Rn,tr)})}function Js(ke){for(var ot,Qe,Ct,kt=ke.length,mn=E.relative[ke[0].type],gn=mn||E.relative[" "],Rn=mn?1:0,It=Oo(function(Qt){return Qt===ot},gn,!0),_r=Oo(function(Qt){return I.call(ot,Qt)>-1},gn,!0),Tn=[function(Qt,Rr,tr){var ci=!mn&&(tr||Rr!=K)||((ot=Rr).nodeType?It(Qt,Rr,tr):_r(Qt,Rr,tr));return ot=null,ci}];Rn<kt;Rn++)if(Qe=E.relative[ke[Rn].type])Tn=[Oo(Sl(Tn),Qe)];else{if((Qe=E.filter[ke[Rn].type].apply(null,ke[Rn].matches))[ft]){for(Ct=++Rn;Ct<kt&&!E.relative[ke[Ct].type];Ct++);return Ii(Rn>1&&Sl(Tn),Rn>1&&bo(ke.slice(0,Rn-1).concat({value:ke[Rn-2].type===" "?"*":""})).replace(te,"$1"),Qe,Rn<Ct&&Js(ke.slice(Rn,Ct)),Ct<kt&&Js(ke=ke.slice(Ct)),Ct<kt&&bo(ke))}Tn.push(Qe)}return Sl(Tn)}function ki(ke,ot){var Qe,Ct=[],kt=[],mn=Hn[ke+" "];if(!mn){for(ot||(ot=Wa(ke)),Qe=ot.length;Qe--;)(mn=Js(ot[Qe]))[ft]?Ct.push(mn):kt.push(mn);(mn=Hn(ke,function(gn,Rn){var It=Rn.length>0,_r=gn.length>0,Tn=function(Qt,Rr,tr,ci,Mi){var pi,we,_i,an=0,Cr="0",xr=Qt&&[],$i=[],Ja=K,Hi=Qt||_r&&E.find.TAG("*",Mi),Mo=ct+=Ja==null?1:Math.random()||.1,da=Hi.length;for(Mi&&(K=Rr==fe||Rr||Mi);Cr!==da&&(pi=Hi[Cr])!=null;Cr++){if(_r&&pi){for(we=0,Rr||pi.ownerDocument==fe||(Ui(pi),tr=!Me);_i=gn[we++];)if(_i(pi,Rr||fe,tr)){rt.call(ci,pi);break}Mi&&(ct=Mo)}It&&((pi=!_i&&pi)&&an--,Qt&&xr.push(pi))}if(an+=Cr,It&&Cr!==an){for(we=0;_i=Rn[we++];)_i(xr,$i,Rr,tr);if(Qt){if(an>0)for(;Cr--;)xr[Cr]||$i[Cr]||($i[Cr]=O.call(ci));$i=di($i)}rt.apply(ci,$i),Mi&&!Qt&&$i.length>0&&an+Rn.length>1&&u.uniqueSort(ci)}return Mi&&(ct=Mo,K=Ja),xr};return It?ri(Tn):Tn}(kt,Ct))).selector=ke}return mn}function Dl(ke,ot,Qe,Ct){var kt,mn,gn,Rn,It,_r=typeof ke=="function"&&ke,Tn=!Ct&&Wa(ke=_r.selector||ke);if(Qe=Qe||[],Tn.length===1){if((mn=Tn[0]=Tn[0].slice(0)).length>2&&(gn=mn[0]).type==="ID"&&ot.nodeType===9&&Me&&E.relative[mn[1].type]){if(!(ot=(E.find.ID(gn.matches[0].replace(Kr,Li),ot)||[])[0]))return Qe;_r&&(ot=ot.parentNode),ke=ke.slice(mn.shift().value.length)}for(kt=Sa.needsContext.test(ke)?0:mn.length;kt--&&(gn=mn[kt],!E.relative[Rn=gn.type]);)if((It=E.find[Rn])&&(Ct=It(gn.matches[0].replace(Kr,Li),Zr.test(mn[0].type)&&ha(ot.parentNode)||ot))){if(mn.splice(kt,1),!(ke=Ct.length&&bo(mn)))return rt.apply(Qe,Ct),Qe;break}}return(_r||ki(ke,Tn))(Ct,ot,!Me,Qe,!ot||Zr.test(ke)&&ha(ot.parentNode)||ot),Qe}Ts.prototype=E.filters=E.pseudos,E.setFilters=new Ts,T.sortStable=ft.split("").sort(zr).join("")===ft,Ui(),T.sortDetached=Pr(function(ke){return 1&ke.compareDocumentPosition(fe.createElement("fieldset"))}),u.find=Jn,u.expr[":"]=u.expr.pseudos,u.unique=u.uniqueSort,Jn.compile=ki,Jn.select=Dl,Jn.setDocument=Ui,Jn.escape=u.escapeSelector,Jn.getText=u.text,Jn.isXML=u.isXMLDoc,Jn.selectors=u.expr,Jn.support=u.support,Jn.uniqueSort=u.uniqueSort})();var ve=function(y,E,K){for(var re=[],de=K!==void 0;(y=y[E])&&y.nodeType!==9;)if(y.nodeType===1){if(de&&u(y).is(K))break;re.push(y)}return re},Be=function(y,E){for(var K=[];y;y=y.nextSibling)y.nodeType===1&&y!==E&&K.push(y);return K},q=u.expr.match.needsContext,ge=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function oe(y,E,K){return _(E)?u.grep(y,function(re,de){return!!E.call(re,de,re)!==K}):E.nodeType?u.grep(y,function(re){return re===E!==K}):typeof E!="string"?u.grep(y,function(re){return I.call(E,re)>-1!==K}):u.filter(E,y,K)}u.filter=function(y,E,K){var re=E[0];return K&&(y=":not("+y+")"),E.length===1&&re.nodeType===1?u.find.matchesSelector(re,y)?[re]:[]:u.find.matches(y,u.grep(E,function(de){return de.nodeType===1}))},u.fn.extend({find:function(y){var E,K,re=this.length,de=this;if(typeof y!="string")return this.pushStack(u(y).filter(function(){for(E=0;E<re;E++)if(u.contains(de[E],this))return!0}));for(K=this.pushStack([]),E=0;E<re;E++)u.find(y,de[E],K);return re>1?u.uniqueSort(K):K},filter:function(y){return this.pushStack(oe(this,y||[],!1))},not:function(y){return this.pushStack(oe(this,y||[],!0))},is:function(y){return!!oe(this,typeof y=="string"&&q.test(y)?u(y):y||[],!1).length}});var le,Pe=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(u.fn.init=function(y,E,K){var re,de;if(!y)return this;if(K=K||le,typeof y=="string"){if(!(re=y[0]==="<"&&y[y.length-1]===">"&&y.length>=3?[null,y,null]:Pe.exec(y))||!re[1]&&E)return!E||E.jquery?(E||K).find(y):this.constructor(E).find(y);if(re[1]){if(E=E instanceof u?E[0]:E,u.merge(this,u.parseHTML(re[1],E&&E.nodeType?E.ownerDocument||E:k,!0)),ge.test(re[1])&&u.isPlainObject(E))for(re in E)_(this[re])?this[re](E[re]):this.attr(re,E[re]);return this}return(de=k.getElementById(re[2]))&&(this[0]=de,this.length=1),this}return y.nodeType?(this[0]=y,this.length=1,this):_(y)?K.ready!==void 0?K.ready(y):y(u):u.makeArray(y,this)}).prototype=u.fn,le=u(k);var Ye=/^(?:parents|prev(?:Until|All))/,ze={children:!0,contents:!0,next:!0,prev:!0};function se(y,E){for(;(y=y[E])&&y.nodeType!==1;);return y}u.fn.extend({has:function(y){var E=u(y,this),K=E.length;return this.filter(function(){for(var re=0;re<K;re++)if(u.contains(this,E[re]))return!0})},closest:function(y,E){var K,re=0,de=this.length,fe=[],_e=typeof y!="string"&&u(y);if(!q.test(y)){for(;re<de;re++)for(K=this[re];K&&K!==E;K=K.parentNode)if(K.nodeType<11&&(_e?_e.index(K)>-1:K.nodeType===1&&u.find.matchesSelector(K,y))){fe.push(K);break}}return this.pushStack(fe.length>1?u.uniqueSort(fe):fe)},index:function(y){return y?typeof y=="string"?I.call(u(y),this[0]):I.call(this,y.jquery?y[0]:y):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(y,E){return this.pushStack(u.uniqueSort(u.merge(this.get(),u(y,E))))},addBack:function(y){return this.add(y==null?this.prevObject:this.prevObject.filter(y))}}),u.each({parent:function(y){var E=y.parentNode;return E&&E.nodeType!==11?E:null},parents:function(y){return ve(y,"parentNode")},parentsUntil:function(y,E,K){return ve(y,"parentNode",K)},next:function(y){return se(y,"nextSibling")},prev:function(y){return se(y,"previousSibling")},nextAll:function(y){return ve(y,"nextSibling")},prevAll:function(y){return ve(y,"previousSibling")},nextUntil:function(y,E,K){return ve(y,"nextSibling",K)},prevUntil:function(y,E,K){return ve(y,"previousSibling",K)},siblings:function(y){return Be((y.parentNode||{}).firstChild,y)},children:function(y){return Be(y.firstChild)},contents:function(y){return y.contentDocument!=null&&b(y.contentDocument)?y.contentDocument:(f(y,"template")&&(y=y.content||y),u.merge([],y.childNodes))}},function(y,E){u.fn[y]=function(K,re){var de=u.map(this,E,K);return y.slice(-5)!=="Until"&&(re=K),re&&typeof re=="string"&&(de=u.filter(re,de)),this.length>1&&(ze[y]||u.uniqueSort(de),Ye.test(y)&&de.reverse()),this.pushStack(de)}});var xe=/[^\x20\t\r\n\f]+/g;function De(y){return y}function tt(y){throw y}function st(y,E,K,re){var de;try{y&&_(de=y.promise)?de.call(y).done(E).fail(K):y&&_(de=y.then)?de.call(y,E,K):E.apply(void 0,[y].slice(re))}catch(fe){K.apply(void 0,[fe])}}u.Callbacks=function(y){y=typeof y=="string"?function(rt){var ft={};return u.each(rt.match(xe)||[],function(ct,Lt){ft[Lt]=!0}),ft}(y):u.extend({},y);var E,K,re,de,fe=[],_e=[],Me=-1,Se=function(){for(de=de||y.once,re=E=!0;_e.length;Me=-1)for(K=_e.shift();++Me<fe.length;)fe[Me].apply(K[0],K[1])===!1&&y.stopOnFalse&&(Me=fe.length,K=!1);y.memory||(K=!1),E=!1,de&&(fe=K?[]:"")},Ve={add:function(){return fe&&(K&&!E&&(Me=fe.length-1,_e.push(K)),function rt(ft){u.each(ft,function(ct,Lt){_(Lt)?y.unique&&Ve.has(Lt)||fe.push(Lt):Lt&&Lt.length&&C(Lt)!=="string"&&rt(Lt)})}(arguments),K&&!E&&Se()),this},remove:function(){return u.each(arguments,function(rt,ft){for(var ct;(ct=u.inArray(ft,fe,ct))>-1;)fe.splice(ct,1),ct<=Me&&Me--}),this},has:function(rt){return rt?u.inArray(rt,fe)>-1:fe.length>0},empty:function(){return fe&&(fe=[]),this},disable:function(){return de=_e=[],fe=K="",this},disabled:function(){return!fe},lock:function(){return de=_e=[],K||E||(fe=K=""),this},locked:function(){return!!de},fireWith:function(rt,ft){return de||(ft=[rt,(ft=ft||[]).slice?ft.slice():ft],_e.push(ft),E||Se()),this},fire:function(){return Ve.fireWith(this,arguments),this},fired:function(){return!!re}};return Ve},u.extend({Deferred:function(y){var E=[["notify","progress",u.Callbacks("memory"),u.Callbacks("memory"),2],["resolve","done",u.Callbacks("once memory"),u.Callbacks("once memory"),0,"resolved"],["reject","fail",u.Callbacks("once memory"),u.Callbacks("once memory"),1,"rejected"]],K="pending",re={state:function(){return K},always:function(){return de.done(arguments).fail(arguments),this},catch:function(fe){return re.then(null,fe)},pipe:function(){var fe=arguments;return u.Deferred(function(_e){u.each(E,function(Me,Se){var Ve=_(fe[Se[4]])&&fe[Se[4]];de[Se[1]](function(){var rt=Ve&&Ve.apply(this,arguments);rt&&_(rt.promise)?rt.promise().progress(_e.notify).done(_e.resolve).fail(_e.reject):_e[Se[0]+"With"](this,Ve?[rt]:arguments)})}),fe=null}).promise()},then:function(fe,_e,Me){var Se=0;function Ve(rt,ft,ct,Lt){return function(){var kn=this,Pt=arguments,Hn=function(){var zr,ca;if(!(rt<Se)){if((zr=ct.apply(kn,Pt))===ft.promise())throw new TypeError("Thenable self-resolution");ca=zr&&(typeof zr=="object"||typeof zr=="function")&&zr.then,_(ca)?Lt?ca.call(zr,Ve(Se,ft,De,Lt),Ve(Se,ft,tt,Lt)):(Se++,ca.call(zr,Ve(Se,ft,De,Lt),Ve(Se,ft,tt,Lt),Ve(Se,ft,De,ft.notifyWith))):(ct!==De&&(kn=void 0,Pt=[zr]),(Lt||ft.resolveWith)(kn,Pt))}},Yr=Lt?Hn:function(){try{Hn()}catch(zr){u.Deferred.exceptionHook&&u.Deferred.exceptionHook(zr,Yr.error),rt+1>=Se&&(ct!==tt&&(kn=void 0,Pt=[zr]),ft.rejectWith(kn,Pt))}};rt?Yr():(u.Deferred.getErrorHook?Yr.error=u.Deferred.getErrorHook():u.Deferred.getStackHook&&(Yr.error=u.Deferred.getStackHook()),a.setTimeout(Yr))}}return u.Deferred(function(rt){E[0][3].add(Ve(0,rt,_(Me)?Me:De,rt.notifyWith)),E[1][3].add(Ve(0,rt,_(fe)?fe:De)),E[2][3].add(Ve(0,rt,_(_e)?_e:tt))}).promise()},promise:function(fe){return fe!=null?u.extend(fe,re):re}},de={};return u.each(E,function(fe,_e){var Me=_e[2],Se=_e[5];re[_e[1]]=Me.add,Se&&Me.add(function(){K=Se},E[3-fe][2].disable,E[3-fe][3].disable,E[0][2].lock,E[0][3].lock),Me.add(_e[3].fire),de[_e[0]]=function(){return de[_e[0]+"With"](this===de?void 0:this,arguments),this},de[_e[0]+"With"]=Me.fireWith}),re.promise(de),y&&y.call(de,de),de},when:function(y){var E=arguments.length,K=E,re=Array(K),de=D.call(arguments),fe=u.Deferred(),_e=function(Me){return function(Se){re[Me]=this,de[Me]=arguments.length>1?D.call(arguments):Se,--E||fe.resolveWith(re,de)}};if(E<=1&&(st(y,fe.done(_e(K)).resolve,fe.reject,!E),fe.state()==="pending"||_(de[K]&&de[K].then)))return fe.then();for(;K--;)st(de[K],_e(K),fe.reject);return fe.promise()}});var mt=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;u.Deferred.exceptionHook=function(y,E){a.console&&a.console.warn&&y&&mt.test(y.name)&&a.console.warn("jQuery.Deferred exception: "+y.message,y.stack,E)},u.readyException=function(y){a.setTimeout(function(){throw y})};var Rt=u.Deferred();function Ot(){k.removeEventListener("DOMContentLoaded",Ot),a.removeEventListener("load",Ot),u.ready()}u.fn.ready=function(y){return Rt.then(y).catch(function(E){u.readyException(E)}),this},u.extend({isReady:!1,readyWait:1,ready:function(y){(y===!0?--u.readyWait:u.isReady)||(u.isReady=!0,y!==!0&&--u.readyWait>0||Rt.resolveWith(k,[u]))}}),u.ready.then=Rt.then,k.readyState==="complete"||k.readyState!=="loading"&&!k.documentElement.doScroll?a.setTimeout(u.ready):(k.addEventListener("DOMContentLoaded",Ot),a.addEventListener("load",Ot));var He=function(y,E,K,re,de,fe,_e){var Me=0,Se=y.length,Ve=K==null;if(C(K)==="object")for(Me in de=!0,K)He(y,E,Me,K[Me],!0,fe,_e);else if(re!==void 0&&(de=!0,_(re)||(_e=!0),Ve&&(_e?(E.call(y,re),E=null):(Ve=E,E=function(rt,ft,ct){return Ve.call(u(rt),ct)})),E))for(;Me<Se;Me++)E(y[Me],K,_e?re:re.call(y[Me],Me,E(y[Me],K)));return de?y:Ve?E.call(y):Se?E(y[0],K):fe},Vt=/^-ms-/,jt=/-([a-z])/g;function Ln(y,E){return E.toUpperCase()}function nn(y){return y.replace(Vt,"ms-").replace(jt,Ln)}var er=function(y){return y.nodeType===1||y.nodeType===9||!+y.nodeType};function yt(){this.expando=u.expando+yt.uid++}yt.uid=1,yt.prototype={cache:function(y){var E=y[this.expando];return E||(E={},er(y)&&(y.nodeType?y[this.expando]=E:Object.defineProperty(y,this.expando,{value:E,configurable:!0}))),E},set:function(y,E,K){var re,de=this.cache(y);if(typeof E=="string")de[nn(E)]=K;else for(re in E)de[nn(re)]=E[re];return de},get:function(y,E){return E===void 0?this.cache(y):y[this.expando]&&y[this.expando][nn(E)]},access:function(y,E,K){return E===void 0||E&&typeof E=="string"&&K===void 0?this.get(y,E):(this.set(y,E,K),K!==void 0?K:E)},remove:function(y,E){var K,re=y[this.expando];if(re!==void 0){if(E!==void 0)for(K=(E=Array.isArray(E)?E.map(nn):(E=nn(E))in re?[E]:E.match(xe)||[]).length;K--;)delete re[E[K]];(E===void 0||u.isEmptyObject(re))&&(y.nodeType?y[this.expando]=void 0:delete y[this.expando])}},hasData:function(y){var E=y[this.expando];return E!==void 0&&!u.isEmptyObject(E)}};var Ue=new yt,Zt=new yt,On=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Xn=/[A-Z]/g;function dt(y,E,K){var re;if(K===void 0&&y.nodeType===1)if(re="data-"+E.replace(Xn,"-$&").toLowerCase(),typeof(K=y.getAttribute(re))=="string"){try{K=function(de){return de==="true"||de!=="false"&&(de==="null"?null:de===+de+""?+de:On.test(de)?JSON.parse(de):de)}(K)}catch(de){}Zt.set(y,E,K)}else K=void 0;return K}u.extend({hasData:function(y){return Zt.hasData(y)||Ue.hasData(y)},data:function(y,E,K){return Zt.access(y,E,K)},removeData:function(y,E){Zt.remove(y,E)},_data:function(y,E,K){return Ue.access(y,E,K)},_removeData:function(y,E){Ue.remove(y,E)}}),u.fn.extend({data:function(y,E){var K,re,de,fe=this[0],_e=fe&&fe.attributes;if(y===void 0){if(this.length&&(de=Zt.get(fe),fe.nodeType===1&&!Ue.get(fe,"hasDataAttrs"))){for(K=_e.length;K--;)_e[K]&&(re=_e[K].name).indexOf("data-")===0&&(re=nn(re.slice(5)),dt(fe,re,de[re]));Ue.set(fe,"hasDataAttrs",!0)}return de}return typeof y=="object"?this.each(function(){Zt.set(this,y)}):He(this,function(Me){var Se;if(fe&&Me===void 0)return(Se=Zt.get(fe,y))!==void 0||(Se=dt(fe,y))!==void 0?Se:void 0;this.each(function(){Zt.set(this,y,Me)})},null,E,arguments.length>1,null,!0)},removeData:function(y){return this.each(function(){Zt.remove(this,y)})}}),u.extend({queue:function(y,E,K){var re;if(y)return E=(E||"fx")+"queue",re=Ue.get(y,E),K&&(!re||Array.isArray(K)?re=Ue.access(y,E,u.makeArray(K)):re.push(K)),re||[]},dequeue:function(y,E){E=E||"fx";var K=u.queue(y,E),re=K.length,de=K.shift(),fe=u._queueHooks(y,E);de==="inprogress"&&(de=K.shift(),re--),de&&(E==="fx"&&K.unshift("inprogress"),delete fe.stop,de.call(y,function(){u.dequeue(y,E)},fe)),!re&&fe&&fe.empty.fire()},_queueHooks:function(y,E){var K=E+"queueHooks";return Ue.get(y,K)||Ue.access(y,K,{empty:u.Callbacks("once memory").add(function(){Ue.remove(y,[E+"queue",K])})})}}),u.fn.extend({queue:function(y,E){var K=2;return typeof y!="string"&&(E=y,y="fx",K--),arguments.length<K?u.queue(this[0],y):E===void 0?this:this.each(function(){var re=u.queue(this,y,E);u._queueHooks(this,y),y==="fx"&&re[0]!=="inprogress"&&u.dequeue(this,y)})},dequeue:function(y){return this.each(function(){u.dequeue(this,y)})},clearQueue:function(y){return this.queue(y||"fx",[])},promise:function(y,E){var K,re=1,de=u.Deferred(),fe=this,_e=this.length,Me=function(){--re||de.resolveWith(fe,[fe])};for(typeof y!="string"&&(E=y,y=void 0),y=y||"fx";_e--;)(K=Ue.get(fe[_e],y+"queueHooks"))&&K.empty&&(re++,K.empty.add(Me));return Me(),de.promise(E)}});var lt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Xt=new RegExp("^(?:([+-])=|)("+lt+")([a-z%]*)$","i"),xn=["Top","Right","Bottom","Left"],$t=k.documentElement,Yn=function(y){return u.contains(y.ownerDocument,y)},kr={composed:!0};$t.getRootNode&&(Yn=function(y){return u.contains(y.ownerDocument,y)||y.getRootNode(kr)===y.ownerDocument});var Br=function(y,E){return(y=E||y).style.display==="none"||y.style.display===""&&Yn(y)&&u.css(y,"display")==="none"};function $e(y,E,K,re){var de,fe,_e=20,Me=re?function(){return re.cur()}:function(){return u.css(y,E,"")},Se=Me(),Ve=K&&K[3]||(u.cssNumber[E]?"":"px"),rt=y.nodeType&&(u.cssNumber[E]||Ve!=="px"&&+Se)&&Xt.exec(u.css(y,E));if(rt&&rt[3]!==Ve){for(Se/=2,Ve=Ve||rt[3],rt=+Se||1;_e--;)u.style(y,E,rt+Ve),(1-fe)*(1-(fe=Me()/Se||.5))<=0&&(_e=0),rt/=fe;rt*=2,u.style(y,E,rt+Ve),K=K||[]}return K&&(rt=+rt||+Se||0,de=K[1]?rt+(K[1]+1)*K[2]:+K[2],re&&(re.unit=Ve,re.start=rt,re.end=de)),de}var We={};function ut(y){var E,K=y.ownerDocument,re=y.nodeName,de=We[re];return de||(E=K.body.appendChild(K.createElement(re)),de=u.css(E,"display"),E.parentNode.removeChild(E),de==="none"&&(de="block"),We[re]=de,de)}function Ie(y,E){for(var K,re,de=[],fe=0,_e=y.length;fe<_e;fe++)(re=y[fe]).style&&(K=re.style.display,E?(K==="none"&&(de[fe]=Ue.get(re,"display")||null,de[fe]||(re.style.display="")),re.style.display===""&&Br(re)&&(de[fe]=ut(re))):K!=="none"&&(de[fe]="none",Ue.set(re,"display",K)));for(fe=0;fe<_e;fe++)de[fe]!=null&&(y[fe].style.display=de[fe]);return y}u.fn.extend({show:function(){return Ie(this,!0)},hide:function(){return Ie(this)},toggle:function(y){return typeof y=="boolean"?y?this.show():this.hide():this.each(function(){Br(this)?u(this).show():u(this).hide()})}});var Mt,rn,tn=/^(?:checkbox|radio)$/i,En=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,br=/^$|^module$|\/(?:java|ecma)script/i;Mt=k.createDocumentFragment().appendChild(k.createElement("div")),(rn=k.createElement("input")).setAttribute("type","radio"),rn.setAttribute("checked","checked"),rn.setAttribute("name","t"),Mt.appendChild(rn),T.checkClone=Mt.cloneNode(!0).cloneNode(!0).lastChild.checked,Mt.innerHTML="<textarea>x</textarea>",T.noCloneChecked=!!Mt.cloneNode(!0).lastChild.defaultValue,Mt.innerHTML="<option></option>",T.option=!!Mt.lastChild;var Mr={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 Tr(y,E){var K;return K=y.getElementsByTagName!==void 0?y.getElementsByTagName(E||"*"):y.querySelectorAll!==void 0?y.querySelectorAll(E||"*"):[],E===void 0||E&&f(y,E)?u.merge([y],K):K}function ti(y,E){for(var K=0,re=y.length;K<re;K++)Ue.set(y[K],"globalEval",!E||Ue.get(E[K],"globalEval"))}Mr.tbody=Mr.tfoot=Mr.colgroup=Mr.caption=Mr.thead,Mr.th=Mr.td,T.option||(Mr.optgroup=Mr.option=[1,"<select multiple='multiple'>","</select>"]);var Gr=/<|&#?\w+;/;function ba(y,E,K,re,de){for(var fe,_e,Me,Se,Ve,rt,ft=E.createDocumentFragment(),ct=[],Lt=0,kn=y.length;Lt<kn;Lt++)if((fe=y[Lt])||fe===0)if(C(fe)==="object")u.merge(ct,fe.nodeType?[fe]:fe);else if(Gr.test(fe)){for(_e=_e||ft.appendChild(E.createElement("div")),Me=(En.exec(fe)||["",""])[1].toLowerCase(),Se=Mr[Me]||Mr._default,_e.innerHTML=Se[1]+u.htmlPrefilter(fe)+Se[2],rt=Se[0];rt--;)_e=_e.lastChild;u.merge(ct,_e.childNodes),(_e=ft.firstChild).textContent=""}else ct.push(E.createTextNode(fe));for(ft.textContent="",Lt=0;fe=ct[Lt++];)if(re&&u.inArray(fe,re)>-1)de&&de.push(fe);else if(Ve=Yn(fe),_e=Tr(ft.appendChild(fe),"script"),Ve&&ti(_e),K)for(rt=0;fe=_e[rt++];)br.test(fe.type||"")&&K.push(fe);return ft}var Di=/^([^.]*)(?:\.(.+)|)/;function wi(){return!0}function or(){return!1}function ni(y,E,K,re,de,fe){var _e,Me;if(typeof E=="object"){for(Me in typeof K!="string"&&(re=re||K,K=void 0),E)ni(y,Me,K,re,E[Me],fe);return y}if(re==null&&de==null?(de=K,re=K=void 0):de==null&&(typeof K=="string"?(de=re,re=void 0):(de=re,re=K,K=void 0)),de===!1)de=or;else if(!de)return y;return fe===1&&(_e=de,(de=function(Se){return u().off(Se),_e.apply(this,arguments)}).guid=_e.guid||(_e.guid=u.guid++)),y.each(function(){u.event.add(this,E,de,re,K)})}function H(y,E,K){K?(Ue.set(y,E,!1),u.event.add(y,E,{namespace:!1,handler:function(re){var de,fe=Ue.get(this,E);if(1&re.isTrigger&&this[E]){if(fe)(u.event.special[E]||{}).delegateType&&re.stopPropagation();else if(fe=D.call(arguments),Ue.set(this,E,fe),this[E](),de=Ue.get(this,E),Ue.set(this,E,!1),fe!==de)return re.stopImmediatePropagation(),re.preventDefault(),de}else fe&&(Ue.set(this,E,u.event.trigger(fe[0],fe.slice(1),this)),re.stopPropagation(),re.isImmediatePropagationStopped=wi)}})):Ue.get(y,E)===void 0&&u.event.add(y,E,wi)}u.event={global:{},add:function(y,E,K,re,de){var fe,_e,Me,Se,Ve,rt,ft,ct,Lt,kn,Pt,Hn=Ue.get(y);if(er(y))for(K.handler&&(K=(fe=K).handler,de=fe.selector),de&&u.find.matchesSelector($t,de),K.guid||(K.guid=u.guid++),(Se=Hn.events)||(Se=Hn.events=Object.create(null)),(_e=Hn.handle)||(_e=Hn.handle=function(Yr){return u!==void 0&&u.event.triggered!==Yr.type?u.event.dispatch.apply(y,arguments):void 0}),Ve=(E=(E||"").match(xe)||[""]).length;Ve--;)Lt=Pt=(Me=Di.exec(E[Ve])||[])[1],kn=(Me[2]||"").split(".").sort(),Lt&&(ft=u.event.special[Lt]||{},Lt=(de?ft.delegateType:ft.bindType)||Lt,ft=u.event.special[Lt]||{},rt=u.extend({type:Lt,origType:Pt,data:re,handler:K,guid:K.guid,selector:de,needsContext:de&&u.expr.match.needsContext.test(de),namespace:kn.join(".")},fe),(ct=Se[Lt])||((ct=Se[Lt]=[]).delegateCount=0,ft.setup&&ft.setup.call(y,re,kn,_e)!==!1||y.addEventListener&&y.addEventListener(Lt,_e)),ft.add&&(ft.add.call(y,rt),rt.handler.guid||(rt.handler.guid=K.guid)),de?ct.splice(ct.delegateCount++,0,rt):ct.push(rt),u.event.global[Lt]=!0)},remove:function(y,E,K,re,de){var fe,_e,Me,Se,Ve,rt,ft,ct,Lt,kn,Pt,Hn=Ue.hasData(y)&&Ue.get(y);if(Hn&&(Se=Hn.events)){for(Ve=(E=(E||"").match(xe)||[""]).length;Ve--;)if(Lt=Pt=(Me=Di.exec(E[Ve])||[])[1],kn=(Me[2]||"").split(".").sort(),Lt){for(ft=u.event.special[Lt]||{},ct=Se[Lt=(re?ft.delegateType:ft.bindType)||Lt]||[],Me=Me[2]&&new RegExp("(^|\\.)"+kn.join("\\.(?:.*\\.|)")+"(\\.|$)"),_e=fe=ct.length;fe--;)rt=ct[fe],!de&&Pt!==rt.origType||K&&K.guid!==rt.guid||Me&&!Me.test(rt.namespace)||re&&re!==rt.selector&&(re!=="**"||!rt.selector)||(ct.splice(fe,1),rt.selector&&ct.delegateCount--,ft.remove&&ft.remove.call(y,rt));_e&&!ct.length&&(ft.teardown&&ft.teardown.call(y,kn,Hn.handle)!==!1||u.removeEvent(y,Lt,Hn.handle),delete Se[Lt])}else for(Lt in Se)u.event.remove(y,Lt+E[Ve],K,re,!0);u.isEmptyObject(Se)&&Ue.remove(y,"handle events")}},dispatch:function(y){var E,K,re,de,fe,_e,Me=new Array(arguments.length),Se=u.event.fix(y),Ve=(Ue.get(this,"events")||Object.create(null))[Se.type]||[],rt=u.event.special[Se.type]||{};for(Me[0]=Se,E=1;E<arguments.length;E++)Me[E]=arguments[E];if(Se.delegateTarget=this,!rt.preDispatch||rt.preDispatch.call(this,Se)!==!1){for(_e=u.event.handlers.call(this,Se,Ve),E=0;(de=_e[E++])&&!Se.isPropagationStopped();)for(Se.currentTarget=de.elem,K=0;(fe=de.handlers[K++])&&!Se.isImmediatePropagationStopped();)Se.rnamespace&&fe.namespace!==!1&&!Se.rnamespace.test(fe.namespace)||(Se.handleObj=fe,Se.data=fe.data,(re=((u.event.special[fe.origType]||{}).handle||fe.handler).apply(de.elem,Me))!==void 0&&(Se.result=re)===!1&&(Se.preventDefault(),Se.stopPropagation()));return rt.postDispatch&&rt.postDispatch.call(this,Se),Se.result}},handlers:function(y,E){var K,re,de,fe,_e,Me=[],Se=E.delegateCount,Ve=y.target;if(Se&&Ve.nodeType&&!(y.type==="click"&&y.button>=1)){for(;Ve!==this;Ve=Ve.parentNode||this)if(Ve.nodeType===1&&(y.type!=="click"||Ve.disabled!==!0)){for(fe=[],_e={},K=0;K<Se;K++)_e[de=(re=E[K]).selector+" "]===void 0&&(_e[de]=re.needsContext?u(de,this).index(Ve)>-1:u.find(de,this,null,[Ve]).length),_e[de]&&fe.push(re);fe.length&&Me.push({elem:Ve,handlers:fe})}}return Ve=this,Se<E.length&&Me.push({elem:Ve,handlers:E.slice(Se)}),Me},addProp:function(y,E){Object.defineProperty(u.Event.prototype,y,{enumerable:!0,configurable:!0,get:_(E)?function(){if(this.originalEvent)return E(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[y]},set:function(K){Object.defineProperty(this,y,{enumerable:!0,configurable:!0,writable:!0,value:K})}})},fix:function(y){return y[u.expando]?y:new u.Event(y)},special:{load:{noBubble:!0},click:{setup:function(y){var E=this||y;return tn.test(E.type)&&E.click&&f(E,"input")&&H(E,"click",!0),!1},trigger:function(y){var E=this||y;return tn.test(E.type)&&E.click&&f(E,"input")&&H(E,"click"),!0},_default:function(y){var E=y.target;return tn.test(E.type)&&E.click&&f(E,"input")&&Ue.get(E,"click")||f(E,"a")}},beforeunload:{postDispatch:function(y){y.result!==void 0&&y.originalEvent&&(y.originalEvent.returnValue=y.result)}}}},u.removeEvent=function(y,E,K){y.removeEventListener&&y.removeEventListener(E,K)},u.Event=function(y,E){if(!(this instanceof u.Event))return new u.Event(y,E);y&&y.type?(this.originalEvent=y,this.type=y.type,this.isDefaultPrevented=y.defaultPrevented||y.defaultPrevented===void 0&&y.returnValue===!1?wi:or,this.target=y.target&&y.target.nodeType===3?y.target.parentNode:y.target,this.currentTarget=y.currentTarget,this.relatedTarget=y.relatedTarget):this.type=y,E&&u.extend(this,E),this.timeStamp=y&&y.timeStamp||Date.now(),this[u.expando]=!0},u.Event.prototype={constructor:u.Event,isDefaultPrevented:or,isPropagationStopped:or,isImmediatePropagationStopped:or,isSimulated:!1,preventDefault:function(){var y=this.originalEvent;this.isDefaultPrevented=wi,y&&!this.isSimulated&&y.preventDefault()},stopPropagation:function(){var y=this.originalEvent;this.isPropagationStopped=wi,y&&!this.isSimulated&&y.stopPropagation()},stopImmediatePropagation:function(){var y=this.originalEvent;this.isImmediatePropagationStopped=wi,y&&!this.isSimulated&&y.stopImmediatePropagation(),this.stopPropagation()}},u.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},u.event.addProp),u.each({focus:"focusin",blur:"focusout"},function(y,E){function K(re){if(k.documentMode){var de=Ue.get(this,"handle"),fe=u.event.fix(re);fe.type=re.type==="focusin"?"focus":"blur",fe.isSimulated=!0,de(re),fe.target===fe.currentTarget&&de(fe)}else u.event.simulate(E,re.target,u.event.fix(re))}u.event.special[y]={setup:function(){var re;if(H(this,y,!0),!k.documentMode)return!1;(re=Ue.get(this,E))||this.addEventListener(E,K),Ue.set(this,E,(re||0)+1)},trigger:function(){return H(this,y),!0},teardown:function(){var re;if(!k.documentMode)return!1;(re=Ue.get(this,E)-1)?Ue.set(this,E,re):(this.removeEventListener(E,K),Ue.remove(this,E))},_default:function(re){return Ue.get(re.target,y)},delegateType:E},u.event.special[E]={setup:function(){var re=this.ownerDocument||this.document||this,de=k.documentMode?this:re,fe=Ue.get(de,E);fe||(k.documentMode?this.addEventListener(E,K):re.addEventListener(y,K,!0)),Ue.set(de,E,(fe||0)+1)},teardown:function(){var re=this.ownerDocument||this.document||this,de=k.documentMode?this:re,fe=Ue.get(de,E)-1;fe?Ue.set(de,E,fe):(k.documentMode?this.removeEventListener(E,K):re.removeEventListener(y,K,!0),Ue.remove(de,E))}}}),u.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(y,E){u.event.special[y]={delegateType:E,bindType:E,handle:function(K){var re,de=K.relatedTarget,fe=K.handleObj;return de&&(de===this||u.contains(this,de))||(K.type=fe.origType,re=fe.handler.apply(this,arguments),K.type=E),re}}}),u.fn.extend({on:function(y,E,K,re){return ni(this,y,E,K,re)},one:function(y,E,K,re){return ni(this,y,E,K,re,1)},off:function(y,E,K){var re,de;if(y&&y.preventDefault&&y.handleObj)return re=y.handleObj,u(y.delegateTarget).off(re.namespace?re.origType+"."+re.namespace:re.origType,re.selector,re.handler),this;if(typeof y=="object"){for(de in y)this.off(de,E,y[de]);return this}return E!==!1&&typeof E!="function"||(K=E,E=void 0),K===!1&&(K=or),this.each(function(){u.event.remove(this,y,K,E)})}});var Nr=/<script|<style|<link/i,Ri=/checked\s*(?:[^=]|=\s*.checked.)/i,Zn=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Xi(y,E){return f(y,"table")&&f(E.nodeType!==11?E:E.firstChild,"tr")&&u(y).children("tbody")[0]||y}function xo(y){return y.type=(y.getAttribute("type")!==null)+"/"+y.type,y}function Bs(y){return(y.type||"").slice(0,5)==="true/"?y.type=y.type.slice(5):y.removeAttribute("type"),y}function ts(y,E){var K,re,de,fe,_e,Me;if(E.nodeType===1){if(Ue.hasData(y)&&(Me=Ue.get(y).events))for(de in Ue.remove(E,"handle events"),Me)for(K=0,re=Me[de].length;K<re;K++)u.event.add(E,de,Me[de][K]);Zt.hasData(y)&&(fe=Zt.access(y),_e=u.extend({},fe),Zt.set(E,_e))}}function ms(y,E){var K=E.nodeName.toLowerCase();K==="input"&&tn.test(y.type)?E.checked=y.checked:K!=="input"&&K!=="textarea"||(E.defaultValue=y.defaultValue)}function no(y,E,K,re){E=U(E);var de,fe,_e,Me,Se,Ve,rt=0,ft=y.length,ct=ft-1,Lt=E[0],kn=_(Lt);if(kn||ft>1&&typeof Lt=="string"&&!T.checkClone&&Ri.test(Lt))return y.each(function(Pt){var Hn=y.eq(Pt);kn&&(E[0]=Lt.call(this,Pt,Hn.html())),no(Hn,E,K,re)});if(ft&&(fe=(de=ba(E,y[0].ownerDocument,!1,y,re)).firstChild,de.childNodes.length===1&&(de=fe),fe||re)){for(Me=(_e=u.map(Tr(de,"script"),xo)).length;rt<ft;rt++)Se=de,rt!==ct&&(Se=u.clone(Se,!0,!0),Me&&u.merge(_e,Tr(Se,"script"))),K.call(y[rt],Se,rt);if(Me)for(Ve=_e[_e.length-1].ownerDocument,u.map(_e,Bs),rt=0;rt<Me;rt++)Se=_e[rt],br.test(Se.type||"")&&!Ue.access(Se,"globalEval")&&u.contains(Ve,Se)&&(Se.src&&(Se.type||"").toLowerCase()!=="module"?u._evalUrl&&!Se.noModule&&u._evalUrl(Se.src,{nonce:Se.nonce||Se.getAttribute("nonce")},Ve):G(Se.textContent.replace(Zn,""),Se,Ve))}return y}function ns(y,E,K){for(var re,de=E?u.filter(E,y):y,fe=0;(re=de[fe])!=null;fe++)K||re.nodeType!==1||u.cleanData(Tr(re)),re.parentNode&&(K&&Yn(re)&&ti(Tr(re,"script")),re.parentNode.removeChild(re));return y}u.extend({htmlPrefilter:function(y){return y},clone:function(y,E,K){var re,de,fe,_e,Me=y.cloneNode(!0),Se=Yn(y);if(!(T.noCloneChecked||y.nodeType!==1&&y.nodeType!==11||u.isXMLDoc(y)))for(_e=Tr(Me),re=0,de=(fe=Tr(y)).length;re<de;re++)ms(fe[re],_e[re]);if(E)if(K)for(fe=fe||Tr(y),_e=_e||Tr(Me),re=0,de=fe.length;re<de;re++)ts(fe[re],_e[re]);else ts(y,Me);return(_e=Tr(Me,"script")).length>0&&ti(_e,!Se&&Tr(y,"script")),Me},cleanData:function(y){for(var E,K,re,de=u.event.special,fe=0;(K=y[fe])!==void 0;fe++)if(er(K)){if(E=K[Ue.expando]){if(E.events)for(re in E.events)de[re]?u.event.remove(K,re):u.removeEvent(K,re,E.handle);K[Ue.expando]=void 0}K[Zt.expando]&&(K[Zt.expando]=void 0)}}}),u.fn.extend({detach:function(y){return ns(this,y,!0)},remove:function(y){return ns(this,y)},text:function(y){return He(this,function(E){return E===void 0?u.text(this):this.empty().each(function(){this.nodeType!==1&&this.nodeType!==11&&this.nodeType!==9||(this.textContent=E)})},null,y,arguments.length)},append:function(){return no(this,arguments,function(y){this.nodeType!==1&&this.nodeType!==11&&this.nodeType!==9||Xi(this,y).appendChild(y)})},prepend:function(){return no(this,arguments,function(y){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var E=Xi(this,y);E.insertBefore(y,E.firstChild)}})},before:function(){return no(this,arguments,function(y){this.parentNode&&this.parentNode.insertBefore(y,this)})},after:function(){return no(this,arguments,function(y){this.parentNode&&this.parentNode.insertBefore(y,this.nextSibling)})},empty:function(){for(var y,E=0;(y=this[E])!=null;E++)y.nodeType===1&&(u.cleanData(Tr(y,!1)),y.textContent="");return this},clone:function(y,E){return y=y!=null&&y,E=E==null?y:E,this.map(function(){return u.clone(this,y,E)})},html:function(y){return He(this,function(E){var K=this[0]||{},re=0,de=this.length;if(E===void 0&&K.nodeType===1)return K.innerHTML;if(typeof E=="string"&&!Nr.test(E)&&!Mr[(En.exec(E)||["",""])[1].toLowerCase()]){E=u.htmlPrefilter(E);try{for(;re<de;re++)(K=this[re]||{}).nodeType===1&&(u.cleanData(Tr(K,!1)),K.innerHTML=E);K=0}catch(fe){}}K&&this.empty().append(E)},null,y,arguments.length)},replaceWith:function(){var y=[];return no(this,arguments,function(E){var K=this.parentNode;u.inArray(this,y)<0&&(u.cleanData(Tr(this)),K&&K.replaceChild(E,this))},y)}}),u.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(y,E){u.fn[y]=function(K){for(var re,de=[],fe=u(K),_e=fe.length-1,Me=0;Me<=_e;Me++)re=Me===_e?this:this.clone(!0),u(fe[Me])[E](re),V.apply(de,re.get());return this.pushStack(de)}});var la=new RegExp("^("+lt+")(?!px)[a-z%]+$","i"),Fo=/^--/,Aa=function(y){var E=y.ownerDocument.defaultView;return E&&E.opener||(E=a),E.getComputedStyle(y)},gs=function(y,E,K){var re,de,fe={};for(de in E)fe[de]=y.style[de],y.style[de]=E[de];for(de in re=K.call(y),E)y.style[de]=fe[de];return re},Gs=new RegExp(xn.join("|"),"i");function ro(y,E,K){var re,de,fe,_e,Me=Fo.test(E),Se=y.style;return(K=K||Aa(y))&&(_e=K.getPropertyValue(E)||K[E],Me&&_e&&(_e=_e.replace(te,"$1")||void 0),_e!==""||Yn(y)||(_e=u.style(y,E)),!T.pixelBoxStyles()&&la.test(_e)&&Gs.test(E)&&(re=Se.width,de=Se.minWidth,fe=Se.maxWidth,Se.minWidth=Se.maxWidth=Se.width=_e,_e=K.width,Se.width=re,Se.minWidth=de,Se.maxWidth=fe)),_e!==void 0?_e+"":_e}function ys(y,E){return{get:function(){if(!y())return(this.get=E).apply(this,arguments);delete this.get}}}(function(){function y(){if(Ve){Se.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",Ve.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",$t.appendChild(Se).appendChild(Ve);var rt=a.getComputedStyle(Ve);K=rt.top!=="1%",Me=E(rt.marginLeft)===12,Ve.style.right="60%",fe=E(rt.right)===36,re=E(rt.width)===36,Ve.style.position="absolute",de=E(Ve.offsetWidth/3)===12,$t.removeChild(Se),Ve=null}}function E(rt){return Math.round(parseFloat(rt))}var K,re,de,fe,_e,Me,Se=k.createElement("div"),Ve=k.createElement("div");Ve.style&&(Ve.style.backgroundClip="content-box",Ve.cloneNode(!0).style.backgroundClip="",T.clearCloneStyle=Ve.style.backgroundClip==="content-box",u.extend(T,{boxSizingReliable:function(){return y(),re},pixelBoxStyles:function(){return y(),fe},pixelPosition:function(){return y(),K},reliableMarginLeft:function(){return y(),Me},scrollboxSize:function(){return y(),de},reliableTrDimensions:function(){var rt,ft,ct,Lt;return _e==null&&(rt=k.createElement("table"),ft=k.createElement("tr"),ct=k.createElement("div"),rt.style.cssText="position:absolute;left:-11111px;border-collapse:separate",ft.style.cssText="border:1px solid",ft.style.height="1px",ct.style.height="9px",ct.style.display="block",$t.appendChild(rt).appendChild(ft).appendChild(ct),Lt=a.getComputedStyle(ft),_e=parseInt(Lt.height,10)+parseInt(Lt.borderTopWidth,10)+parseInt(Lt.borderBottomWidth,10)===ft.offsetHeight,$t.removeChild(rt)),_e}}))})();var Oa=["Webkit","Moz","ms"],vs=k.createElement("div").style,io={};function ao(y){return u.cssProps[y]||io[y]||(y in vs?y:io[y]=function(E){for(var K=E[0].toUpperCase()+E.slice(1),re=Oa.length;re--;)if((E=Oa[re]+K)in vs)return E}(y)||y)}var qr=/^(none|table(?!-c[ea]).+)/,Dr={position:"absolute",visibility:"hidden",display:"block"},rs={letterSpacing:"0",fontWeight:"400"};function xs(y,E,K){var re=Xt.exec(E);return re?Math.max(0,re[2]-(K||0))+(re[3]||"px"):E}function is(y,E,K,re,de,fe){var _e=E==="width"?1:0,Me=0,Se=0,Ve=0;if(K===(re?"border":"content"))return 0;for(;_e<4;_e+=2)K==="margin"&&(Ve+=u.css(y,K+xn[_e],!0,de)),re?(K==="content"&&(Se-=u.css(y,"padding"+xn[_e],!0,de)),K!=="margin"&&(Se-=u.css(y,"border"+xn[_e]+"Width",!0,de))):(Se+=u.css(y,"padding"+xn[_e],!0,de),K!=="padding"?Se+=u.css(y,"border"+xn[_e]+"Width",!0,de):Me+=u.css(y,"border"+xn[_e]+"Width",!0,de));return!re&&fe>=0&&(Se+=Math.max(0,Math.ceil(y["offset"+E[0].toUpperCase()+E.slice(1)]-fe-Se-Me-.5))||0),Se+Ve}function Bo(y,E,K){var re=Aa(y),de=(!T.boxSizingReliable()||K)&&u.css(y,"boxSizing",!1,re)==="border-box",fe=de,_e=ro(y,E,re),Me="offset"+E[0].toUpperCase()+E.slice(1);if(la.test(_e)){if(!K)return _e;_e="auto"}return(!T.boxSizingReliable()&&de||!T.reliableTrDimensions()&&f(y,"tr")||_e==="auto"||!parseFloat(_e)&&u.css(y,"display",!1,re)==="inline")&&y.getClientRects().length&&(de=u.css(y,"boxSizing",!1,re)==="border-box",(fe=Me in y)&&(_e=y[Me])),(_e=parseFloat(_e)||0)+is(y,E,K||(de?"border":"content"),fe,re,_e)+"px"}function Yi(y,E,K,re,de){return new Yi.prototype.init(y,E,K,re,de)}u.extend({cssHooks:{opacity:{get:function(y,E){if(E){var K=ro(y,"opacity");return K===""?"1":K}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!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,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(y,E,K,re){if(y&&y.nodeType!==3&&y.nodeType!==8&&y.style){var de,fe,_e,Me=nn(E),Se=Fo.test(E),Ve=y.style;if(Se||(E=ao(Me)),_e=u.cssHooks[E]||u.cssHooks[Me],K===void 0)return _e&&"get"in _e&&(de=_e.get(y,!1,re))!==void 0?de:Ve[E];(fe=typeof K)=="string"&&(de=Xt.exec(K))&&de[1]&&(K=$e(y,E,de),fe="number"),K!=null&&K==K&&(fe!=="number"||Se||(K+=de&&de[3]||(u.cssNumber[Me]?"":"px")),T.clearCloneStyle||K!==""||E.indexOf("background")!==0||(Ve[E]="inherit"),_e&&"set"in _e&&(K=_e.set(y,K,re))===void 0||(Se?Ve.setProperty(E,K):Ve[E]=K))}},css:function(y,E,K,re){var de,fe,_e,Me=nn(E);return Fo.test(E)||(E=ao(Me)),(_e=u.cssHooks[E]||u.cssHooks[Me])&&"get"in _e&&(de=_e.get(y,!0,K)),de===void 0&&(de=ro(y,E,re)),de==="normal"&&E in rs&&(de=rs[E]),K===""||K?(fe=parseFloat(de),K===!0||isFinite(fe)?fe||0:de):de}}),u.each(["height","width"],function(y,E){u.cssHooks[E]={get:function(K,re,de){if(re)return!qr.test(u.css(K,"display"))||K.getClientRects().length&&K.getBoundingClientRect().width?Bo(K,E,de):gs(K,Dr,function(){return Bo(K,E,de)})},set:function(K,re,de){var fe,_e=Aa(K),Me=!T.scrollboxSize()&&_e.position==="absolute",Se=(Me||de)&&u.css(K,"boxSizing",!1,_e)==="border-box",Ve=de?is(K,E,de,Se,_e):0;return Se&&Me&&(Ve-=Math.ceil(K["offset"+E[0].toUpperCase()+E.slice(1)]-parseFloat(_e[E])-is(K,E,"border",!1,_e)-.5)),Ve&&(fe=Xt.exec(re))&&(fe[3]||"px")!=="px"&&(K.style[E]=re,re=u.css(K,E)),xs(0,re,Ve)}}}),u.cssHooks.marginLeft=ys(T.reliableMarginLeft,function(y,E){if(E)return(parseFloat(ro(y,"marginLeft"))||y.getBoundingClientRect().left-gs(y,{marginLeft:0},function(){return y.getBoundingClientRect().left}))+"px"}),u.each({margin:"",padding:"",border:"Width"},function(y,E){u.cssHooks[y+E]={expand:function(K){for(var re=0,de={},fe=typeof K=="string"?K.split(" "):[K];re<4;re++)de[y+xn[re]+E]=fe[re]||fe[re-2]||fe[0];return de}},y!=="margin"&&(u.cssHooks[y+E].set=xs)}),u.fn.extend({css:function(y,E){return He(this,function(K,re,de){var fe,_e,Me={},Se=0;if(Array.isArray(re)){for(fe=Aa(K),_e=re.length;Se<_e;Se++)Me[re[Se]]=u.css(K,re[Se],!1,fe);return Me}return de!==void 0?u.style(K,re,de):u.css(K,re)},y,E,arguments.length>1)}}),u.Tween=Yi,Yi.prototype={constructor:Yi,init:function(y,E,K,re,de,fe){this.elem=y,this.prop=K,this.easing=de||u.easing._default,this.options=E,this.start=this.now=this.cur(),this.end=re,this.unit=fe||(u.cssNumber[K]?"":"px")},cur:function(){var y=Yi.propHooks[this.prop];return y&&y.get?y.get(this):Yi.propHooks._default.get(this)},run:function(y){var E,K=Yi.propHooks[this.prop];return this.options.duration?this.pos=E=u.easing[this.easing](y,this.options.duration*y,0,1,this.options.duration):this.pos=E=y,this.now=(this.end-this.start)*E+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),K&&K.set?K.set(this):Yi.propHooks._default.set(this),this}},Yi.prototype.init.prototype=Yi.prototype,Yi.propHooks={_default:{get:function(y){var E;return y.elem.nodeType!==1||y.elem[y.prop]!=null&&y.elem.style[y.prop]==null?y.elem[y.prop]:(E=u.css(y.elem,y.prop,""))&&E!=="auto"?E:0},set:function(y){u.fx.step[y.prop]?u.fx.step[y.prop](y):y.elem.nodeType!==1||!u.cssHooks[y.prop]&&y.elem.style[ao(y.prop)]==null?y.elem[y.prop]=y.now:u.style(y.elem,y.prop,y.now+y.unit)}}},Yi.propHooks.scrollTop=Yi.propHooks.scrollLeft={set:function(y){y.elem.nodeType&&y.elem.parentNode&&(y.elem[y.prop]=y.now)}},u.easing={linear:function(y){return y},swing:function(y){return .5-Math.cos(y*Math.PI)/2},_default:"swing"},u.fx=Yi.prototype.init,u.fx.step={};var jr,Q,Ce=/^(?:toggle|show|hide)$/,ce=/queueHooks$/;function Te(){Q&&(k.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(Te):a.setTimeout(Te,u.fx.interval),u.fx.tick())}function Ke(){return a.setTimeout(function(){jr=void 0}),jr=Date.now()}function vt(y,E){var K,re=0,de={height:y};for(E=E?1:0;re<4;re+=2-E)de["margin"+(K=xn[re])]=de["padding"+K]=y;return E&&(de.opacity=de.width=y),de}function Ft(y,E,K){for(var re,de=(Jt.tweeners[E]||[]).concat(Jt.tweeners["*"]),fe=0,_e=de.length;fe<_e;fe++)if(re=de[fe].call(K,E,y))return re}function Jt(y,E,K){var re,de,fe=0,_e=Jt.prefilters.length,Me=u.Deferred().always(function(){delete Se.elem}),Se=function(){if(de)return!1;for(var ft=jr||Ke(),ct=Math.max(0,Ve.startTime+Ve.duration-ft),Lt=1-(ct/Ve.duration||0),kn=0,Pt=Ve.tweens.length;kn<Pt;kn++)Ve.tweens[kn].run(Lt);return Me.notifyWith(y,[Ve,Lt,ct]),Lt<1&&Pt?ct:(Pt||Me.notifyWith(y,[Ve,1,0]),Me.resolveWith(y,[Ve]),!1)},Ve=Me.promise({elem:y,props:u.extend({},E),opts:u.extend(!0,{specialEasing:{},easing:u.easing._default},K),originalProperties:E,originalOptions:K,startTime:jr||Ke(),duration:K.duration,tweens:[],createTween:function(ft,ct){var Lt=u.Tween(y,Ve.opts,ft,ct,Ve.opts.specialEasing[ft]||Ve.opts.easing);return Ve.tweens.push(Lt),Lt},stop:function(ft){var ct=0,Lt=ft?Ve.tweens.length:0;if(de)return this;for(de=!0;ct<Lt;ct++)Ve.tweens[ct].run(1);return ft?(Me.notifyWith(y,[Ve,1,0]),Me.resolveWith(y,[Ve,ft])):Me.rejectWith(y,[Ve,ft]),this}}),rt=Ve.props;for(function(ft,ct){var Lt,kn,Pt,Hn,Yr;for(Lt in ft)if(Pt=ct[kn=nn(Lt)],Hn=ft[Lt],Array.isArray(Hn)&&(Pt=Hn[1],Hn=ft[Lt]=Hn[0]),Lt!==kn&&(ft[kn]=Hn,delete ft[Lt]),(Yr=u.cssHooks[kn])&&"expand"in Yr)for(Lt in Hn=Yr.expand(Hn),delete ft[kn],Hn)Lt in ft||(ft[Lt]=Hn[Lt],ct[Lt]=Pt);else ct[kn]=Pt}(rt,Ve.opts.specialEasing);fe<_e;fe++)if(re=Jt.prefilters[fe].call(Ve,y,rt,Ve.opts))return _(re.stop)&&(u._queueHooks(Ve.elem,Ve.opts.queue).stop=re.stop.bind(re)),re;return u.map(rt,Ft,Ve),_(Ve.opts.start)&&Ve.opts.start.call(y,Ve),Ve.progress(Ve.opts.progress).done(Ve.opts.done,Ve.opts.complete).fail(Ve.opts.fail).always(Ve.opts.always),u.fx.timer(u.extend(Se,{elem:y,anim:Ve,queue:Ve.opts.queue})),Ve}u.Animation=u.extend(Jt,{tweeners:{"*":[function(y,E){var K=this.createTween(y,E);return $e(K.elem,y,Xt.exec(E),K),K}]},tweener:function(y,E){_(y)?(E=y,y=["*"]):y=y.match(xe);for(var K,re=0,de=y.length;re<de;re++)K=y[re],Jt.tweeners[K]=Jt.tweeners[K]||[],Jt.tweeners[K].unshift(E)},prefilters:[function(y,E,K){var re,de,fe,_e,Me,Se,Ve,rt,ft="width"in E||"height"in E,ct=this,Lt={},kn=y.style,Pt=y.nodeType&&Br(y),Hn=Ue.get(y,"fxshow");for(re in K.queue||((_e=u._queueHooks(y,"fx")).unqueued==null&&(_e.unqueued=0,Me=_e.empty.fire,_e.empty.fire=function(){_e.unqueued||Me()}),_e.unqueued++,ct.always(function(){ct.always(function(){_e.unqueued--,u.queue(y,"fx").length||_e.empty.fire()})})),E)if(de=E[re],Ce.test(de)){if(delete E[re],fe=fe||de==="toggle",de===(Pt?"hide":"show")){if(de!=="show"||!Hn||Hn[re]===void 0)continue;Pt=!0}Lt[re]=Hn&&Hn[re]||u.style(y,re)}if((Se=!u.isEmptyObject(E))||!u.isEmptyObject(Lt))for(re in ft&&y.nodeType===1&&(K.overflow=[kn.overflow,kn.overflowX,kn.overflowY],(Ve=Hn&&Hn.display)==null&&(Ve=Ue.get(y,"display")),(rt=u.css(y,"display"))==="none"&&(Ve?rt=Ve:(Ie([y],!0),Ve=y.style.display||Ve,rt=u.css(y,"display"),Ie([y]))),(rt==="inline"||rt==="inline-block"&&Ve!=null)&&u.css(y,"float")==="none"&&(Se||(ct.done(function(){kn.display=Ve}),Ve==null&&(rt=kn.display,Ve=rt==="none"?"":rt)),kn.display="inline-block")),K.overflow&&(kn.overflow="hidden",ct.always(function(){kn.overflow=K.overflow[0],kn.overflowX=K.overflow[1],kn.overflowY=K.overflow[2]})),Se=!1,Lt)Se||(Hn?"hidden"in Hn&&(Pt=Hn.hidden):Hn=Ue.access(y,"fxshow",{display:Ve}),fe&&(Hn.hidden=!Pt),Pt&&Ie([y],!0),ct.done(function(){for(re in Pt||Ie([y]),Ue.remove(y,"fxshow"),Lt)u.style(y,re,Lt[re])})),Se=Ft(Pt?Hn[re]:0,re,ct),re in Hn||(Hn[re]=Se.start,Pt&&(Se.end=Se.start,Se.start=0))}],prefilter:function(y,E){E?Jt.prefilters.unshift(y):Jt.prefilters.push(y)}}),u.speed=function(y,E,K){var re=y&&typeof y=="object"?u.extend({},y):{complete:K||!K&&E||_(y)&&y,duration:y,easing:K&&E||E&&!_(E)&&E};return u.fx.off?re.duration=0:typeof re.duration!="number"&&(re.duration in u.fx.speeds?re.duration=u.fx.speeds[re.duration]:re.duration=u.fx.speeds._default),re.queue!=null&&re.queue!==!0||(re.queue="fx"),re.old=re.complete,re.complete=function(){_(re.old)&&re.old.call(this),re.queue&&u.dequeue(this,re.queue)},re},u.fn.extend({fadeTo:function(y,E,K,re){return this.filter(Br).css("opacity",0).show().end().animate({opacity:E},y,K,re)},animate:function(y,E,K,re){var de=u.isEmptyObject(y),fe=u.speed(E,K,re),_e=function(){var Me=Jt(this,u.extend({},y),fe);(de||Ue.get(this,"finish"))&&Me.stop(!0)};return _e.finish=_e,de||fe.queue===!1?this.each(_e):this.queue(fe.queue,_e)},stop:function(y,E,K){var re=function(de){var fe=de.stop;delete de.stop,fe(K)};return typeof y!="string"&&(K=E,E=y,y=void 0),E&&this.queue(y||"fx",[]),this.each(function(){var de=!0,fe=y!=null&&y+"queueHooks",_e=u.timers,Me=Ue.get(this);if(fe)Me[fe]&&Me[fe].stop&&re(Me[fe]);else for(fe in Me)Me[fe]&&Me[fe].stop&&ce.test(fe)&&re(Me[fe]);for(fe=_e.length;fe--;)_e[fe].elem!==this||y!=null&&_e[fe].queue!==y||(_e[fe].anim.stop(K),de=!1,_e.splice(fe,1));!de&&K||u.dequeue(this,y)})},finish:function(y){return y!==!1&&(y=y||"fx"),this.each(function(){var E,K=Ue.get(this),re=K[y+"queue"],de=K[y+"queueHooks"],fe=u.timers,_e=re?re.length:0;for(K.finish=!0,u.queue(this,y,[]),de&&de.stop&&de.stop.call(this,!0),E=fe.length;E--;)fe[E].elem===this&&fe[E].queue===y&&(fe[E].anim.stop(!0),fe.splice(E,1));for(E=0;E<_e;E++)re[E]&&re[E].finish&&re[E].finish.call(this);delete K.finish})}}),u.each(["toggle","show","hide"],function(y,E){var K=u.fn[E];u.fn[E]=function(re,de,fe){return re==null||typeof re=="boolean"?K.apply(this,arguments):this.animate(vt(E,!0),re,de,fe)}}),u.each({slideDown:vt("show"),slideUp:vt("hide"),slideToggle:vt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(y,E){u.fn[y]=function(K,re,de){return this.animate(E,K,re,de)}}),u.timers=[],u.fx.tick=function(){var y,E=0,K=u.timers;for(jr=Date.now();E<K.length;E++)(y=K[E])()||K[E]!==y||K.splice(E--,1);K.length||u.fx.stop(),jr=void 0},u.fx.timer=function(y){u.timers.push(y),u.fx.start()},u.fx.interval=13,u.fx.start=function(){Q||(Q=!0,Te())},u.fx.stop=function(){Q=null},u.fx.speeds={slow:600,fast:200,_default:400},u.fn.delay=function(y,E){return y=u.fx&&u.fx.speeds[y]||y,E=E||"fx",this.queue(E,function(K,re){var de=a.setTimeout(K,y);re.stop=function(){a.clearTimeout(de)}})},function(){var y=k.createElement("input"),E=k.createElement("select").appendChild(k.createElement("option"));y.type="checkbox",T.checkOn=y.value!=="",T.optSelected=E.selected,(y=k.createElement("input")).value="t",y.type="radio",T.radioValue=y.value==="t"}();var In,Gn=u.expr.attrHandle;u.fn.extend({attr:function(y,E){return He(this,u.attr,y,E,arguments.length>1)},removeAttr:function(y){return this.each(function(){u.removeAttr(this,y)})}}),u.extend({attr:function(y,E,K){var re,de,fe=y.nodeType;if(fe!==3&&fe!==8&&fe!==2)return y.getAttribute===void 0?u.prop(y,E,K):(fe===1&&u.isXMLDoc(y)||(de=u.attrHooks[E.toLowerCase()]||(u.expr.match.bool.test(E)?In:void 0)),K!==void 0?K===null?void u.removeAttr(y,E):de&&"set"in de&&(re=de.set(y,K,E))!==void 0?re:(y.setAttribute(E,K+""),K):de&&"get"in de&&(re=de.get(y,E))!==null?re:(re=u.find.attr(y,E))==null?void 0:re)},attrHooks:{type:{set:function(y,E){if(!T.radioValue&&E==="radio"&&f(y,"input")){var K=y.value;return y.setAttribute("type",E),K&&(y.value=K),E}}}},removeAttr:function(y,E){var K,re=0,de=E&&E.match(xe);if(de&&y.nodeType===1)for(;K=de[re++];)y.removeAttribute(K)}}),In={set:function(y,E,K){return E===!1?u.removeAttr(y,K):y.setAttribute(K,K),K}},u.each(u.expr.match.bool.source.match(/\w+/g),function(y,E){var K=Gn[E]||u.find.attr;Gn[E]=function(re,de,fe){var _e,Me,Se=de.toLowerCase();return fe||(Me=Gn[Se],Gn[Se]=_e,_e=K(re,de,fe)!=null?Se:null,Gn[Se]=Me),_e}});var sr=/^(?:input|select|textarea|button)$/i,hi=/^(?:a|area)$/i;function oo(y){return(y.match(xe)||[]).join(" ")}function Ei(y){return y.getAttribute&&y.getAttribute("class")||""}function wo(y){return Array.isArray(y)?y:typeof y=="string"&&y.match(xe)||[]}u.fn.extend({prop:function(y,E){return He(this,u.prop,y,E,arguments.length>1)},removeProp:function(y){return this.each(function(){delete this[u.propFix[y]||y]})}}),u.extend({prop:function(y,E,K){var re,de,fe=y.nodeType;if(fe!==3&&fe!==8&&fe!==2)return fe===1&&u.isXMLDoc(y)||(E=u.propFix[E]||E,de=u.propHooks[E]),K!==void 0?de&&"set"in de&&(re=de.set(y,K,E))!==void 0?re:y[E]=K:de&&"get"in de&&(re=de.get(y,E))!==null?re:y[E]},propHooks:{tabIndex:{get:function(y){var E=u.find.attr(y,"tabindex");return E?parseInt(E,10):sr.test(y.nodeName)||hi.test(y.nodeName)&&y.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),T.optSelected||(u.propHooks.selected={get:function(y){var E=y.parentNode;return E&&E.parentNode&&E.parentNode.selectedIndex,null},set:function(y){var E=y.parentNode;E&&(E.selectedIndex,E.parentNode&&E.parentNode.selectedIndex)}}),u.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){u.propFix[this.toLowerCase()]=this}),u.fn.extend({addClass:function(y){var E,K,re,de,fe,_e;return _(y)?this.each(function(Me){u(this).addClass(y.call(this,Me,Ei(this)))}):(E=wo(y)).length?this.each(function(){if(re=Ei(this),K=this.nodeType===1&&" "+oo(re)+" "){for(fe=0;fe<E.length;fe++)de=E[fe],K.indexOf(" "+de+" ")<0&&(K+=de+" ");_e=oo(K),re!==_e&&this.setAttribute("class",_e)}}):this},removeClass:function(y){var E,K,re,de,fe,_e;return _(y)?this.each(function(Me){u(this).removeClass(y.call(this,Me,Ei(this)))}):arguments.length?(E=wo(y)).length?this.each(function(){if(re=Ei(this),K=this.nodeType===1&&" "+oo(re)+" "){for(fe=0;fe<E.length;fe++)for(de=E[fe];K.indexOf(" "+de+" ")>-1;)K=K.replace(" "+de+" "," ");_e=oo(K),re!==_e&&this.setAttribute("class",_e)}}):this:this.attr("class","")},toggleClass:function(y,E){var K,re,de,fe,_e=typeof y,Me=_e==="string"||Array.isArray(y);return _(y)?this.each(function(Se){u(this).toggleClass(y.call(this,Se,Ei(this),E),E)}):typeof E=="boolean"&&Me?E?this.addClass(y):this.removeClass(y):(K=wo(y),this.each(function(){if(Me)for(fe=u(this),de=0;de<K.length;de++)re=K[de],fe.hasClass(re)?fe.removeClass(re):fe.addClass(re);else y!==void 0&&_e!=="boolean"||((re=Ei(this))&&Ue.set(this,"__className__",re),this.setAttribute&&this.setAttribute("class",re||y===!1?"":Ue.get(this,"__className__")||""))}))},hasClass:function(y){var E,K,re=0;for(E=" "+y+" ";K=this[re++];)if(K.nodeType===1&&(" "+oo(Ei(K))+" ").indexOf(E)>-1)return!0;return!1}});var Do=/\r/g;u.fn.extend({val:function(y){var E,K,re,de=this[0];return arguments.length?(re=_(y),this.each(function(fe){var _e;this.nodeType===1&&((_e=re?y.call(this,fe,u(this).val()):y)==null?_e="":typeof _e=="number"?_e+="":Array.isArray(_e)&&(_e=u.map(_e,function(Me){return Me==null?"":Me+""})),(E=u.valHooks[this.type]||u.valHooks[this.nodeName.toLowerCase()])&&"set"in E&&E.set(this,_e,"value")!==void 0||(this.value=_e))})):de?(E=u.valHooks[de.type]||u.valHooks[de.nodeName.toLowerCase()])&&"get"in E&&(K=E.get(de,"value"))!==void 0?K:typeof(K=de.value)=="string"?K.replace(Do,""):K==null?"":K:void 0}}),u.extend({valHooks:{option:{get:function(y){var E=u.find.attr(y,"value");return E!=null?E:oo(u.text(y))}},select:{get:function(y){var E,K,re,de=y.options,fe=y.selectedIndex,_e=y.type==="select-one",Me=_e?null:[],Se=_e?fe+1:de.length;for(re=fe<0?Se:_e?fe:0;re<Se;re++)if(((K=de[re]).selected||re===fe)&&!K.disabled&&(!K.parentNode.disabled||!f(K.parentNode,"optgroup"))){if(E=u(K).val(),_e)return E;Me.push(E)}return Me},set:function(y,E){for(var K,re,de=y.options,fe=u.makeArray(E),_e=de.length;_e--;)((re=de[_e]).selected=u.inArray(u.valHooks.option.get(re),fe)>-1)&&(K=!0);return K||(y.selectedIndex=-1),fe}}}}),u.each(["radio","checkbox"],function(){u.valHooks[this]={set:function(y,E){if(Array.isArray(E))return y.checked=u.inArray(u(y).val(),E)>-1}},T.checkOn||(u.valHooks[this].get=function(y){return y.getAttribute("value")===null?"on":y.value})});var so=a.location,zs={guid:Date.now()},Wr=/\?/;u.parseXML=function(y){var E,K;if(!y||typeof y!="string")return null;try{E=new a.DOMParser().parseFromString(y,"text/xml")}catch(re){}return K=E&&E.getElementsByTagName("parsererror")[0],E&&!K||u.error("Invalid XML: "+(K?u.map(K.childNodes,function(re){return re.textContent}).join(`
|
|
`):y)),E};var Ma=/^(?:focusinfocus|focusoutblur)$/,ka=function(y){y.stopPropagation()};u.extend(u.event,{trigger:function(y,E,K,re){var de,fe,_e,Me,Se,Ve,rt,ft,ct=[K||k],Lt=M.call(y,"type")?y.type:y,kn=M.call(y,"namespace")?y.namespace.split("."):[];if(fe=ft=_e=K=K||k,K.nodeType!==3&&K.nodeType!==8&&!Ma.test(Lt+u.event.triggered)&&(Lt.indexOf(".")>-1&&(Lt=(kn=Lt.split(".")).shift(),kn.sort()),Se=Lt.indexOf(":")<0&&"on"+Lt,(y=y[u.expando]?y:new u.Event(Lt,typeof y=="object"&&y)).isTrigger=re?2:3,y.namespace=kn.join("."),y.rnamespace=y.namespace?new RegExp("(^|\\.)"+kn.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,y.result=void 0,y.target||(y.target=K),E=E==null?[y]:u.makeArray(E,[y]),rt=u.event.special[Lt]||{},re||!rt.trigger||rt.trigger.apply(K,E)!==!1)){if(!re&&!rt.noBubble&&!Y(K)){for(Me=rt.delegateType||Lt,Ma.test(Me+Lt)||(fe=fe.parentNode);fe;fe=fe.parentNode)ct.push(fe),_e=fe;_e===(K.ownerDocument||k)&&ct.push(_e.defaultView||_e.parentWindow||a)}for(de=0;(fe=ct[de++])&&!y.isPropagationStopped();)ft=fe,y.type=de>1?Me:rt.bindType||Lt,(Ve=(Ue.get(fe,"events")||Object.create(null))[y.type]&&Ue.get(fe,"handle"))&&Ve.apply(fe,E),(Ve=Se&&fe[Se])&&Ve.apply&&er(fe)&&(y.result=Ve.apply(fe,E),y.result===!1&&y.preventDefault());return y.type=Lt,re||y.isDefaultPrevented()||rt._default&&rt._default.apply(ct.pop(),E)!==!1||!er(K)||Se&&_(K[Lt])&&!Y(K)&&((_e=K[Se])&&(K[Se]=null),u.event.triggered=Lt,y.isPropagationStopped()&&ft.addEventListener(Lt,ka),K[Lt](),y.isPropagationStopped()&&ft.removeEventListener(Lt,ka),u.event.triggered=void 0,_e&&(K[Se]=_e)),y.result}},simulate:function(y,E,K){var re=u.extend(new u.Event,K,{type:y,isSimulated:!0});u.event.trigger(re,null,E)}}),u.fn.extend({trigger:function(y,E){return this.each(function(){u.event.trigger(y,E,this)})},triggerHandler:function(y,E){var K=this[0];if(K)return u.event.trigger(y,E,K,!0)}});var na=/\[\]$/,Go=/\r?\n/g,ws=/^(?:submit|button|image|reset|file)$/i,yr=/^(?:input|select|textarea|keygen)/i;function zt(y,E,K,re){var de;if(Array.isArray(E))u.each(E,function(fe,_e){K||na.test(y)?re(y,_e):zt(y+"["+(typeof _e=="object"&&_e!=null?fe:"")+"]",_e,K,re)});else if(K||C(E)!=="object")re(y,E);else for(de in E)zt(y+"["+de+"]",E[de],K,re)}u.param=function(y,E){var K,re=[],de=function(fe,_e){var Me=_(_e)?_e():_e;re[re.length]=encodeURIComponent(fe)+"="+encodeURIComponent(Me==null?"":Me)};if(y==null)return"";if(Array.isArray(y)||y.jquery&&!u.isPlainObject(y))u.each(y,function(){de(this.name,this.value)});else for(K in y)zt(K,y[K],E,de);return re.join("&")},u.fn.extend({serialize:function(){return u.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var y=u.prop(this,"elements");return y?u.makeArray(y):this}).filter(function(){var y=this.type;return this.name&&!u(this).is(":disabled")&&yr.test(this.nodeName)&&!ws.test(y)&&(this.checked||!tn.test(y))}).map(function(y,E){var K=u(this).val();return K==null?null:Array.isArray(K)?u.map(K,function(re){return{name:E.name,value:re.replace(Go,`\r
|
|
`)}}):{name:E.name,value:K.replace(Go,`\r
|
|
`)}}).get()}});var Ai=/%20/g,zo=/#.*$/,cu=/([?&])_=[^&]*/,Xr=/^(.*?):[ \t]*([^\r\n]*)$/gm,Jr=/^(?:GET|HEAD)$/,Zi=/^\/\//,Us={},Gi={},bs="*/".concat("*"),Hs=k.createElement("a");function Re(y){return function(E,K){typeof E!="string"&&(K=E,E="*");var re,de=0,fe=E.toLowerCase().match(xe)||[];if(_(K))for(;re=fe[de++];)re[0]==="+"?(re=re.slice(1)||"*",(y[re]=y[re]||[]).unshift(K)):(y[re]=y[re]||[]).push(K)}}function Eo(y,E,K,re){var de={},fe=y===Gi;function _e(Me){var Se;return de[Me]=!0,u.each(y[Me]||[],function(Ve,rt){var ft=rt(E,K,re);return typeof ft!="string"||fe||de[ft]?fe?!(Se=ft):void 0:(E.dataTypes.unshift(ft),_e(ft),!1)}),Se}return _e(E.dataTypes[0])||!de["*"]&&_e("*")}function ra(y,E){var K,re,de=u.ajaxSettings.flatOptions||{};for(K in E)E[K]!==void 0&&((de[K]?y:re||(re={}))[K]=E[K]);return re&&u.extend(!0,y,re),y}Hs.href=so.href,u.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:so.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(so.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":bs,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":u.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(y,E){return E?ra(ra(y,u.ajaxSettings),E):ra(u.ajaxSettings,y)},ajaxPrefilter:Re(Us),ajaxTransport:Re(Gi),ajax:function(y,E){typeof y=="object"&&(E=y,y=void 0),E=E||{};var K,re,de,fe,_e,Me,Se,Ve,rt,ft,ct=u.ajaxSetup({},E),Lt=ct.context||ct,kn=ct.context&&(Lt.nodeType||Lt.jquery)?u(Lt):u.event,Pt=u.Deferred(),Hn=u.Callbacks("once memory"),Yr=ct.statusCode||{},zr={},ca={},Ta="canceled",dr={readyState:0,getResponseHeader:function(vr){var Wn;if(Se){if(!fe)for(fe={};Wn=Xr.exec(de);)fe[Wn[1].toLowerCase()+" "]=(fe[Wn[1].toLowerCase()+" "]||[]).concat(Wn[2]);Wn=fe[vr.toLowerCase()+" "]}return Wn==null?null:Wn.join(", ")},getAllResponseHeaders:function(){return Se?de:null},setRequestHeader:function(vr,Wn){return Se==null&&(vr=ca[vr.toLowerCase()]=ca[vr.toLowerCase()]||vr,zr[vr]=Wn),this},overrideMimeType:function(vr){return Se==null&&(ct.mimeType=vr),this},statusCode:function(vr){var Wn;if(vr)if(Se)dr.always(vr[dr.status]);else for(Wn in vr)Yr[Wn]=[Yr[Wn],vr[Wn]];return this},abort:function(vr){var Wn=vr||Ta;return K&&K.abort(Wn),Ca(0,Wn),this}};if(Pt.promise(dr),ct.url=((y||ct.url||so.href)+"").replace(Zi,so.protocol+"//"),ct.type=E.method||E.type||ct.method||ct.type,ct.dataTypes=(ct.dataType||"*").toLowerCase().match(xe)||[""],ct.crossDomain==null){Me=k.createElement("a");try{Me.href=ct.url,Me.href=Me.href,ct.crossDomain=Hs.protocol+"//"+Hs.host!=Me.protocol+"//"+Me.host}catch(vr){ct.crossDomain=!0}}if(ct.data&&ct.processData&&typeof ct.data!="string"&&(ct.data=u.param(ct.data,ct.traditional)),Eo(Us,ct,E,dr),Se)return dr;for(rt in(Ve=u.event&&ct.global)&&u.active++==0&&u.event.trigger("ajaxStart"),ct.type=ct.type.toUpperCase(),ct.hasContent=!Jr.test(ct.type),re=ct.url.replace(zo,""),ct.hasContent?ct.data&&ct.processData&&(ct.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&(ct.data=ct.data.replace(Ai,"+")):(ft=ct.url.slice(re.length),ct.data&&(ct.processData||typeof ct.data=="string")&&(re+=(Wr.test(re)?"&":"?")+ct.data,delete ct.data),ct.cache===!1&&(re=re.replace(cu,"$1"),ft=(Wr.test(re)?"&":"?")+"_="+zs.guid+++ft),ct.url=re+ft),ct.ifModified&&(u.lastModified[re]&&dr.setRequestHeader("If-Modified-Since",u.lastModified[re]),u.etag[re]&&dr.setRequestHeader("If-None-Match",u.etag[re])),(ct.data&&ct.hasContent&&ct.contentType!==!1||E.contentType)&&dr.setRequestHeader("Content-Type",ct.contentType),dr.setRequestHeader("Accept",ct.dataTypes[0]&&ct.accepts[ct.dataTypes[0]]?ct.accepts[ct.dataTypes[0]]+(ct.dataTypes[0]!=="*"?", "+bs+"; q=0.01":""):ct.accepts["*"]),ct.headers)dr.setRequestHeader(rt,ct.headers[rt]);if(ct.beforeSend&&(ct.beforeSend.call(Lt,dr,ct)===!1||Se))return dr.abort();if(Ta="abort",Hn.add(ct.complete),dr.done(ct.success),dr.fail(ct.error),K=Eo(Gi,ct,E,dr)){if(dr.readyState=1,Ve&&kn.trigger("ajaxSend",[dr,ct]),Se)return dr;ct.async&&ct.timeout>0&&(_e=a.setTimeout(function(){dr.abort("timeout")},ct.timeout));try{Se=!1,K.send(zr,Ca)}catch(vr){if(Se)throw vr;Ca(-1,vr)}}else Ca(-1,"No Transport");function Ca(vr,Wn,lo,Uo){var ua,Ho,Sa,Ki,co,zi=Wn;Se||(Se=!0,_e&&a.clearTimeout(_e),K=void 0,de=Uo||"",dr.readyState=vr>0?4:0,ua=vr>=200&&vr<300||vr===304,lo&&(Ki=function(Zr,Kr,Li){for(var Ha,bi,Jn,li,ri=Zr.contents,Pr=Zr.dataTypes;Pr[0]==="*";)Pr.shift(),Ha===void 0&&(Ha=Zr.mimeType||Kr.getResponseHeader("Content-Type"));if(Ha){for(bi in ri)if(ri[bi]&&ri[bi].test(Ha)){Pr.unshift(bi);break}}if(Pr[0]in Li)Jn=Pr[0];else{for(bi in Li){if(!Pr[0]||Zr.converters[bi+" "+Pr[0]]){Jn=bi;break}li||(li=bi)}Jn=Jn||li}if(Jn)return Jn!==Pr[0]&&Pr.unshift(Jn),Li[Jn]}(ct,dr,lo)),!ua&&u.inArray("script",ct.dataTypes)>-1&&u.inArray("json",ct.dataTypes)<0&&(ct.converters["text script"]=function(){}),Ki=function(Zr,Kr,Li,Ha){var bi,Jn,li,ri,Pr,Da={},_s=Zr.dataTypes.slice();if(_s[1])for(li in Zr.converters)Da[li.toLowerCase()]=Zr.converters[li];for(Jn=_s.shift();Jn;)if(Zr.responseFields[Jn]&&(Li[Zr.responseFields[Jn]]=Kr),!Pr&&Ha&&Zr.dataFilter&&(Kr=Zr.dataFilter(Kr,Zr.dataType)),Pr=Jn,Jn=_s.shift()){if(Jn==="*")Jn=Pr;else if(Pr!=="*"&&Pr!==Jn){if(!(li=Da[Pr+" "+Jn]||Da["* "+Jn])){for(bi in Da)if((ri=bi.split(" "))[1]===Jn&&(li=Da[Pr+" "+ri[0]]||Da["* "+ri[0]])){li===!0?li=Da[bi]:Da[bi]!==!0&&(Jn=ri[0],_s.unshift(ri[1]));break}}if(li!==!0)if(li&&Zr.throws)Kr=li(Kr);else try{Kr=li(Kr)}catch(Cl){return{state:"parsererror",error:li?Cl:"No conversion from "+Pr+" to "+Jn}}}}return{state:"success",data:Kr}}(ct,Ki,dr,ua),ua?(ct.ifModified&&((co=dr.getResponseHeader("Last-Modified"))&&(u.lastModified[re]=co),(co=dr.getResponseHeader("etag"))&&(u.etag[re]=co)),vr===204||ct.type==="HEAD"?zi="nocontent":vr===304?zi="notmodified":(zi=Ki.state,Ho=Ki.data,ua=!(Sa=Ki.error))):(Sa=zi,!vr&&zi||(zi="error",vr<0&&(vr=0))),dr.status=vr,dr.statusText=(Wn||zi)+"",ua?Pt.resolveWith(Lt,[Ho,zi,dr]):Pt.rejectWith(Lt,[dr,zi,Sa]),dr.statusCode(Yr),Yr=void 0,Ve&&kn.trigger(ua?"ajaxSuccess":"ajaxError",[dr,ct,ua?Ho:Sa]),Hn.fireWith(Lt,[dr,zi]),Ve&&(kn.trigger("ajaxComplete",[dr,ct]),--u.active||u.event.trigger("ajaxStop")))}return dr},getJSON:function(y,E,K){return u.get(y,E,K,"json")},getScript:function(y,E){return u.get(y,void 0,E,"script")}}),u.each(["get","post"],function(y,E){u[E]=function(K,re,de,fe){return _(re)&&(fe=fe||de,de=re,re=void 0),u.ajax(u.extend({url:K,type:E,dataType:fe,data:re,success:de},u.isPlainObject(K)&&K))}}),u.ajaxPrefilter(function(y){var E;for(E in y.headers)E.toLowerCase()==="content-type"&&(y.contentType=y.headers[E]||"")}),u._evalUrl=function(y,E,K){return u.ajax({url:y,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(re){u.globalEval(re,E,K)}})},u.fn.extend({wrapAll:function(y){var E;return this[0]&&(_(y)&&(y=y.call(this[0])),E=u(y,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&E.insertBefore(this[0]),E.map(function(){for(var K=this;K.firstElementChild;)K=K.firstElementChild;return K}).append(this)),this},wrapInner:function(y){return _(y)?this.each(function(E){u(this).wrapInner(y.call(this,E))}):this.each(function(){var E=u(this),K=E.contents();K.length?K.wrapAll(y):E.append(y)})},wrap:function(y){var E=_(y);return this.each(function(K){u(this).wrapAll(E?y.call(this,K):y)})},unwrap:function(y){return this.parent(y).not("body").each(function(){u(this).replaceWith(this.childNodes)}),this}}),u.expr.pseudos.hidden=function(y){return!u.expr.pseudos.visible(y)},u.expr.pseudos.visible=function(y){return!!(y.offsetWidth||y.offsetHeight||y.getClientRects().length)},u.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(y){}};var uu={0:200,1223:204},Ms=u.ajaxSettings.xhr();T.cors=!!Ms&&"withCredentials"in Ms,T.ajax=Ms=!!Ms,u.ajaxTransport(function(y){var E,K;if(T.cors||Ms&&!y.crossDomain)return{send:function(re,de){var fe,_e=y.xhr();if(_e.open(y.type,y.url,y.async,y.username,y.password),y.xhrFields)for(fe in y.xhrFields)_e[fe]=y.xhrFields[fe];for(fe in y.mimeType&&_e.overrideMimeType&&_e.overrideMimeType(y.mimeType),y.crossDomain||re["X-Requested-With"]||(re["X-Requested-With"]="XMLHttpRequest"),re)_e.setRequestHeader(fe,re[fe]);E=function(Me){return function(){E&&(E=K=_e.onload=_e.onerror=_e.onabort=_e.ontimeout=_e.onreadystatechange=null,Me==="abort"?_e.abort():Me==="error"?typeof _e.status!="number"?de(0,"error"):de(_e.status,_e.statusText):de(uu[_e.status]||_e.status,_e.statusText,(_e.responseType||"text")!=="text"||typeof _e.responseText!="string"?{binary:_e.response}:{text:_e.responseText},_e.getAllResponseHeaders()))}},_e.onload=E(),K=_e.onerror=_e.ontimeout=E("error"),_e.onabort!==void 0?_e.onabort=K:_e.onreadystatechange=function(){_e.readyState===4&&a.setTimeout(function(){E&&K()})},E=E("abort");try{_e.send(y.hasContent&&y.data||null)}catch(Me){if(E)throw Me}},abort:function(){E&&E()}}}),u.ajaxPrefilter(function(y){y.crossDomain&&(y.contents.script=!1)}),u.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(y){return u.globalEval(y),y}}}),u.ajaxPrefilter("script",function(y){y.cache===void 0&&(y.cache=!1),y.crossDomain&&(y.type="GET")}),u.ajaxTransport("script",function(y){var E,K;if(y.crossDomain||y.scriptAttrs)return{send:function(re,de){E=u("<script>").attr(y.scriptAttrs||{}).prop({charset:y.scriptCharset,src:y.url}).on("load error",K=function(fe){E.remove(),K=null,fe&&de(fe.type==="error"?404:200,fe.type)}),k.head.appendChild(E[0])},abort:function(){K&&K()}}});var Ao,Ws=[],_a=/(=)\?(?=&|$)|\?\?/;u.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var y=Ws.pop()||u.expando+"_"+zs.guid++;return this[y]=!0,y}}),u.ajaxPrefilter("json jsonp",function(y,E,K){var re,de,fe,_e=y.jsonp!==!1&&(_a.test(y.url)?"url":typeof y.data=="string"&&(y.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&_a.test(y.data)&&"data");if(_e||y.dataTypes[0]==="jsonp")return re=y.jsonpCallback=_(y.jsonpCallback)?y.jsonpCallback():y.jsonpCallback,_e?y[_e]=y[_e].replace(_a,"$1"+re):y.jsonp!==!1&&(y.url+=(Wr.test(y.url)?"&":"?")+y.jsonp+"="+re),y.converters["script json"]=function(){return fe||u.error(re+" was not called"),fe[0]},y.dataTypes[0]="json",de=a[re],a[re]=function(){fe=arguments},K.always(function(){de===void 0?u(a).removeProp(re):a[re]=de,y[re]&&(y.jsonpCallback=E.jsonpCallback,Ws.push(re)),fe&&_(de)&&de(fe[0]),fe=de=void 0}),"script"}),T.createHTMLDocument=((Ao=k.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",Ao.childNodes.length===2),u.parseHTML=function(y,E,K){return typeof y!="string"?[]:(typeof E=="boolean"&&(K=E,E=!1),E||(T.createHTMLDocument?((re=(E=k.implementation.createHTMLDocument("")).createElement("base")).href=k.location.href,E.head.appendChild(re)):E=k),fe=!K&&[],(de=ge.exec(y))?[E.createElement(de[1])]:(de=ba([y],E,fe),fe&&fe.length&&u(fe).remove(),u.merge([],de.childNodes)));var re,de,fe},u.fn.load=function(y,E,K){var re,de,fe,_e=this,Me=y.indexOf(" ");return Me>-1&&(re=oo(y.slice(Me)),y=y.slice(0,Me)),_(E)?(K=E,E=void 0):E&&typeof E=="object"&&(de="POST"),_e.length>0&&u.ajax({url:y,type:de||"GET",dataType:"html",data:E}).done(function(Se){fe=arguments,_e.html(re?u("<div>").append(u.parseHTML(Se)).find(re):Se)}).always(K&&function(Se,Ve){_e.each(function(){K.apply(this,fe||[Se.responseText,Ve,Se])})}),this},u.expr.pseudos.animated=function(y){return u.grep(u.timers,function(E){return y===E.elem}).length},u.offset={setOffset:function(y,E,K){var re,de,fe,_e,Me,Se,Ve=u.css(y,"position"),rt=u(y),ft={};Ve==="static"&&(y.style.position="relative"),Me=rt.offset(),fe=u.css(y,"top"),Se=u.css(y,"left"),(Ve==="absolute"||Ve==="fixed")&&(fe+Se).indexOf("auto")>-1?(_e=(re=rt.position()).top,de=re.left):(_e=parseFloat(fe)||0,de=parseFloat(Se)||0),_(E)&&(E=E.call(y,K,u.extend({},Me))),E.top!=null&&(ft.top=E.top-Me.top+_e),E.left!=null&&(ft.left=E.left-Me.left+de),"using"in E?E.using.call(y,ft):rt.css(ft)}},u.fn.extend({offset:function(y){if(arguments.length)return y===void 0?this:this.each(function(de){u.offset.setOffset(this,y,de)});var E,K,re=this[0];return re?re.getClientRects().length?(E=re.getBoundingClientRect(),K=re.ownerDocument.defaultView,{top:E.top+K.pageYOffset,left:E.left+K.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var y,E,K,re=this[0],de={top:0,left:0};if(u.css(re,"position")==="fixed")E=re.getBoundingClientRect();else{for(E=this.offset(),K=re.ownerDocument,y=re.offsetParent||K.documentElement;y&&(y===K.body||y===K.documentElement)&&u.css(y,"position")==="static";)y=y.parentNode;y&&y!==re&&y.nodeType===1&&((de=u(y).offset()).top+=u.css(y,"borderTopWidth",!0),de.left+=u.css(y,"borderLeftWidth",!0))}return{top:E.top-de.top-u.css(re,"marginTop",!0),left:E.left-de.left-u.css(re,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var y=this.offsetParent;y&&u.css(y,"position")==="static";)y=y.offsetParent;return y||$t})}}),u.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(y,E){var K=E==="pageYOffset";u.fn[y]=function(re){return He(this,function(de,fe,_e){var Me;if(Y(de)?Me=de:de.nodeType===9&&(Me=de.defaultView),_e===void 0)return Me?Me[E]:de[fe];Me?Me.scrollTo(K?Me.pageXOffset:_e,K?_e:Me.pageYOffset):de[fe]=_e},y,re,arguments.length)}}),u.each(["top","left"],function(y,E){u.cssHooks[E]=ys(T.pixelPosition,function(K,re){if(re)return re=ro(K,E),la.test(re)?u(K).position()[E]+"px":re})}),u.each({Height:"height",Width:"width"},function(y,E){u.each({padding:"inner"+y,content:E,"":"outer"+y},function(K,re){u.fn[re]=function(de,fe){var _e=arguments.length&&(K||typeof de!="boolean"),Me=K||(de===!0||fe===!0?"margin":"border");return He(this,function(Se,Ve,rt){var ft;return Y(Se)?re.indexOf("outer")===0?Se["inner"+y]:Se.document.documentElement["client"+y]:Se.nodeType===9?(ft=Se.documentElement,Math.max(Se.body["scroll"+y],ft["scroll"+y],Se.body["offset"+y],ft["offset"+y],ft["client"+y])):rt===void 0?u.css(Se,Ve,Me):u.style(Se,Ve,rt,Me)},E,_e?de:void 0,_e)}})}),u.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(y,E){u.fn[E]=function(K){return this.on(E,K)}}),u.fn.extend({bind:function(y,E,K){return this.on(y,null,E,K)},unbind:function(y,E){return this.off(y,null,E)},delegate:function(y,E,K,re){return this.on(E,y,K,re)},undelegate:function(y,E,K){return arguments.length===1?this.off(y,"**"):this.off(E,y||"**",K)},hover:function(y,E){return this.mouseenter(y).mouseleave(E||y)}}),u.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(y,E){u.fn[E]=function(K,re){return arguments.length>0?this.on(E,null,K,re):this.trigger(E)}});var fr=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;u.proxy=function(y,E){var K,re,de;if(typeof E=="string"&&(K=y[E],E=y,y=K),_(y))return re=D.call(arguments,2),(de=function(){return y.apply(E||this,re.concat(D.call(arguments)))}).guid=y.guid=y.guid||u.guid++,de},u.holdReady=function(y){y?u.readyWait++:u.ready(!0)},u.isArray=Array.isArray,u.parseJSON=JSON.parse,u.nodeName=f,u.isFunction=_,u.isWindow=Y,u.camelCase=nn,u.type=C,u.now=Date.now,u.isNumeric=function(y){var E=u.type(y);return(E==="number"||E==="string")&&!isNaN(y-parseFloat(y))},u.trim=function(y){return y==null?"":(y+"").replace(fr,"$1")};var Tl=a.jQuery,oc=a.$;return u.noConflict=function(y){return a.$===u&&(a.$=oc),y&&a.jQuery===u&&(a.jQuery=Tl),u},v===void 0&&(a.jQuery=a.$=u),u},w.exports=r.document?o(r,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return o(a)}}),jquery$1=Object.freeze({__proto__:null,default:jquery,__moduleExports:jquery});function mxcadassemblyinit(){var w,r=(w=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0,typeof __filename!="undefined"&&(w=w||__filename),function(o){var a,v,h;o=o||{},a||(a=o!==void 0?o:{}),a.ready=new Promise(function(Ie,Mt){v=Ie,h=Mt});var b,D,U,V,I,g,A=Object.assign({},a),M=typeof window=="object",N=typeof importScripts=="function",F=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",T="";F?(T=N?xxxxx("path").dirname(T)+"/":__dirname+"/",g=()=>{I||(V=xxxxx("fs"),I=xxxxx("path"))},b=function(Ie,Mt){var rn=ze(Ie);return rn?Mt?rn:rn.toString():(g(),Ie=I.normalize(Ie),V.readFileSync(Ie,Mt?void 0:"utf8"))},U=Ie=>((Ie=b(Ie,!0)).buffer||(Ie=new Uint8Array(Ie)),Ie),D=(Ie,Mt,rn)=>{var tn=ze(Ie);tn&&Mt(tn),g(),Ie=I.normalize(Ie),V.readFile(Ie,function(En,br){En?rn(En):Mt(br.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(Ie){throw Ie}),process.on("unhandledRejection",function(Ie){throw Ie}),a.inspect=function(){return"[Emscripten Module object]"}):(M||N)&&(N?T=self.location.href:typeof document!="undefined"&&document.currentScript&&(T=document.currentScript.src),w&&(T=w),T=T.indexOf("blob:")!==0?T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1):"",b=Ie=>{try{var Mt=new XMLHttpRequest;return Mt.open("GET",Ie,!1),Mt.send(null),Mt.responseText}catch(En){if(Ie=ze(Ie)){Mt=[];for(var rn=0;rn<Ie.length;rn++){var tn=Ie[rn];255<tn&&(tn&=255),Mt.push(String.fromCharCode(tn))}return Mt.join("")}throw En}},N&&(U=Ie=>{try{var Mt=new XMLHttpRequest;return Mt.open("GET",Ie,!1),Mt.responseType="arraybuffer",Mt.send(null),new Uint8Array(Mt.response)}catch(rn){if(Ie=ze(Ie))return Ie;throw rn}}),D=(Ie,Mt,rn)=>{var tn=new XMLHttpRequest;tn.open("GET",Ie,!0),tn.responseType="arraybuffer",tn.onload=()=>{if(tn.status==200||tn.status==0&&tn.response)Mt(tn.response);else{var En=ze(Ie);En?Mt(En.buffer):rn()}},tn.onerror=rn,tn.send(null)}),a.print||console.log.bind(console);var _,Y=a.printErr||console.warn.bind(console);Object.assign(a,A),A=null,a.wasmBinary&&(_=a.wasmBinary),a.noExitRuntime;var k=Error,S={};_=[],typeof S!="object"&&je("no native wasm support detected");var G,C,B,R,u,c=!1,f=a.INITIAL_MEMORY||16777216;(G=a.wasmMemory?a.wasmMemory:new function(){this.buffer=new ArrayBuffer(f/65536*65536)})&&(C=G.buffer),f=C.byteLength;var O=C;C=O,a.HEAP8=B=new Int8Array(O),a.HEAP16=new Int16Array(O),a.HEAP32=u=new Int32Array(O),a.HEAPU8=R=new Uint8Array(O),a.HEAPU16=new Uint16Array(O),a.HEAPU32=new Uint32Array(O),a.HEAPF32=new Float32Array(O),a.HEAPF64=new Float64Array(O);var W,X=[],J=[],te=[];function ne(){var Ie=a.preRun.shift();X.unshift(Ie)}var ue=0,be=null;function je(Ie){throw a.onAbort&&a.onAbort(Ie),Y(Ie="Aborted("+Ie+")"),c=!0,Ie=new k(Ie+". Build with -s ASSERTIONS=1 for more info."),h(Ie),Ie}a.preloadedImages={},a.preloadedAudios={};var ve,Be="data:application/octet-stream;base64,";if(!(ve="mxcadassembly_min.wasm").startsWith(Be)){var q=ve;ve=a.locateFile?a.locateFile(q,T):T+q}function ge(){var Ie=ve;try{if(Ie==ve&&_)return new Uint8Array(_);var Mt=ze(Ie);if(Mt)return Mt;if(U)return U(Ie);throw"both async and sync fetching of the wasm failed"}catch(rn){je(rn)}}function oe(Ie){for(;0<Ie.length;){var Mt=Ie.shift();if(typeof Mt=="function")Mt(a);else{var rn=Mt.U;typeof rn=="number"?Mt.G===void 0?Pe(rn)():Pe(rn)(Mt.G):rn(Mt.G===void 0?null:Mt.G)}}}var le=[];function Pe(Ie){var Mt=le[Ie];return Mt||(Ie>=le.length&&(le.length=Ie+1),le[Ie]=Mt=W.get(Ie)),Mt}var Ye=typeof atob=="function"?atob:function(Ie){var Mt="",rn=0;Ie=Ie.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Ie.charAt(rn++)),En="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Ie.charAt(rn++)),br="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Ie.charAt(rn++)),Mr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Ie.charAt(rn++));tn=tn<<2|En>>4,En=(15&En)<<4|br>>2;var Tr=(3&br)<<6|Mr;Mt+=String.fromCharCode(tn),br!==64&&(Mt+=String.fromCharCode(En)),Mr!==64&&(Mt+=String.fromCharCode(Tr))}while(rn<Ie.length);return Mt};function ze(Ie){if(Ie.startsWith(Be)){if(Ie=Ie.slice(Be.length),typeof F=="boolean"&&F){var Mt=Buffer.from(Ie,"base64");Mt=new Uint8Array(Mt.buffer,Mt.byteOffset,Mt.byteLength)}else try{var rn=Ye(Ie),tn=new Uint8Array(rn.length);for(Ie=0;Ie<rn.length;++Ie)tn[Ie]=rn.charCodeAt(Ie);Mt=tn}catch(En){throw Error("Converting base64 string to bytes failed.")}return Mt}}var se={f:function(Ie){return Xt(Ie+16)+16},e:function(Ie,Mt,rn){throw new function(tn){this.C=tn-16,this.P=function(En){u[this.C+4>>2]=En},this.M=function(En){u[this.C+8>>2]=En},this.N=function(){u[this.C>>2]=0},this.L=function(){B[this.C+12>>0]=0},this.O=function(){B[this.C+13>>0]=0},this.K=function(En,br){this.P(En),this.M(br),this.N(),this.L(),this.O()}}(Ie).K(Mt,rn),Ie},c:function(){je("")},d:function(Ie,Mt,rn){R.copyWithin(Ie,Mt,Mt+rn)},b:function(){je("OOM")},a:G};(function(){function Ie(En){a.asm=En.exports,W=a.asm.A,J.unshift(a.asm.g),ue--,a.monitorRunDependencies&&a.monitorRunDependencies(ue),ue==0&&be&&(En=be,be=null,En())}function Mt(En){Ie(En.instance)}function rn(En){return function(){if(!_&&(M||N)){if(typeof fetch=="function"&&!ve.startsWith("file://"))return fetch(ve,{credentials:"same-origin"}).then(function(br){if(!br.ok)throw"failed to load wasm binary file at '"+ve+"'";return br.arrayBuffer()}).catch(function(){return ge()});if(D)return new Promise(function(br,Mr){D(ve,function(Tr){br(new Uint8Array(Tr))},Mr)})}return Promise.resolve().then(function(){return ge()})}().then(function(){return{then:function(br){br({instance:new function(){this.exports=function(Mr){for(var Tr,ti=new Uint8Array(123),Gr=25;Gr>=0;--Gr)ti[48+Gr]=52+Gr,ti[65+Gr]=Gr,ti[97+Gr]=26+Gr;function ba(Di,wi,or){for(var ni,H,Nr=0,Ri=wi,Zn=or.length,Xi=wi+(3*Zn>>2)-(or[Zn-2]=="=")-(or[Zn-1]=="=");Nr<Zn;Nr+=4)ni=ti[or.charCodeAt(Nr+1)],H=ti[or.charCodeAt(Nr+2)],Di[Ri++]=ti[or.charCodeAt(Nr)]<<2|ni>>4,Ri<Xi&&(Di[Ri++]=ni<<4|H>>2),Ri<Xi&&(Di[Ri++]=H<<6|ti[or.charCodeAt(Nr+3)])}return ti[43]=62,ti[47]=63,function(Di){var wi=Di.a.buffer,or=new Int8Array(wi),ni=new Int16Array(wi),H=new Int32Array(wi),Nr=new Uint8Array(wi),Ri=new Uint32Array(wi),Zn=new Float64Array(wi),Xi=Math.imul,xo=Di.abort,Bs=Di.b,ts=Di.c,ms=Di.d,no=Di.e,ns=Di.f,la=5245008;function Fo(Q){var Ce,ce=0,Te=0,Ke=0,vt=0,Ft=0,Jt=0,In=0,Gn=0,sr=0,hi=0;la=Ce=la-16|0;e:{t:{n:{a:{i:{l:{r:{c:{u:{s:{o:{if((Q|=0)>>>0<=244){if(3&(ce=(vt=H[404])>>>(Te=(Jt=Q>>>0<11?16:Q+11&-8)>>>3|0)|0)){Q=(Ft=H[1664+(ce=(Ke=Te+(1&(-1^ce))|0)<<3)>>2])+8|0,(0|(Te=H[Ft+8>>2]))!=(0|(ce=ce+1656|0))?(H[Te+12>>2]=ce,H[ce+8>>2]=Te):H[404]=Dr(Ke)&vt,ce=Ke<<3,H[Ft+4>>2]=3|ce,H[4+(ce=ce+Ft|0)>>2]=1|H[ce+4>>2];break e}if((hi=H[406])>>>0>=Jt>>>0)break o;if(ce){Te=Q=(ce=(0-(Q=(0-(Q=2<<Te)|Q)&ce<<Te)&Q)-1|0)>>>12&16,Te|=Q=(ce=ce>>>Q|0)>>>5&8,Te|=Q=(ce=ce>>>Q|0)>>>2&4,sr=H[1664+(Q=(Te=((Te|=Q=(ce=ce>>>Q|0)>>>1&2)|(Q=(ce=ce>>>Q|0)>>>1&1))+(ce>>>Q|0)|0)<<3)>>2],(0|(ce=H[sr+8>>2]))!=(0|(Q=Q+1656|0))?(H[ce+12>>2]=Q,H[Q+8>>2]=ce):(vt=Dr(Te)&vt,H[404]=vt),Q=sr+8|0,H[sr+4>>2]=3|Jt,Ft=(ce=Te<<3)-Jt|0,H[4+(Ke=Jt+sr|0)>>2]=1|Ft,H[ce+sr>>2]=Ft,hi&&(Te=1656+((ce=hi>>>3|0)<<3)|0,sr=H[409],(ce=1<<ce)&vt?ce=H[Te+8>>2]:(H[404]=ce|vt,ce=Te),H[Te+8>>2]=sr,H[ce+12>>2]=sr,H[sr+12>>2]=Te,H[sr+8>>2]=ce),H[409]=Ke,H[406]=Ft;break e}if(!(In=H[405]))break o;for(Te=Q=(ce=(0-In&In)-1|0)>>>12&16,Te|=Q=(ce=ce>>>Q|0)>>>5&8,Te|=Q=(ce=ce>>>Q|0)>>>2&4,ce=H[1920+(((Te|=Q=(ce=ce>>>Q|0)>>>1&2)|(Q=(ce=ce>>>Q|0)>>>1&1))+(ce>>>Q|0)<<2)>>2],Ke=(-8&H[ce+4>>2])-Jt|0,Te=ce;(Q=H[Te+16>>2])||(Q=H[Te+20>>2]);)Ke=(Ft=(Te=(-8&H[Q+4>>2])-Jt|0)>>>0<Ke>>>0)?Te:Ke,ce=Ft?Q:ce,Te=Q;if(Gn=H[ce+24>>2],(0|(Ft=H[ce+12>>2]))!=(0|ce)){Q=H[ce+8>>2],H[Q+12>>2]=Ft,H[Ft+8>>2]=Q;break t}if(!(Q=H[(Te=ce+20|0)>>2])){if(!(Q=H[ce+16>>2]))break s;Te=ce+16|0}for(;sr=Te,Ft=Q,(Q=H[(Te=Q+20|0)>>2])||(Te=Ft+16|0,Q=H[Ft+16>>2]););H[sr>>2]=0;break t}if(Jt=-1,!(Q>>>0>4294967231)&&(Jt=-8&(Q=Q+11|0),Gn=H[405])){Ke=0-Jt|0,vt=0,Jt>>>0<256||(vt=31,Jt>>>0>16777215||(Q=Q>>>8|0,Q<<=sr=Q+1048320>>>16&8,vt=28+((Q=((Q<<=Te=Q+520192>>>16&4)<<(ce=Q+245760>>>16&2)>>>15|0)-(ce|Te|sr)|0)<<1|Jt>>>Q+21&1)|0));h:{d:{if(Te=H[1920+(vt<<2)>>2])for(Q=0,ce=Jt<<((0|vt)==31?0:25-(vt>>>1|0)|0);;){if(!((sr=(In=-8&H[Te+4>>2])-Jt|0)>>>0>=Ke>>>0)&&(Ke=sr,Ft=Te,(0|Jt)==(0|In))){Ke=0,Q=Te;break d}if(sr=H[Te+20>>2],Te=H[16+((ce>>>29&4)+Te|0)>>2],Q=sr?(0|sr)==(0|Te)?Q:sr:Q,ce<<=1,!Te)break}else Q=0;if(!(Q|Ft)){if(Ft=0,!(Q=(0-(Q=2<<vt)|Q)&Gn))break o;Te=Q=(ce=(Q&0-Q)-1|0)>>>12&16,Te|=Q=(ce=ce>>>Q|0)>>>5&8,Te|=Q=(ce=ce>>>Q|0)>>>2&4,Q=H[1920+(((Te|=Q=(ce=ce>>>Q|0)>>>1&2)|(Q=(ce=ce>>>Q|0)>>>1&1))+(ce>>>Q|0)<<2)>>2]}if(!Q)break h}for(;Ke=(Te=(ce=(-8&H[Q+4>>2])-Jt|0)>>>0<Ke>>>0)?ce:Ke,Ft=Te?Q:Ft,Q=(ce=H[Q+16>>2])||H[Q+20>>2];);}if(!(!Ft|H[406]-Jt>>>0<=Ke>>>0)){if(vt=H[Ft+24>>2],(0|Ft)!=(0|(ce=H[Ft+12>>2]))){Q=H[Ft+8>>2],H[Q+12>>2]=ce,H[ce+8>>2]=Q;break n}if(!(Q=H[(Te=Ft+20|0)>>2])){if(!(Q=H[Ft+16>>2]))break u;Te=Ft+16|0}for(;sr=Te,ce=Q,(Q=H[(Te=Q+20|0)>>2])||(Te=ce+16|0,Q=H[ce+16>>2]););H[sr>>2]=0;break n}}}if((Te=H[406])>>>0>=Jt>>>0){Ke=H[409],(ce=Te-Jt|0)>>>0>=16?(H[406]=ce,Q=Ke+Jt|0,H[409]=Q,H[Q+4>>2]=1|ce,H[Te+Ke>>2]=ce,H[Ke+4>>2]=3|Jt):(H[409]=0,H[406]=0,H[Ke+4>>2]=3|Te,H[4+(Q=Te+Ke|0)>>2]=1|H[Q+4>>2]),Q=Ke+8|0;break e}if((Gn=H[407])>>>0>Jt>>>0){ce=Gn-Jt|0,H[407]=ce,Q=(Te=H[410])+Jt|0,H[410]=Q,H[Q+4>>2]=1|ce,H[Te+4>>2]=3|Jt,Q=Te+8|0;break e}if(Q=0,In=Jt+47|0,H[522]?Te=H[524]:(H[525]=-1,H[526]=-1,H[523]=4096,H[524]=4096,H[522]=Ce+12&-16^1431655768,H[527]=0,H[515]=0,Te=4096),(Te=(sr=In+Te|0)&(Ft=0-Te|0))>>>0<=Jt>>>0||(Ke=H[514])&&(vt=(ce=H[512])+Te|0)>>>0>Ke>>>0|ce>>>0>=vt>>>0)break e;if(4&Nr[2060])break l;o:{h:{if(Ke=H[410])for(Q=2064;;){if((ce=H[Q>>2])>>>0<=Ke>>>0&Ke>>>0<ce+H[Q+4>>2]>>>0)break h;if(!(Q=H[Q+8>>2]))break}if((0|(ce=io(0)))==-1||(vt=Te,(Q=(Ke=H[523])-1|0)&ce&&(vt=(Te-ce|0)+(Q+ce&0-Ke)|0),vt>>>0<=Jt>>>0|vt>>>0>2147483646)||(Ke=H[514])&&Ke>>>0<(Ft=(Q=H[512])+vt|0)>>>0|Q>>>0>=Ft>>>0)break r;if((0|ce)!=(0|(Q=io(vt))))break o;break i}if((vt=Ft&sr-Gn)>>>0>2147483646)break r;if((0|(ce=io(vt)))==(H[Q>>2]+H[Q+4>>2]|0))break c;Q=ce}if(!((0|Q)==-1|Jt+48>>>0<=vt>>>0)){if((ce=(ce=H[524])+(In-vt|0)&0-ce)>>>0>2147483646){ce=Q;break i}if((0|io(ce))!=-1){vt=ce+vt|0,ce=Q;break i}io(0-vt|0);break r}if(ce=Q,(0|Q)!=-1)break i;break r}Ft=0;break t}ce=0;break n}if((0|ce)!=-1)break i}H[515]=4|H[515]}if(Te>>>0>2147483646||(0|(ce=io(Te)))==-1|(0|(Q=io(0)))==-1|Q>>>0<=ce>>>0||(vt=Q-ce|0)>>>0<=Jt+40>>>0)break a}Q=H[512]+vt|0,H[512]=Q,Q>>>0>Ri[513]&&(H[513]=Q);i:{l:{r:{if(In=H[410]){for(Q=2064;;){if(((Ke=H[Q>>2])+(Te=H[Q+4>>2])|0)==(0|ce))break r;if(!(Q=H[Q+8>>2]))break}break l}for((Q=H[408])>>>0<=ce>>>0&&Q||(H[408]=ce),Q=0,H[517]=vt,H[516]=ce,H[412]=-1,H[413]=H[522],H[519]=0;Te=1656+(Ke=Q<<3)|0,H[Ke+1664>>2]=Te,H[Ke+1668>>2]=Te,(0|(Q=Q+1|0))!=32;);Te=(Ke=vt-40|0)-(Q=ce+8&7?-8-ce&7:0)|0,H[407]=Te,Q=Q+ce|0,H[410]=Q,H[Q+4>>2]=1|Te,H[4+(ce+Ke|0)>>2]=40,H[411]=H[526];break i}if(!(8&Nr[Q+12|0]|Ke>>>0>In>>>0|ce>>>0<=In>>>0)){H[Q+4>>2]=Te+vt,Te=(Q=In+8&7?-8-In&7:0)+In|0,H[410]=Te,Q=(ce=H[407]+vt|0)-Q|0,H[407]=Q,H[Te+4>>2]=1|Q,H[4+(ce+In|0)>>2]=40,H[411]=H[526];break i}}Ri[408]>ce>>>0&&(H[408]=ce),Te=ce+vt|0,Q=2064;l:{r:{c:{u:{s:{o:{for(;;){if((0|Te)!=H[Q>>2]){if(Q=H[Q+8>>2])continue;break o}break}if(!(8&Nr[Q+12|0]))break s}for(Q=2064;;){if((Te=H[Q>>2])>>>0<=In>>>0&&(Ft=Te+H[Q+4>>2]|0)>>>0>In>>>0)break u;Q=H[Q+8>>2]}}if(H[Q>>2]=ce,H[Q+4>>2]=H[Q+4>>2]+vt,H[4+(sr=(ce+8&7?-8-ce&7:0)+ce|0)>>2]=3|Jt,Jt=(vt=Te+(Te+8&7?-8-Te&7:0)|0)-(Gn=Jt+sr|0)|0,(0|vt)==(0|In)){H[410]=Gn,Q=H[407]+Jt|0,H[407]=Q,H[Gn+4>>2]=1|Q;break r}if(H[409]==(0|vt)){H[409]=Gn,Q=H[406]+Jt|0,H[406]=Q,H[Gn+4>>2]=1|Q,H[Q+Gn>>2]=Q;break r}if((3&(Q=H[vt+4>>2]))==1){Ft=-8&Q;s:if(Q>>>0<=255){if(Te=H[vt+8>>2],Q=Q>>>3|0,(0|(ce=H[vt+12>>2]))==(0|Te)){H[404]=H[404]&Dr(Q);break s}H[Te+12>>2]=ce,H[ce+8>>2]=Te}else{if(In=H[vt+24>>2],(0|vt)==(0|(ce=H[vt+12>>2])))if((Ke=H[(Q=vt+20|0)>>2])||(Ke=H[(Q=vt+16|0)>>2])){for(;Te=Q,(Ke=H[(Q=(ce=Ke)+20|0)>>2])||(Q=ce+16|0,Ke=H[ce+16>>2]););H[Te>>2]=0}else ce=0;else Q=H[vt+8>>2],H[Q+12>>2]=ce,H[ce+8>>2]=Q;if(In){Te=H[vt+28>>2];o:{if(H[(Q=1920+(Te<<2)|0)>>2]==(0|vt)){if(H[Q>>2]=ce,ce)break o;H[405]=H[405]&Dr(Te);break s}if(H[In+(H[In+16>>2]==(0|vt)?16:20)>>2]=ce,!ce)break s}H[ce+24>>2]=In,(Q=H[vt+16>>2])&&(H[ce+16>>2]=Q,H[Q+24>>2]=ce),(Q=H[vt+20>>2])&&(H[ce+20>>2]=Q,H[Q+24>>2]=ce)}}Jt=Ft+Jt|0,vt=vt+Ft|0}if(H[vt+4>>2]=-2&H[vt+4>>2],H[Gn+4>>2]=1|Jt,H[Jt+Gn>>2]=Jt,Jt>>>0<=255){ce=1656+((Q=Jt>>>3|0)<<3)|0,(Te=H[404])&(Q=1<<Q)?Q=H[ce+8>>2]:(H[404]=Q|Te,Q=ce),H[ce+8>>2]=Gn,H[Q+12>>2]=Gn,H[Gn+12>>2]=ce,H[Gn+8>>2]=Q;break r}if(Q=31,Jt>>>0<=16777215&&(Q=Jt>>>8|0,Q<<=Ke=Q+1048320>>>16&8,Q=28+((Q=((Q<<=Te=Q+520192>>>16&4)<<(ce=Q+245760>>>16&2)>>>15|0)-(ce|Te|Ke)|0)<<1|Jt>>>Q+21&1)|0),H[Gn+28>>2]=Q,H[Gn+16>>2]=0,H[Gn+20>>2]=0,Ke=1920+(Q<<2)|0,(Te=H[405])&(ce=1<<Q)){for(Q=Jt<<((0|Q)==31?0:25-(Q>>>1|0)|0),ce=H[Ke>>2];;){if(Te=ce,(-8&H[ce+4>>2])==(0|Jt))break c;if(ce=Q>>>29|0,Q<<=1,!(ce=H[16+(Ke=Te+(4&ce)|0)>>2]))break}H[Ke+16>>2]=Gn,H[Gn+24>>2]=Te}else H[405]=ce|Te,H[Ke>>2]=Gn,H[Gn+24>>2]=Ke;H[Gn+12>>2]=Gn,H[Gn+8>>2]=Gn;break r}for(Te=(Ke=vt-40|0)-(Q=ce+8&7?-8-ce&7:0)|0,H[407]=Te,Q=Q+ce|0,H[410]=Q,H[Q+4>>2]=1|Te,H[4+(ce+Ke|0)>>2]=40,H[411]=H[526],H[(Te=(Q=(Ft+(Ft-39&7?39-Ft&7:0)|0)-47|0)>>>0<In+16>>>0?In:Q)+4>>2]=27,Q=H[519],H[Te+16>>2]=H[518],H[Te+20>>2]=Q,Q=H[517],H[Te+8>>2]=H[516],H[Te+12>>2]=Q,H[518]=Te+8,H[517]=vt,H[516]=ce,H[519]=0,Q=Te+24|0;H[Q+4>>2]=7,ce=Q+8|0,Q=Q+4|0,ce>>>0<Ft>>>0;);if((0|Te)==(0|In))break i;if(H[Te+4>>2]=-2&H[Te+4>>2],Ft=Te-In|0,H[In+4>>2]=1|Ft,H[Te>>2]=Ft,Ft>>>0<=255){ce=1656+((Q=Ft>>>3|0)<<3)|0,(Te=H[404])&(Q=1<<Q)?Q=H[ce+8>>2]:(H[404]=Q|Te,Q=ce),H[ce+8>>2]=In,H[Q+12>>2]=In,H[In+12>>2]=ce,H[In+8>>2]=Q;break i}if(Q=31,H[In+16>>2]=0,H[In+20>>2]=0,Ft>>>0<=16777215&&(Q=Ft>>>8|0,Q<<=Ke=Q+1048320>>>16&8,Q=28+((Q=((Q<<=Te=Q+520192>>>16&4)<<(ce=Q+245760>>>16&2)>>>15|0)-(ce|Te|Ke)|0)<<1|Ft>>>Q+21&1)|0),H[In+28>>2]=Q,Ke=1920+(Q<<2)|0,(Te=H[405])&(ce=1<<Q)){for(Q=Ft<<((0|Q)==31?0:25-(Q>>>1|0)|0),ce=H[Ke>>2];;){if(Te=ce,(0|Ft)==(-8&H[ce+4>>2]))break l;if(ce=Q>>>29|0,Q<<=1,!(ce=H[16+(Ke=Te+(4&ce)|0)>>2]))break}H[Ke+16>>2]=In,H[In+24>>2]=Te}else H[405]=ce|Te,H[Ke>>2]=In,H[In+24>>2]=Ke;H[In+12>>2]=In,H[In+8>>2]=In;break i}Q=H[Te+8>>2],H[Q+12>>2]=Gn,H[Te+8>>2]=Gn,H[Gn+24>>2]=0,H[Gn+12>>2]=Te,H[Gn+8>>2]=Q}Q=sr+8|0;break e}Q=H[Te+8>>2],H[Q+12>>2]=In,H[Te+8>>2]=In,H[In+24>>2]=0,H[In+12>>2]=Te,H[In+8>>2]=Q}if(!((Q=H[407])>>>0<=Jt>>>0)){ce=Q-Jt|0,H[407]=ce,Q=(Te=H[410])+Jt|0,H[410]=Q,H[Q+4>>2]=1|ce,H[Te+4>>2]=3|Jt,Q=Te+8|0;break e}}H[403]=48,Q=0;break e}n:if(vt){Te=H[Ft+28>>2];a:{if(H[(Q=1920+(Te<<2)|0)>>2]==(0|Ft)){if(H[Q>>2]=ce,ce)break a;Gn=Dr(Te)&Gn,H[405]=Gn;break n}if(H[vt+(H[vt+16>>2]==(0|Ft)?16:20)>>2]=ce,!ce)break n}H[ce+24>>2]=vt,(Q=H[Ft+16>>2])&&(H[ce+16>>2]=Q,H[Q+24>>2]=ce),(Q=H[Ft+20>>2])&&(H[ce+20>>2]=Q,H[Q+24>>2]=ce)}n:if(Ke>>>0<=15)Q=Ke+Jt|0,H[Ft+4>>2]=3|Q,H[4+(Q=Q+Ft|0)>>2]=1|H[Q+4>>2];else if(H[Ft+4>>2]=3|Jt,H[4+(vt=Ft+Jt|0)>>2]=1|Ke,H[vt+Ke>>2]=Ke,Ke>>>0<=255)ce=1656+((Q=Ke>>>3|0)<<3)|0,(Te=H[404])&(Q=1<<Q)?Q=H[ce+8>>2]:(H[404]=Q|Te,Q=ce),H[ce+8>>2]=vt,H[Q+12>>2]=vt,H[vt+12>>2]=ce,H[vt+8>>2]=Q;else{Q=31,Ke>>>0<=16777215&&(Q=Ke>>>8|0,Q<<=sr=Q+1048320>>>16&8,Q=28+((Q=((Q<<=Te=Q+520192>>>16&4)<<(ce=Q+245760>>>16&2)>>>15|0)-(ce|Te|sr)|0)<<1|Ke>>>Q+21&1)|0),H[vt+28>>2]=Q,H[vt+16>>2]=0,H[vt+20>>2]=0,ce=1920+(Q<<2)|0;a:{if((Te=1<<Q)&Gn){for(Q=Ke<<((0|Q)==31?0:25-(Q>>>1|0)|0),Te=H[ce>>2];;){if((-8&H[(ce=Te)+4>>2])==(0|Ke))break a;if(Te=Q>>>29|0,Q<<=1,!(Te=H[16+(sr=(4&Te)+ce|0)>>2]))break}H[sr+16>>2]=vt}else H[405]=Te|Gn,H[ce>>2]=vt;H[vt+24>>2]=ce,H[vt+12>>2]=vt,H[vt+8>>2]=vt;break n}Q=H[ce+8>>2],H[Q+12>>2]=vt,H[ce+8>>2]=vt,H[vt+24>>2]=0,H[vt+12>>2]=ce,H[vt+8>>2]=Q}Q=Ft+8|0;break e}t:if(Gn){Te=H[ce+28>>2];n:{if(H[(Q=1920+(Te<<2)|0)>>2]==(0|ce)){if(H[Q>>2]=Ft,Ft)break n;H[405]=Dr(Te)&In;break t}if(H[Gn+(H[Gn+16>>2]==(0|ce)?16:20)>>2]=Ft,!Ft)break t}H[Ft+24>>2]=Gn,(Q=H[ce+16>>2])&&(H[Ft+16>>2]=Q,H[Q+24>>2]=Ft),(Q=H[ce+20>>2])&&(H[Ft+20>>2]=Q,H[Q+24>>2]=Ft)}Ke>>>0<=15?(Q=Ke+Jt|0,H[ce+4>>2]=3|Q,H[4+(Q=Q+ce|0)>>2]=1|H[Q+4>>2]):(H[ce+4>>2]=3|Jt,H[4+(Ft=ce+Jt|0)>>2]=1|Ke,H[Ke+Ft>>2]=Ke,hi&&(Te=1656+((Q=hi>>>3|0)<<3)|0,sr=H[409],(Q=1<<Q)&vt?Q=H[Te+8>>2]:(H[404]=Q|vt,Q=Te),H[Te+8>>2]=sr,H[Q+12>>2]=sr,H[sr+12>>2]=Te,H[sr+8>>2]=Q),H[409]=Ft,H[406]=Ke),Q=ce+8|0}return la=Ce+16|0,0|Q}function Aa(Q){var Ce=0,ce=0,Te=0,Ke=0,vt=0,Ft=0,Jt=0;e:if(Q){vt=(Te=Q-8|0)+(Q=-8&(Ce=H[Q-4>>2]))|0;t:if(!(1&Ce)){if(!(3&Ce)||(Te=Te-(Ce=H[Te>>2])|0)>>>0<Ri[408])break e;if(Q=Q+Ce|0,H[409]==(0|Te)){if((3&(Ce=H[vt+4>>2]))==3)return H[406]=Q,H[vt+4>>2]=-2&Ce,H[Te+4>>2]=1|Q,void(H[Q+Te>>2]=Q)}else{if(Ce>>>0<=255){if(Ke=H[Te+8>>2],Ce=Ce>>>3|0,(0|(ce=H[Te+12>>2]))==(0|Ke)){H[404]=H[404]&Dr(Ce);break t}H[Ke+12>>2]=ce,H[ce+8>>2]=Ke;break t}if(Jt=H[Te+24>>2],(0|Te)==(0|(Ce=H[Te+12>>2])))if((ce=H[(Ke=Te+20|0)>>2])||(ce=H[(Ke=Te+16|0)>>2])){for(;Ft=Ke,(ce=H[(Ke=(Ce=ce)+20|0)>>2])||(Ke=Ce+16|0,ce=H[Ce+16>>2]););H[Ft>>2]=0}else Ce=0;else ce=H[Te+8>>2],H[ce+12>>2]=Ce,H[Ce+8>>2]=ce;if(!Jt)break t;Ke=H[Te+28>>2];n:{if(H[(ce=1920+(Ke<<2)|0)>>2]==(0|Te)){if(H[ce>>2]=Ce,Ce)break n;H[405]=H[405]&Dr(Ke);break t}if(H[Jt+(H[Jt+16>>2]==(0|Te)?16:20)>>2]=Ce,!Ce)break t}if(H[Ce+24>>2]=Jt,(ce=H[Te+16>>2])&&(H[Ce+16>>2]=ce,H[ce+24>>2]=Ce),!(ce=H[Te+20>>2]))break t;H[Ce+20>>2]=ce,H[ce+24>>2]=Ce}}if(!(Te>>>0>=vt>>>0)&&1&(Ce=H[vt+4>>2])){t:{if(!(2&Ce)){if(H[410]==(0|vt)){if(H[410]=Te,Q=H[407]+Q|0,H[407]=Q,H[Te+4>>2]=1|Q,H[409]!=(0|Te))break e;return H[406]=0,void(H[409]=0)}if(H[409]==(0|vt))return H[409]=Te,Q=H[406]+Q|0,H[406]=Q,H[Te+4>>2]=1|Q,void(H[Q+Te>>2]=Q);Q=(-8&Ce)+Q|0;n:if(Ce>>>0<=255){if(Ke=H[vt+8>>2],Ce=Ce>>>3|0,(0|(ce=H[vt+12>>2]))==(0|Ke)){H[404]=H[404]&Dr(Ce);break n}H[Ke+12>>2]=ce,H[ce+8>>2]=Ke}else{if(Jt=H[vt+24>>2],(0|vt)==(0|(Ce=H[vt+12>>2])))if((ce=H[(Ke=vt+20|0)>>2])||(ce=H[(Ke=vt+16|0)>>2])){for(;Ft=Ke,(ce=H[(Ke=(Ce=ce)+20|0)>>2])||(Ke=Ce+16|0,ce=H[Ce+16>>2]););H[Ft>>2]=0}else Ce=0;else ce=H[vt+8>>2],H[ce+12>>2]=Ce,H[Ce+8>>2]=ce;if(Jt){Ke=H[vt+28>>2];a:{if(H[(ce=1920+(Ke<<2)|0)>>2]==(0|vt)){if(H[ce>>2]=Ce,Ce)break a;H[405]=H[405]&Dr(Ke);break n}if(H[Jt+(H[Jt+16>>2]==(0|vt)?16:20)>>2]=Ce,!Ce)break n}H[Ce+24>>2]=Jt,(ce=H[vt+16>>2])&&(H[Ce+16>>2]=ce,H[ce+24>>2]=Ce),(ce=H[vt+20>>2])&&(H[Ce+20>>2]=ce,H[ce+24>>2]=Ce)}}if(H[Te+4>>2]=1|Q,H[Q+Te>>2]=Q,H[409]!=(0|Te))break t;return void(H[406]=Q)}H[vt+4>>2]=-2&Ce,H[Te+4>>2]=1|Q,H[Q+Te>>2]=Q}if(Q>>>0<=255)return Ce=1656+((Q=Q>>>3|0)<<3)|0,(ce=H[404])&(Q=1<<Q)?Q=H[Ce+8>>2]:(H[404]=Q|ce,Q=Ce),H[Ce+8>>2]=Te,H[Q+12>>2]=Te,H[Te+12>>2]=Ce,void(H[Te+8>>2]=Q);Ke=31,H[Te+16>>2]=0,H[Te+20>>2]=0,Q>>>0<=16777215&&(Ce=Q>>>8|0,Ce<<=Ft=Ce+1048320>>>16&8,Ke=28+((Ce=((Ce<<=Ke=Ce+520192>>>16&4)<<(ce=Ce+245760>>>16&2)>>>15|0)-(ce|Ke|Ft)|0)<<1|Q>>>Ce+21&1)|0),H[Te+28>>2]=Ke,Ft=1920+(Ke<<2)|0;t:{n:{if((ce=H[405])&(Ce=1<<Ke)){for(Ke=Q<<((0|Ke)==31?0:25-(Ke>>>1|0)|0),Ce=H[Ft>>2];;){if(ce=Ce,(-8&H[Ce+4>>2])==(0|Q))break n;if(Ce=Ke>>>29|0,Ke<<=1,!(Ce=H[16+(Ft=ce+(4&Ce)|0)>>2]))break}H[Ft+16>>2]=Te,H[Te+24>>2]=ce}else H[405]=Ce|ce,H[Ft>>2]=Te,H[Te+24>>2]=Ft;H[Te+12>>2]=Te,H[Te+8>>2]=Te;break t}Q=H[ce+8>>2],H[Q+12>>2]=Te,H[ce+8>>2]=Te,H[Te+24>>2]=0,H[Te+12>>2]=ce,H[Te+8>>2]=Q}Q=H[412]-1|0,H[412]=Q||-1}}}function gs(Q,Ce,ce){var Te,Ke=0,vt=0;if(ce>>>0>=512)return ms(0|Q,0|Ce,0|ce),Q;Te=Q+ce|0;e:if(3&(Q^Ce))if(Te>>>0<4)ce=Q;else if((Ke=Te-4|0)>>>0<Q>>>0)ce=Q;else for(ce=Q;or[0|ce]=Nr[0|Ce],or[ce+1|0]=Nr[Ce+1|0],or[ce+2|0]=Nr[Ce+2|0],or[ce+3|0]=Nr[Ce+3|0],Ce=Ce+4|0,Ke>>>0>=(ce=ce+4|0)>>>0;);else{t:if(3&Q)if(ce)for(ce=Q;;){if(or[0|ce]=Nr[0|Ce],Ce=Ce+1|0,!(3&(ce=ce+1|0)))break t;if(!(ce>>>0<Te>>>0))break}else ce=Q;else ce=Q;if(!((Ke=-4&Te)>>>0<64||(vt=Ke+-64|0)>>>0<ce>>>0))for(;H[ce>>2]=H[Ce>>2],H[ce+4>>2]=H[Ce+4>>2],H[ce+8>>2]=H[Ce+8>>2],H[ce+12>>2]=H[Ce+12>>2],H[ce+16>>2]=H[Ce+16>>2],H[ce+20>>2]=H[Ce+20>>2],H[ce+24>>2]=H[Ce+24>>2],H[ce+28>>2]=H[Ce+28>>2],H[ce+32>>2]=H[Ce+32>>2],H[ce+36>>2]=H[Ce+36>>2],H[ce+40>>2]=H[Ce+40>>2],H[ce+44>>2]=H[Ce+44>>2],H[ce+48>>2]=H[Ce+48>>2],H[ce+52>>2]=H[Ce+52>>2],H[ce+56>>2]=H[Ce+56>>2],H[ce+60>>2]=H[Ce+60>>2],Ce=Ce- -64|0,vt>>>0>=(ce=ce- -64|0)>>>0;);if(ce>>>0>=Ke>>>0)break e;for(;H[ce>>2]=H[Ce>>2],Ce=Ce+4|0,Ke>>>0>(ce=ce+4|0)>>>0;);}if(ce>>>0<Te>>>0)for(;or[0|ce]=Nr[0|Ce],Ce=Ce+1|0,(0|Te)!=(0|(ce=ce+1|0)););return Q}function Gs(Q,Ce){var ce=0;if(Ce&&(or[0|Q]=0,or[(ce=Q+Ce|0)-1|0]=0,!(Ce>>>0<3||(or[Q+2|0]=0,or[Q+1|0]=0,or[ce-3|0]=0,or[ce-2|0]=0,Ce>>>0<7||(or[Q+3|0]=0,or[ce-4|0]=0,Ce>>>0<9||(H[(Q=(ce=0-Q&3)+Q|0)>>2]=0,H[(Ce=(ce=Ce-ce&-4)+Q|0)-4>>2]=0,ce>>>0<9||(H[Q+8>>2]=0,H[Q+4>>2]=0,H[Ce-8>>2]=0,H[Ce-12>>2]=0,ce>>>0<25||(H[Q+24>>2]=0,H[Q+20>>2]=0,H[Q+16>>2]=0,H[Q+12>>2]=0,H[Ce-16>>2]=0,H[Ce-20>>2]=0,H[Ce-24>>2]=0,H[Ce-28>>2]=0,(Ce=(Ce=ce)-(ce=4&Q|24)|0)>>>0<32))))))))for(Q=Q+ce|0;H[Q+24>>2]=0,H[Q+28>>2]=0,H[Q+16>>2]=0,H[Q+20>>2]=0,H[Q+8>>2]=0,H[Q+12>>2]=0,H[Q>>2]=0,H[Q+4>>2]=0,Q=Q+32|0,(Ce=Ce-32|0)>>>0>31;);}function ro(Q){var Ce,ce=0,Te=0,Ke=0;Ce=0|ns(8),H[Ce>>2]=1348,H[Ce>>2]=1392;e:{t:{if(3&(ce=Q))for(;;){if(!Nr[0|ce])break t;if(!(3&(ce=ce+1|0)))break}for(;Te=ce,ce=ce+4|0,!((-1^(Ke=H[Te>>2]))&Ke-16843009&-2139062144););if(ce=Te-Q|0,!(255&Ke))break e;for(;Ke=Nr[Te+1|0],Te=ce=Te+1|0,Ke;);}ce=ce-Q|0}Te=ao(ce+13|0),H[Te+8>>2]=0,H[Te+4>>2]=ce,H[Te>>2]=ce,H[Ce+4>>2]=gs(Te+12|0,Q,ce+1|0),H[Ce>>2]=1440,no(0|Ce,1472,1),xo()}function ys(Q,Ce,ce,Te){or[Q+53|0]=1;e:if(H[Q+4>>2]==(0|ce)){or[Q+52|0]=1;t:{if(!(ce=H[Q+16>>2])){if(H[Q+36>>2]=1,H[Q+24>>2]=Te,H[Q+16>>2]=Ce,(0|Te)!=1)break e;if(H[Q+48>>2]==1)break t;break e}if((0|Ce)==(0|ce)){if((0|(ce=H[Q+24>>2]))==2&&(H[Q+24>>2]=Te,ce=Te),H[Q+48>>2]!=1)break e;if((0|ce)==1)break t;break e}H[Q+36>>2]=H[Q+36>>2]+1}or[Q+54|0]=1}}function Oa(Q,Ce,ce){var Te=0;if(!ce)return H[Q+4>>2]==H[Ce+4>>2];if((0|Q)==(0|Ce))return 1;Te=H[Q+4>>2],Q=Nr[0|Te],ce=H[Ce+4>>2];e:if(!(!Q|(0|(Ce=Nr[0|ce]))!=(0|Q)))for(;;){if(Ce=Nr[ce+1|0],!(Q=Nr[Te+1|0]))break e;if(ce=ce+1|0,Te=Te+1|0,(0|Q)!=(0|Ce))break}return(0|Q)==(0|Ce)}function vs(Q,Ce,ce){var Te;if(!(Te=H[Q+16>>2]))return H[Q+36>>2]=1,H[Q+24>>2]=ce,void(H[Q+16>>2]=Ce);e:{if((0|Ce)==(0|Te)){if(H[Q+24>>2]!=2)break e;return void(H[Q+24>>2]=ce)}or[Q+54|0]=1,H[Q+24>>2]=2,H[Q+36>>2]=H[Q+36>>2]+1}}function io(Q){var Ce,ce;return(Q=(Ce=H[377])+(ce=Q+3&-4)|0)>>>0<=Ce>>>0&&ce||Q>>>0>(wi.byteLength/65536|0)<<16>>>0&&!(0|Bs(0|Q))?(H[403]=48,-1):(H[377]=Q,Ce)}function ao(Q){var Ce=0;Q=Q||1;e:{for(;;){if(Ce=Fo(Q))break e;if(!(Ce=H[528]))break;jr[0|Ce]()}ts(),xo()}return Ce}function qr(Q){var Ce,ce;return H[(Q|=0)>>2]=1392,Ce=H[Q+4>>2]-12|0,ce=H[Ce+8>>2]-1|0,H[Ce+8>>2]=ce,(0|ce)<0&&Aa(Ce),0|Q}function Dr(Q){var Ce;return(-1>>>(Ce=31&Q)&-2)<<Ce|(-1<<(Q=0-Q&31)&-2)>>>Q}function rs(Q){(Q|=0)&&Aa(Q)}function xs(Q){qr(Q|=0),Aa(Q)}function is(Q){return 0|Q}function Bo(Q){Aa(Q|=0)}function Yi(Q){}ba(Tr=Nr,1024,"dmVjdG9yAHN0ZDo6ZXhjZXB0aW9uAGFsbG9jYXRvcjxUPjo6YWxsb2NhdGUoc2l6ZV90IG4pICduJyBleGNlZWRzIG1heGltdW0gc3VwcG9ydGVkIHNpemUATjEwX19jeHhhYml2MTE2X19zaGltX3R5cGVfaW5mb0UAAOgEAABaBAAA3AUAAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQAAAOgEAACIBAAAfAQAAAAAAACsBAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAAAAAAMAUAAAIAAAAKAAAABAAAAAUAAAAGAAAACwAAAAwAAAANAAAATjEwX19jeHhhYml2MTIwX19zaV9jbGFzc190eXBlX2luZm9FAAAAAOgEAAAIBQAArAQAAAAAAABgBQAADgAAAA8AAAAQAAAAU3Q5ZXhjZXB0aW9uAAAAAMAEAABQBQAAAAAAAIwFAAABAAAAEQAAABIAAABTdDExbG9naWNfZXJyb3IA6AQAAHwFAABgBQAAAAAAAMAFAAABAAAAEwAAABIAAABTdDEybGVuZ3RoX2Vycm9yAAAAAOgEAACsBQAAjAUAAFN0OXR5cGVfaW5mbwAAAADABAAAzAU="),ba(Tr,1508,"UAhQ");var jr=function(Q){return Q.grow=function(Ce){var ce=this.length;return this.length=this.length+Ce,ce},Q.set=function(Ce,ce){this[Ce]=ce},Q.get=function(Ce){return this[Ce]},Q}([null,qr,is,Bo,Yi,Yi,function(Q,Ce,ce){ce|=0;var Te,Ke=0,vt=0,Ft=0,Jt=0;if(la=Te=la+-64|0,Ke=1,!Oa(Q|=0,Ce|=0,0)&&(Ke=0,Ce)){la=Ke=la+-64|0,vt=H[Ce>>2],Ft=H[vt-4>>2],Jt=H[vt-8>>2],H[Ke+20>>2]=0,H[Ke+16>>2]=1148,H[Ke+12>>2]=Ce,H[Ke+8>>2]=1196,vt=0,Gs(Ke+24|0,39),Ce=Ce+Jt|0;e:if(Oa(Ft,1196,0))H[Ke+56>>2]=1,jr[H[H[Ft>>2]+20>>2]](Ft,Ke+8|0,Ce,Ce,1,0),vt=H[Ke+32>>2]==1?Ce:0;else{jr[H[H[Ft>>2]+24>>2]](Ft,Ke+8|0,Ce,1,0);t:switch(H[Ke+44>>2]){case 0:vt=H[Ke+48>>2]==1&&H[Ke+36>>2]==1&&H[Ke+40>>2]==1?H[Ke+28>>2]:0;break e;case 1:break t;default:break e}H[Ke+32>>2]!=1&&H[Ke+48>>2]|H[Ke+36>>2]!=1|H[Ke+40>>2]!=1||(vt=H[Ke+24>>2])}la=Ke- -64|0,Ke=0,vt&&(Gs(4|(Ce=Te+8|0),52),H[Te+56>>2]=1,H[Te+20>>2]=-1,H[Te+16>>2]=Q,H[Te+8>>2]=vt,jr[H[H[vt>>2]+28>>2]](vt,Ce,H[ce>>2],1),(0|(Q=H[Te+32>>2]))==1&&(H[ce>>2]=H[Te+24>>2]),Ke=(0|Q)==1)}return la=Te- -64|0,0|Ke},function(Q,Ce,ce,Te,Ke,vt){ce|=0,Te|=0,Ke|=0,vt|=0,Oa(Q|=0,H[8+(Ce|=0)>>2],vt)&&ys(Ce,ce,Te,Ke)},function(Q,Ce,ce,Te,Ke){if(ce|=0,Te|=0,Ke|=0,Oa(Q|=0,H[8+(Ce|=0)>>2],Ke))H[Ce+28>>2]==1|H[Ce+4>>2]!=(0|ce)||(H[Ce+28>>2]=Te);else e:if(Oa(Q,H[Ce>>2],Ke)){if(!(H[Ce+16>>2]!=(0|ce)&H[Ce+20>>2]!=(0|ce))){if((0|Te)!=1)break e;return void(H[Ce+32>>2]=1)}H[Ce+20>>2]=ce,H[Ce+32>>2]=Te,H[Ce+40>>2]=H[Ce+40>>2]+1,H[Ce+36>>2]!=1|H[Ce+24>>2]!=2||(or[Ce+54|0]=1),H[Ce+44>>2]=4}},function(Q,Ce,ce,Te){ce|=0,Te|=0,Oa(Q|=0,H[8+(Ce|=0)>>2],0)&&vs(Ce,ce,Te)},Bo,function(Q,Ce,ce,Te,Ke,vt){ce|=0,Te|=0,Ke|=0,vt|=0,Oa(Q|=0,H[8+(Ce|=0)>>2],vt)?ys(Ce,ce,Te,Ke):(Q=H[Q+8>>2],jr[H[H[Q>>2]+20>>2]](Q,Ce,ce,Te,Ke,vt))},function(Q,Ce,ce,Te,Ke){if(ce|=0,Te|=0,Ke|=0,Oa(Q|=0,H[8+(Ce|=0)>>2],Ke))H[Ce+28>>2]==1|H[Ce+4>>2]!=(0|ce)||(H[Ce+28>>2]=Te);else e:{if(Oa(Q,H[Ce>>2],Ke)){if(!(H[Ce+16>>2]!=(0|ce)&H[Ce+20>>2]!=(0|ce))){if((0|Te)!=1)break e;return void(H[Ce+32>>2]=1)}H[Ce+32>>2]=Te;t:if(H[Ce+44>>2]!=4){if(ni[Ce+52>>1]=0,Q=H[Q+8>>2],jr[H[H[Q>>2]+20>>2]](Q,Ce,ce,ce,1,Ke),Nr[Ce+53|0]){if(H[Ce+44>>2]=3,!Nr[Ce+52|0])break t;break e}H[Ce+44>>2]=4}if(H[Ce+20>>2]=ce,H[Ce+40>>2]=H[Ce+40>>2]+1,H[Ce+36>>2]!=1|H[Ce+24>>2]!=2)break e;return void(or[Ce+54|0]=1)}Q=H[Q+8>>2],jr[H[H[Q>>2]+24>>2]](Q,Ce,ce,Te,Ke)}},function(Q,Ce,ce,Te){ce|=0,Te|=0,Oa(Q|=0,H[8+(Ce|=0)>>2],0)?vs(Ce,ce,Te):(Q=H[Q+8>>2],jr[H[H[Q>>2]+28>>2]](Q,Ce,ce,Te))},is,Bo,function(Q){return 1031},xs,function(Q){return H[4+(Q|=0)>>2]},xs]);return{g:function(){},h:rs,i:function(){var Q;return Q=ao(24),H[Q>>2]=0,H[Q+4>>2]=0,H[Q+16>>2]=0,H[Q+20>>2]=0,H[Q+8>>2]=0,H[Q+12>>2]=0,0|Q},j:function(Q,Ce,ce){var Te;return Q=+Q,Ce=+Ce,ce=+ce,Te=ao(24),Zn[Te+16>>3]=ce,Zn[Te+8>>3]=Ce,Zn[Te>>3]=Q,0|Te},k:function(Q,Ce){Ce|=0,Zn[(Q|=0)>>3]=Zn[Q>>3]+Zn[Ce>>3],Zn[Q+8>>3]=Zn[Q+8>>3]+Zn[Ce+8>>3],Zn[Q+16>>3]=Zn[Q+16>>3]+Zn[Ce+16>>3]},l:function(Q,Ce){Ce|=0,Zn[(Q|=0)>>3]=Zn[Q>>3]-Zn[Ce>>3],Zn[Q+8>>3]=Zn[Q+8>>3]-Zn[Ce+8>>3],Zn[Q+16>>3]=Zn[Q+16>>3]-Zn[Ce+16>>3]},m:function(Q){return+Zn[(Q|=0)>>3]},n:function(Q,Ce){Ce=+Ce,Zn[(Q|=0)>>3]=Ce},o:function(Q){return+Zn[8+(Q|=0)>>3]},p:function(Q,Ce){Ce=+Ce,Zn[8+(Q|=0)>>3]=Ce},q:function(Q){return+Zn[16+(Q|=0)>>3]},r:function(Q,Ce){Ce=+Ce,Zn[16+(Q|=0)>>3]=Ce},s:rs,t:function(){var Q;return Q=ao(12),H[Q+8>>2]=0,H[Q>>2]=0,H[Q+4>>2]=0,0|Q},u:function(Q,Ce){Ce|=0;var ce=0,Te=0,Ke=0,vt=0,Ft=0,Jt=0;e:if((0|(ce=H[4+(Q|=0)>>2]))==H[Q+8>>2]){t:{if((Ke=1+(ce=(0|(Jt=ce-(Te=H[Q>>2])|0))/24|0)|0)>>>0<178956971){if(vt=ce<<1,Ke=ce>>>0<89478485?Ke>>>0<vt>>>0?vt:Ke:178956970){if(Ke>>>0>=178956971)break t;vt=ao(Xi(Ke,24))}else vt=0;ce=vt+Xi(ce,24)|0,Ft=H[Ce+4>>2],H[ce>>2]=H[Ce>>2],H[ce+4>>2]=Ft,Ft=H[Ce+20>>2],H[ce+16>>2]=H[Ce+16>>2],H[ce+20>>2]=Ft,Ft=H[Ce+12>>2],H[ce+8>>2]=H[Ce+8>>2],H[ce+12>>2]=Ft,Ce=ce+Xi((0|Jt)/-24|0,24)|0,(0|Jt)>0&&gs(Ce,Te,Jt),H[Q+8>>2]=vt+Xi(Ke,24),H[Q+4>>2]=ce+24,H[Q>>2]=Ce,Te&&Aa(Te);break e}ro(1024),xo()}ro(1046),xo()}else Te=H[Ce+4>>2],H[ce>>2]=H[Ce>>2],H[ce+4>>2]=Te,Te=H[Ce+20>>2],H[ce+16>>2]=H[Ce+16>>2],H[ce+20>>2]=Te,Te=H[Ce+12>>2],H[ce+8>>2]=H[Ce+8>>2],H[ce+12>>2]=Te,H[Q+4>>2]=ce+24},v:function(Q){var Ce=0;(Q|=0)&&((Ce=H[Q>>2])&&(H[Q+4>>2]=Ce,Aa(Ce)),Aa(Q))},w:function(){return 0|ao(1)},x:function(Q,Ce){Q|=0;var ce=0,Te=0,Ke=0,vt=0,Ft=0,Jt=0,In=0,Gn=0,sr=0,hi=0,oo=0,Ei=0;if(Q=H[(Ce|=0)>>2],(Te=(0|(Ke=H[Ce+4>>2]-Q|0))/24|0)>>>0>=2){if(!(Ke-24>>>0<24)){if(ce=Zn[Q+8>>3],Ce=1,oo=1&(Te=Te-1|0),Ft=Zn[Q>>3],Ke-48>>>0<24)Jt=ce;else for(Ei=-2&Te,Te=0,In=Ft,Gn=ce;Ke=Q+Xi(Ce,24)|0,vt=.5*((Ft=Zn[Ke+24>>3])-(sr=Zn[Ke>>3]))*((hi=Zn[Ke+8>>3]-ce)+((Jt=Zn[Ke+32>>3])-ce))+(.5*(sr-In)*(Gn-ce+hi)+vt),Ce=Ce+2|0,In=Ft,Gn=Jt,(0|Ei)!=(0|(Te=Te+2|0)););oo&&(Q=Q+Xi(Ce,24)|0,vt=.5*(Zn[Q>>3]-Ft)*(Jt-ce+(Zn[Q+8>>3]-ce))+vt)}ce=vt<0?-vt:vt}else ce=0;return+ce},y:function(Q,Ce,ce){Q|=0,Ce|=0;var Te,Ke=0,vt=0,Ft=0,Jt=0,In=0,Gn=0,sr=0;if((Te=((Q=H[4+(ce|=0)>>2])-(ce=H[ce>>2])|0)/24|0)>>>0>=3)for(Q=Te-1|0,Ke=Zn[Ce+8>>3],sr=Zn[Ce>>3],Ce=0;Jt=ce+Xi(Q,24)|0,Ft=Zn[Jt+8>>3],Q=Ce,Ce=ce+Xi(Ce,24)|0,!(Ke<Ft&(vt=Zn[Ce+8>>3])<=Ke)&(!(Ke>=Ft)|!(Ke<vt))||sr-(In=Zn[Ce>>3])<(Ke-vt)*(Zn[Jt>>3]-In)/(Ft-vt)&&(Gn^=1),(0|Te)!=(0|(Ce=Q+1|0)););return 1&Gn},z:rs,A:jr,B:Fo}}(Mr)}(se)}})}}}).then(function(br){return br}).then(En,function(br){Y("failed to asynchronously prepare wasm: "+br),je(br)})}var tn={a:se};if(ue++,a.monitorRunDependencies&&a.monitorRunDependencies(ue),a.instantiateWasm)try{return a.instantiateWasm(tn,Ie)}catch(En){return Y("Module.instantiateWasm callback failed with error: "+En),!1}(_||typeof S.instantiateStreaming!="function"||ve.startsWith(Be)||ve.startsWith("file://")||typeof fetch!="function"?rn(Mt):fetch(ve,{credentials:"same-origin"}).then(function(En){return S.instantiateStreaming(En,tn).then(Mt,function(br){return Y("wasm streaming compile failed: "+br),Y("falling back to ArrayBuffer instantiation"),rn(Mt)})})).catch(h)})(),a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.g).apply(null,arguments)};var xe,De=a._emscripten_bind_VoidPtr___destroy___0=function(){return(De=a._emscripten_bind_VoidPtr___destroy___0=a.asm.h).apply(null,arguments)},tt=a._emscripten_bind_McGePoint3d_McGePoint3d_0=function(){return(tt=a._emscripten_bind_McGePoint3d_McGePoint3d_0=a.asm.i).apply(null,arguments)},st=a._emscripten_bind_McGePoint3d_McGePoint3d_3=function(){return(st=a._emscripten_bind_McGePoint3d_McGePoint3d_3=a.asm.j).apply(null,arguments)},mt=a._emscripten_bind_McGePoint3d_op_add_1=function(){return(mt=a._emscripten_bind_McGePoint3d_op_add_1=a.asm.k).apply(null,arguments)},Rt=a._emscripten_bind_McGePoint3d_op_sub_1=function(){return(Rt=a._emscripten_bind_McGePoint3d_op_sub_1=a.asm.l).apply(null,arguments)},Ot=a._emscripten_bind_McGePoint3d_get_x_0=function(){return(Ot=a._emscripten_bind_McGePoint3d_get_x_0=a.asm.m).apply(null,arguments)},He=a._emscripten_bind_McGePoint3d_set_x_1=function(){return(He=a._emscripten_bind_McGePoint3d_set_x_1=a.asm.n).apply(null,arguments)},Vt=a._emscripten_bind_McGePoint3d_get_y_0=function(){return(Vt=a._emscripten_bind_McGePoint3d_get_y_0=a.asm.o).apply(null,arguments)},jt=a._emscripten_bind_McGePoint3d_set_y_1=function(){return(jt=a._emscripten_bind_McGePoint3d_set_y_1=a.asm.p).apply(null,arguments)},Ln=a._emscripten_bind_McGePoint3d_get_z_0=function(){return(Ln=a._emscripten_bind_McGePoint3d_get_z_0=a.asm.q).apply(null,arguments)},nn=a._emscripten_bind_McGePoint3d_set_z_1=function(){return(nn=a._emscripten_bind_McGePoint3d_set_z_1=a.asm.r).apply(null,arguments)},er=a._emscripten_bind_McGePoint3d___destroy___0=function(){return(er=a._emscripten_bind_McGePoint3d___destroy___0=a.asm.s).apply(null,arguments)},yt=a._emscripten_bind_McGePoint3dArray_McGePoint3dArray_0=function(){return(yt=a._emscripten_bind_McGePoint3dArray_McGePoint3dArray_0=a.asm.t).apply(null,arguments)},Ue=a._emscripten_bind_McGePoint3dArray_append_1=function(){return(Ue=a._emscripten_bind_McGePoint3dArray_append_1=a.asm.u).apply(null,arguments)},Zt=a._emscripten_bind_McGePoint3dArray___destroy___0=function(){return(Zt=a._emscripten_bind_McGePoint3dArray___destroy___0=a.asm.v).apply(null,arguments)},On=a._emscripten_bind_McGeTool_McGeTool_0=function(){return(On=a._emscripten_bind_McGeTool_McGeTool_0=a.asm.w).apply(null,arguments)},Xn=a._emscripten_bind_McGeTool_calcArea_1=function(){return(Xn=a._emscripten_bind_McGeTool_calcArea_1=a.asm.x).apply(null,arguments)},dt=a._emscripten_bind_McGeTool_pointInPolyline_2=function(){return(dt=a._emscripten_bind_McGeTool_pointInPolyline_2=a.asm.y).apply(null,arguments)},lt=a._emscripten_bind_McGeTool___destroy___0=function(){return(lt=a._emscripten_bind_McGeTool___destroy___0=a.asm.z).apply(null,arguments)},Xt=a._malloc=function(){return(Xt=a._malloc=a.asm.B).apply(null,arguments)};function xn(){function Ie(){if(!xe&&(xe=!0,a.calledRun=!0,!c)){if(oe(J),v(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;){var Mt=a.postRun.shift();te.unshift(Mt)}oe(te)}}if(!(0<ue)){if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)ne();oe(X),0<ue||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1),Ie()},1)):Ie())}}if(be=function Ie(){xe||xn(),xe||(be=Ie)},a.run=xn,a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();function $t(){}function Yn(Ie){return(Ie||$t).F}function kr(Ie,Mt){var rn=Yn(Mt),tn=rn[Ie];return tn||((tn=Object.create((Mt||$t).prototype)).C=Ie,rn[Ie]=tn)}function Br(){throw"cannot construct a VoidPtr, no constructor in IDL"}function $e(Ie,Mt,rn){Ie&&typeof Ie=="object"&&(Ie=Ie.C),Mt&&typeof Mt=="object"&&(Mt=Mt.C),rn&&typeof rn=="object"&&(rn=rn.C),this.C=Ie===void 0?tt():Mt===void 0?_emscripten_bind_McGePoint3d_McGePoint3d_1(Ie):rn===void 0?_emscripten_bind_McGePoint3d_McGePoint3d_2(Ie,Mt):st(Ie,Mt,rn),Yn($e)[this.C]=this}function We(){this.C=yt(),Yn(We)[this.C]=this}function ut(){this.C=On(),Yn(ut)[this.C]=this}return xn(),$t.prototype=Object.create($t.prototype),$t.prototype.constructor=$t,$t.prototype.D=$t,$t.F={},a.WrapperObject=$t,a.getCache=Yn,a.wrapPointer=kr,a.castObject=function(Ie,Mt){return kr(Ie.C,Mt)},a.NULL=kr(0),a.destroy=function(Ie){if(!Ie.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";Ie.__destroy__(),delete Yn(Ie.D)[Ie.C]},a.compare=function(Ie,Mt){return Ie.C===Mt.C},a.getPointer=function(Ie){return Ie.C},a.getClass=function(Ie){return Ie.D},Br.prototype=Object.create($t.prototype),Br.prototype.constructor=Br,Br.prototype.D=Br,Br.F={},a.VoidPtr=Br,Br.prototype.__destroy__=function(){De(this.C)},$e.prototype=Object.create($t.prototype),$e.prototype.constructor=$e,$e.prototype.D=$e,$e.F={},a.McGePoint3d=$e,$e.prototype.op_add=function(Ie){var Mt=this.C;Ie&&typeof Ie=="object"&&(Ie=Ie.C),mt(Mt,Ie)},$e.prototype.op_sub=function(Ie){var Mt=this.C;Ie&&typeof Ie=="object"&&(Ie=Ie.C),Rt(Mt,Ie)},$e.prototype.get_x=$e.prototype.H=function(){return Ot(this.C)},$e.prototype.set_x=$e.prototype.R=function(Ie){var Mt=this.C;Ie&&typeof Ie=="object"&&(Ie=Ie.C),He(Mt,Ie)},Object.defineProperty($e.prototype,"x",{get:$e.prototype.H,set:$e.prototype.R}),$e.prototype.get_y=$e.prototype.I=function(){return Vt(this.C)},$e.prototype.set_y=$e.prototype.S=function(Ie){var Mt=this.C;Ie&&typeof Ie=="object"&&(Ie=Ie.C),jt(Mt,Ie)},Object.defineProperty($e.prototype,"y",{get:$e.prototype.I,set:$e.prototype.S}),$e.prototype.get_z=$e.prototype.J=function(){return Ln(this.C)},$e.prototype.set_z=$e.prototype.T=function(Ie){var Mt=this.C;Ie&&typeof Ie=="object"&&(Ie=Ie.C),nn(Mt,Ie)},Object.defineProperty($e.prototype,"z",{get:$e.prototype.J,set:$e.prototype.T}),$e.prototype.__destroy__=function(){er(this.C)},We.prototype=Object.create($t.prototype),We.prototype.constructor=We,We.prototype.D=We,We.F={},a.McGePoint3dArray=We,We.prototype.append=We.prototype.append=function(Ie){var Mt=this.C;Ie&&typeof Ie=="object"&&(Ie=Ie.C),Ue(Mt,Ie)},We.prototype.__destroy__=function(){Zt(this.C)},ut.prototype=Object.create($t.prototype),ut.prototype.constructor=ut,ut.prototype.D=ut,ut.F={},a.McGeTool=ut,ut.prototype.calcArea=function(Ie){var Mt=this.C;return Ie&&typeof Ie=="object"&&(Ie=Ie.C),Xn(Mt,Ie)},ut.prototype.pointInPolyline=function(Ie,Mt){var rn=this.C;return Ie&&typeof Ie=="object"&&(Ie=Ie.C),Mt&&typeof Mt=="object"&&(Mt=Mt.C),!!dt(rn,Ie,Mt)},ut.prototype.__destroy__=function(){lt(this.C)},o.ready});return typeof exports=="object"&&typeof module=="object"?module.exports=r:typeof define=="function"&&define.amd?define([],function(){return r}):typeof exports=="object"&&(exports.mxcadassembly=r),r()}function loadMxcadAssembly(){mxcadassemblyinit().then(function(w){store.commit("setMxassembly",w)})}function _load(w){window.MxDocumentReady=void 0,window.MxUiMain=r=>{const o=r("./MxFun").MxFun;window.THREE=o.getTHREE(),store.commit("setMxFun",o),store.events.emit("MxUiMain",r),window.MxUiMain=void 0},window.MxMain=r=>(store.events.emit("MxMain",r),window.MxMain=void 0,registerMxDbEntity(),w(),0),mxfun(),loadMxcadAssembly()}function loadCoreCode(){return Si(this,null,function*(){return new Promise((w,r)=>Si(this,null,function*(){try{if(store.state.MxFun)return console.warn("程序已自动调用loadCoreCode 无需主动调用 | The program has automatically called loadCoreCode without actively calling it"),void w();_load(w)}catch(o){r({code:"error",msg:o})}}))})}function createCanvas(w="mx-canvas"){let r=document.getElementById(w);return r||((r=document.createElement("canvas")).id=w),r}function createCanvasParent(w=createCanvas()){let r;return w||(w=createCanvas()),w.parentNode?r=w.parentNode:((r=document.createElement("div")).style.height="80vh",r.appendChild(w)),r}function dynamicImport(w){return Si(this,null,function*(){let r;switch(w){case"jquery":r=yield dynamicImportJquery();break;case"element-resize-event-polyfill":r=yield dynamicImportResize()}return r})}function dynamicImportResize(){return Si(this,null,function*(){try{const w=yield Promise.resolve().then(function(){return elementResizeEventPolyfill_umd_min$2});return w.default?w.default:w}catch(w){console.log("import动态导入:element-resize-event-polyfill失败!",w)}})}function dynamicImportJquery(){return Si(this,null,function*(){try{const w=yield Promise.resolve().then(function(){return jquery$1});return w.default?w.default:w}catch(w){console.log("import动态导入:jquery失败!",w)}})}window.$=window.jQuery=jquery,_load(()=>{});var lodash=createCommonjsModule(function(w,r){(function(){var o,a="Expected a function",v="__lodash_hash_undefined__",h="__lodash_placeholder__",b=16,D=32,U=64,V=128,I=256,g=1/0,A=9007199254740991,M=NaN,N=4294967295,F=[["ary",V],["bind",1],["bindKey",2],["curry",8],["curryRight",b],["flip",512],["partial",D],["partialRight",U],["rearg",I]],T="[object Arguments]",_="[object Array]",Y="[object Boolean]",k="[object Date]",S="[object Error]",G="[object Function]",C="[object GeneratorFunction]",B="[object Map]",R="[object Number]",u="[object Object]",c="[object Promise]",f="[object RegExp]",O="[object Set]",W="[object String]",X="[object Symbol]",J="[object WeakMap]",te="[object ArrayBuffer]",ne="[object DataView]",ue="[object Float32Array]",be="[object Float64Array]",je="[object Int8Array]",ve="[object Int16Array]",Be="[object Int32Array]",q="[object Uint8Array]",ge="[object Uint8ClampedArray]",oe="[object Uint16Array]",le="[object Uint32Array]",Pe=/\b__p \+= '';/g,Ye=/\b(__p \+=) '' \+/g,ze=/(__e\(.*?\)|\b__t\)) \+\n'';/g,se=/&(?:amp|lt|gt|quot|#39);/g,xe=/[&<>"']/g,De=RegExp(se.source),tt=RegExp(xe.source),st=/<%-([\s\S]+?)%>/g,mt=/<%([\s\S]+?)%>/g,Rt=/<%=([\s\S]+?)%>/g,Ot=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,He=/^\w*$/,Vt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jt=/[\\^$.*+?()[\]{}|]/g,Ln=RegExp(jt.source),nn=/^\s+/,er=/\s/,yt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ue=/\{\n\/\* \[wrapped with (.+)\] \*/,Zt=/,? & /,On=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Xn=/[()=,{}\[\]\/\s]/,dt=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Xt=/\w*$/,xn=/^[-+]0x[0-9a-f]+$/i,$t=/^0b[01]+$/i,Yn=/^\[object .+?Constructor\]$/,kr=/^0o[0-7]+$/i,Br=/^(?:0|[1-9]\d*)$/,$e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,We=/($^)/,ut=/['\n\r\u2028\u2029\\]/g,Ie="\\ud800-\\udfff",Mt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",rn="\\u2700-\\u27bf",tn="a-z\\xdf-\\xf6\\xf8-\\xff",En="A-Z\\xc0-\\xd6\\xd8-\\xde",br="\\ufe0e\\ufe0f",Mr="\\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",Tr="["+Ie+"]",ti="["+Mr+"]",Gr="["+Mt+"]",ba="\\d+",Di="["+rn+"]",wi="["+tn+"]",or="[^"+Ie+Mr+ba+rn+tn+En+"]",ni="\\ud83c[\\udffb-\\udfff]",H="[^"+Ie+"]",Nr="(?:\\ud83c[\\udde6-\\uddff]){2}",Ri="[\\ud800-\\udbff][\\udc00-\\udfff]",Zn="["+En+"]",Xi="\\u200d",xo="(?:"+wi+"|"+or+")",Bs="(?:"+Zn+"|"+or+")",ts="(?:['’](?:d|ll|m|re|s|t|ve))?",ms="(?:['’](?:D|LL|M|RE|S|T|VE))?",no="(?:"+Gr+"|"+ni+")?",ns="["+br+"]?",la=ns+no+"(?:"+Xi+"(?:"+[H,Nr,Ri].join("|")+")"+ns+no+")*",Fo="(?:"+[Di,Nr,Ri].join("|")+")"+la,Aa="(?:"+[H+Gr+"?",Gr,Nr,Ri,Tr].join("|")+")",gs=RegExp("['’]","g"),Gs=RegExp(Gr,"g"),ro=RegExp(ni+"(?="+ni+")|"+Aa+la,"g"),ys=RegExp([Zn+"?"+wi+"+"+ts+"(?="+[ti,Zn,"$"].join("|")+")",Bs+"+"+ms+"(?="+[ti,Zn+xo,"$"].join("|")+")",Zn+"?"+xo+"+"+ts,Zn+"+"+ms,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ba,Fo].join("|"),"g"),Oa=RegExp("["+Xi+Ie+Mt+br+"]"),vs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,io=["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"],ao=-1,qr={};qr[ue]=qr[be]=qr[je]=qr[ve]=qr[Be]=qr[q]=qr[ge]=qr[oe]=qr[le]=!0,qr[T]=qr[_]=qr[te]=qr[Y]=qr[ne]=qr[k]=qr[S]=qr[G]=qr[B]=qr[R]=qr[u]=qr[f]=qr[O]=qr[W]=qr[J]=!1;var Dr={};Dr[T]=Dr[_]=Dr[te]=Dr[ne]=Dr[Y]=Dr[k]=Dr[ue]=Dr[be]=Dr[je]=Dr[ve]=Dr[Be]=Dr[B]=Dr[R]=Dr[u]=Dr[f]=Dr[O]=Dr[W]=Dr[X]=Dr[q]=Dr[ge]=Dr[oe]=Dr[le]=!0,Dr[S]=Dr[G]=Dr[J]=!1;var rs={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xs=parseFloat,is=parseInt,Bo=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Yi=typeof self=="object"&&self&&self.Object===Object&&self,jr=Bo||Yi||Function("return this")(),Q=r&&!r.nodeType&&r,Ce=Q&&w&&!w.nodeType&&w,ce=Ce&&Ce.exports===Q,Te=ce&&Bo.process,Ke=function(){try{return Ce&&Ce.require&&Ce.require("util").types||Te&&Te.binding&&Te.binding("util")}catch(Me){}}(),vt=Ke&&Ke.isArrayBuffer,Ft=Ke&&Ke.isDate,Jt=Ke&&Ke.isMap,In=Ke&&Ke.isRegExp,Gn=Ke&&Ke.isSet,sr=Ke&&Ke.isTypedArray;function hi(Me,Se,Ve){switch(Ve.length){case 0:return Me.call(Se);case 1:return Me.call(Se,Ve[0]);case 2:return Me.call(Se,Ve[0],Ve[1]);case 3:return Me.call(Se,Ve[0],Ve[1],Ve[2])}return Me.apply(Se,Ve)}function oo(Me,Se,Ve,rt){for(var ft=-1,ct=Me==null?0:Me.length;++ft<ct;){var Lt=Me[ft];Se(rt,Lt,Ve(Lt),Me)}return rt}function Ei(Me,Se){for(var Ve=-1,rt=Me==null?0:Me.length;++Ve<rt&&Se(Me[Ve],Ve,Me)!==!1;);return Me}function wo(Me,Se){for(var Ve=-1,rt=Me==null?0:Me.length;++Ve<rt;)if(!Se(Me[Ve],Ve,Me))return!1;return!0}function Do(Me,Se){for(var Ve=-1,rt=Me==null?0:Me.length,ft=0,ct=[];++Ve<rt;){var Lt=Me[Ve];Se(Lt,Ve,Me)&&(ct[ft++]=Lt)}return ct}function so(Me,Se){return!(Me==null||!Me.length)&&Ai(Me,Se,0)>-1}function zs(Me,Se,Ve){for(var rt=-1,ft=Me==null?0:Me.length;++rt<ft;)if(Ve(Se,Me[rt]))return!0;return!1}function Wr(Me,Se){for(var Ve=-1,rt=Me==null?0:Me.length,ft=Array(rt);++Ve<rt;)ft[Ve]=Se(Me[Ve],Ve,Me);return ft}function Ma(Me,Se){for(var Ve=-1,rt=Se.length,ft=Me.length;++Ve<rt;)Me[ft+Ve]=Se[Ve];return Me}function ka(Me,Se,Ve,rt){var ft=-1,ct=Me==null?0:Me.length;for(rt&&ct&&(Ve=Me[++ft]);++ft<ct;)Ve=Se(Ve,Me[ft],ft,Me);return Ve}function na(Me,Se,Ve,rt){var ft=Me==null?0:Me.length;for(rt&&ft&&(Ve=Me[--ft]);ft--;)Ve=Se(Ve,Me[ft],ft,Me);return Ve}function Go(Me,Se){for(var Ve=-1,rt=Me==null?0:Me.length;++Ve<rt;)if(Se(Me[Ve],Ve,Me))return!0;return!1}var ws=Jr("length");function yr(Me,Se,Ve){var rt;return Ve(Me,function(ft,ct,Lt){if(Se(ft,ct,Lt))return rt=ct,!1}),rt}function zt(Me,Se,Ve,rt){for(var ft=Me.length,ct=Ve+(rt?1:-1);rt?ct--:++ct<ft;)if(Se(Me[ct],ct,Me))return ct;return-1}function Ai(Me,Se,Ve){return Se==Se?function(rt,ft,ct){for(var Lt=ct-1,kn=rt.length;++Lt<kn;)if(rt[Lt]===ft)return Lt;return-1}(Me,Se,Ve):zt(Me,cu,Ve)}function zo(Me,Se,Ve,rt){for(var ft=Ve-1,ct=Me.length;++ft<ct;)if(rt(Me[ft],Se))return ft;return-1}function cu(Me){return Me!=Me}function Xr(Me,Se){var Ve=Me==null?0:Me.length;return Ve?Gi(Me,Se)/Ve:M}function Jr(Me){return function(Se){return Se==null?o:Se[Me]}}function Zi(Me){return function(Se){return Me==null?o:Me[Se]}}function Us(Me,Se,Ve,rt,ft){return ft(Me,function(ct,Lt,kn){Ve=rt?(rt=!1,ct):Se(Ve,ct,Lt,kn)}),Ve}function Gi(Me,Se){for(var Ve,rt=-1,ft=Me.length;++rt<ft;){var ct=Se(Me[rt]);ct!==o&&(Ve=Ve===o?ct:Ve+ct)}return Ve}function bs(Me,Se){for(var Ve=-1,rt=Array(Me);++Ve<Me;)rt[Ve]=Se(Ve);return rt}function Hs(Me){return Me&&Me.slice(0,de(Me)+1).replace(nn,"")}function Re(Me){return function(Se){return Me(Se)}}function Eo(Me,Se){return Wr(Se,function(Ve){return Me[Ve]})}function ra(Me,Se){return Me.has(Se)}function uu(Me,Se){for(var Ve=-1,rt=Me.length;++Ve<rt&&Ai(Se,Me[Ve],0)>-1;);return Ve}function Ms(Me,Se){for(var Ve=Me.length;Ve--&&Ai(Se,Me[Ve],0)>-1;);return Ve}var Ao=Zi({À:"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"}),Ws=Zi({"&":"&","<":"<",">":">",'"':""","'":"'"});function _a(Me){return"\\"+rs[Me]}function fr(Me){return Oa.test(Me)}function Tl(Me){var Se=-1,Ve=Array(Me.size);return Me.forEach(function(rt,ft){Ve[++Se]=[ft,rt]}),Ve}function oc(Me,Se){return function(Ve){return Me(Se(Ve))}}function y(Me,Se){for(var Ve=-1,rt=Me.length,ft=0,ct=[];++Ve<rt;){var Lt=Me[Ve];Lt!==Se&&Lt!==h||(Me[Ve]=h,ct[ft++]=Ve)}return ct}function E(Me){var Se=-1,Ve=Array(Me.size);return Me.forEach(function(rt){Ve[++Se]=rt}),Ve}function K(Me){return fr(Me)?function(Se){for(var Ve=ro.lastIndex=0;ro.test(Se);)++Ve;return Ve}(Me):ws(Me)}function re(Me){return fr(Me)?function(Se){return Se.match(ro)||[]}(Me):function(Se){return Se.split("")}(Me)}function de(Me){for(var Se=Me.length;Se--&&er.test(Me.charAt(Se)););return Se}var fe=Zi({"&":"&","<":"<",">":">",""":'"',"'":"'"}),_e=function Me(Se){var Ve,rt=(Se=Se==null?jr:_e.defaults(jr.Object(),Se,_e.pick(jr,io))).Array,ft=Se.Date,ct=Se.Error,Lt=Se.Function,kn=Se.Math,Pt=Se.Object,Hn=Se.RegExp,Yr=Se.String,zr=Se.TypeError,ca=rt.prototype,Ta=Lt.prototype,dr=Pt.prototype,Ca=Se["__core-js_shared__"],vr=Ta.toString,Wn=dr.hasOwnProperty,lo=0,Uo=(Ve=/[^.]+$/.exec(Ca&&Ca.keys&&Ca.keys.IE_PROTO||""))?"Symbol(src)_1."+Ve:"",ua=dr.toString,Ho=vr.call(Pt),Sa=jr._,Ki=Hn("^"+vr.call(Wn).replace(jt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),co=ce?Se.Buffer:o,zi=Se.Symbol,Zr=Se.Uint8Array,Kr=co?co.allocUnsafe:o,Li=oc(Pt.getPrototypeOf,Pt),Ha=Pt.create,bi=dr.propertyIsEnumerable,Jn=ca.splice,li=zi?zi.isConcatSpreadable:o,ri=zi?zi.iterator:o,Pr=zi?zi.toStringTag:o,Da=function(){try{var s=Os(Pt,"defineProperty");return s({},"",{}),s}catch(p){}}(),_s=Se.clearTimeout!==jr.clearTimeout&&Se.clearTimeout,Cl=ft&&ft.now!==jr.Date.now&&ft.now,ia=Se.setTimeout!==jr.setTimeout&&Se.setTimeout,ha=kn.ceil,Ui=kn.floor,Ts=Pt.getOwnPropertySymbols,Wa=co?co.isBuffer:o,bo=Se.isFinite,Oo=ca.join,Sl=oc(Pt.keys,Pt),di=kn.max,Ii=kn.min,Js=ft.now,ki=Se.parseInt,Dl=kn.random,ke=ca.reverse,ot=Os(Se,"DataView"),Qe=Os(Se,"Map"),Ct=Os(Se,"Promise"),kt=Os(Se,"Set"),mn=Os(Se,"WeakMap"),gn=Os(Pt,"create"),Rn=mn&&new mn,It={},_r=Yo(ot),Tn=Yo(Qe),Qt=Yo(Ct),Rr=Yo(kt),tr=Yo(mn),ci=zi?zi.prototype:o,Mi=ci?ci.valueOf:o,pi=ci?ci.toString:o;function we(s){if(yi(s)&&!gr(s)&&!(s instanceof xr)){if(s instanceof Cr)return s;if(Wn.call(s,"__wrapped__"))return Zo(s)}return new Cr(s)}var _i=function(){function s(){}return function(p){if(!gi(p))return{};if(Ha)return Ha(p);s.prototype=p;var P=new s;return s.prototype=o,P}}();function an(){}function Cr(s,p){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=o}function xr(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=N,this.__views__=[]}function $i(s){var p=-1,P=s==null?0:s.length;for(this.clear();++p<P;){var ae=s[p];this.set(ae[0],ae[1])}}function Ja(s){var p=-1,P=s==null?0:s.length;for(this.clear();++p<P;){var ae=s[p];this.set(ae[0],ae[1])}}function Hi(s){var p=-1,P=s==null?0:s.length;for(this.clear();++p<P;){var ae=s[p];this.set(ae[0],ae[1])}}function Mo(s){var p=-1,P=s==null?0:s.length;for(this.__data__=new Hi;++p<P;)this.add(s[p])}function da(s){var p=this.__data__=new Ja(s);this.size=p.size}function qa(s,p){var P=gr(s),ae=!P&&aa(s),pe=!P&&!ae&&Io(s),Oe=!P&&!ae&&!pe&&Zl(s),Xe=P||ae||pe||Oe,it=Xe?bs(s.length,Yr):[],wt=it.length;for(var gt in s)!p&&!Wn.call(s,gt)||Xe&&(gt=="length"||pe&&(gt=="offset"||gt=="parent")||Oe&&(gt=="buffer"||gt=="byteLength"||gt=="byteOffset")||qo(gt,wt))||it.push(gt);return it}function El(s){var p=s.length;return p?s[Er(0,p-1)]:o}function ji(s,p,P){(P!==o&&!$a(s[p],P)||P===o&&!(p in s))&&ja(s,p,P)}function Cn(s,p,P){var ae=s[p];Wn.call(s,p)&&$a(ae,P)&&(P!==o||p in s)||ja(s,p,P)}function sc(s,p){for(var P=s.length;P--;)if($a(s[P][0],p))return P;return-1}function qs(s,p,P,ae){return Po(s,function(pe,Oe,Xe){p(ae,pe,P(pe),Xe)}),ae}function hu(s,p){return s&&Wo(p,Ji(p),s)}function ja(s,p,P){p=="__proto__"&&Da?Da(s,p,{configurable:!0,enumerable:!0,value:P,writable:!0}):s[p]=P}function as(s,p){for(var P=-1,ae=p.length,pe=rt(ae),Oe=s==null;++P<ae;)pe[P]=Oe?o:zu(s,p[P]);return pe}function uo(s,p,P){return s==s&&(P!==o&&(s=s<=P?s:P),p!==o&&(s=s>=p?s:p)),s}function Xa(s,p,P,ae,pe,Oe){var Xe,it=1&p,wt=2&p,gt=4&p;if(P&&(Xe=pe?P(s,ae,pe,Oe):P(s)),Xe!==o)return Xe;if(!gi(s))return s;var Nt=gr(s);if(Nt){if(Xe=function(Ut){var on=Ut.length,Nn=new Ut.constructor(on);return on&&typeof Ut[0]=="string"&&Wn.call(Ut,"index")&&(Nn.index=Ut.index,Nn.input=Ut.input),Nn}(s),!it)return Ka(s,Xe)}else{var Kt=Ra(s),Pn=Kt==G||Kt==C;if(Io(s))return Hh(s,it);if(Kt==u||Kt==T||Pn&&!pe){if(Xe=wt||Pn?{}:rd(s),!it)return wt?function(Ut,on){return Wo(Ut,Dh(Ut),on)}(s,function(Ut,on){return Ut&&Wo(on,fa(on),Ut)}(Xe,s)):function(Ut,on){return Wo(Ut,Sh(Ut),on)}(s,hu(Xe,s))}else{if(!Dr[Kt])return pe?s:{};Xe=function(Ut,on,Nn){var vn,pr=Ut.constructor;switch(on){case te:return vh(Ut);case Y:case k:return new pr(+Ut);case ne:return function(cr,Ar){var Vn=Ar?vh(cr.buffer):cr.buffer;return new cr.constructor(Vn,cr.byteOffset,cr.byteLength)}(Ut,Nn);case ue:case be:case je:case ve:case Be:case q:case ge:case oe:case le:return Wh(Ut,Nn);case B:return new pr;case R:case W:return new pr(Ut);case f:return function(cr){var Ar=new cr.constructor(cr.source,Xt.exec(cr));return Ar.lastIndex=cr.lastIndex,Ar}(Ut);case O:return new pr;case X:return vn=Ut,Mi?Pt(Mi.call(vn)):{}}}(s,Kt,it)}}Oe||(Oe=new da);var jn=Oe.get(s);if(jn)return jn;Oe.set(s,Xe),Yl(s)?s.forEach(function(Ut){Xe.add(Xa(Ut,p,P,Ut,s,Oe))}):kc(s)&&s.forEach(function(Ut,on){Xe.set(on,Xa(Ut,p,P,on,s,Oe))});var Qn=Nt?o:(gt?wt?nl:tl:wt?fa:Ji)(s);return Ei(Qn||s,function(Ut,on){Qn&&(Ut=s[on=Ut]),Cn(Xe,on,Xa(Ut,p,P,on,s,Oe))}),Xe}function du(s,p,P){var ae=P.length;if(s==null)return!ae;for(s=Pt(s);ae--;){var pe=P[ae],Oe=p[pe],Xe=s[pe];if(Xe===o&&!(pe in s)||!Oe(Xe))return!1}return!0}function pu(s,p,P){if(typeof s!="function")throw new zr(a);return Nl(function(){s.apply(o,P)},p)}function Cs(s,p,P,ae){var pe=-1,Oe=so,Xe=!0,it=s.length,wt=[],gt=p.length;if(!it)return wt;P&&(p=Wr(p,Re(P))),ae?(Oe=zs,Xe=!1):p.length>=200&&(Oe=ra,Xe=!1,p=new Mo(p));e:for(;++pe<it;){var Nt=s[pe],Kt=P==null?Nt:P(Nt);if(Nt=ae||Nt!==0?Nt:0,Xe&&Kt==Kt){for(var Pn=gt;Pn--;)if(p[Pn]===Kt)continue e;wt.push(Nt)}else Oe(p,Kt,ae)||wt.push(Nt)}return wt}we.templateSettings={escape:st,evaluate:mt,interpolate:Rt,variable:"",imports:{_:we}},we.prototype=an.prototype,we.prototype.constructor=we,Cr.prototype=_i(an.prototype),Cr.prototype.constructor=Cr,xr.prototype=_i(an.prototype),xr.prototype.constructor=xr,$i.prototype.clear=function(){this.__data__=gn?gn(null):{},this.size=0},$i.prototype.delete=function(s){var p=this.has(s)&&delete this.__data__[s];return this.size-=p?1:0,p},$i.prototype.get=function(s){var p=this.__data__;if(gn){var P=p[s];return P===v?o:P}return Wn.call(p,s)?p[s]:o},$i.prototype.has=function(s){var p=this.__data__;return gn?p[s]!==o:Wn.call(p,s)},$i.prototype.set=function(s,p){var P=this.__data__;return this.size+=this.has(s)?0:1,P[s]=gn&&p===o?v:p,this},Ja.prototype.clear=function(){this.__data__=[],this.size=0},Ja.prototype.delete=function(s){var p=this.__data__,P=sc(p,s);return!(P<0||(P==p.length-1?p.pop():Jn.call(p,P,1),--this.size,0))},Ja.prototype.get=function(s){var p=this.__data__,P=sc(p,s);return P<0?o:p[P][1]},Ja.prototype.has=function(s){return sc(this.__data__,s)>-1},Ja.prototype.set=function(s,p){var P=this.__data__,ae=sc(P,s);return ae<0?(++this.size,P.push([s,p])):P[ae][1]=p,this},Hi.prototype.clear=function(){this.size=0,this.__data__={hash:new $i,map:new(Qe||Ja),string:new $i}},Hi.prototype.delete=function(s){var p=Su(this,s).delete(s);return this.size-=p?1:0,p},Hi.prototype.get=function(s){return Su(this,s).get(s)},Hi.prototype.has=function(s){return Su(this,s).has(s)},Hi.prototype.set=function(s,p){var P=Su(this,s),ae=P.size;return P.set(s,p),this.size+=P.size==ae?0:1,this},Mo.prototype.add=Mo.prototype.push=function(s){return this.__data__.set(s,v),this},Mo.prototype.has=function(s){return this.__data__.has(s)},da.prototype.clear=function(){this.__data__=new Ja,this.size=0},da.prototype.delete=function(s){var p=this.__data__,P=p.delete(s);return this.size=p.size,P},da.prototype.get=function(s){return this.__data__.get(s)},da.prototype.has=function(s){return this.__data__.has(s)},da.prototype.set=function(s,p){var P=this.__data__;if(P instanceof Ja){var ae=P.__data__;if(!Qe||ae.length<199)return ae.push([s,p]),this.size=++P.size,this;P=this.__data__=new Hi(ae)}return P.set(s,p),this.size=P.size,this};var Po=Yh(Ro),lc=Yh(Pl,!0);function Al(s,p){var P=!0;return Po(s,function(ae,pe,Oe){return P=!!p(ae,pe,Oe)}),P}function os(s,p,P){for(var ae=-1,pe=s.length;++ae<pe;){var Oe=s[ae],Xe=p(Oe);if(Xe!=null&&(it===o?Xe==Xe&&!mo(Xe):P(Xe,it)))var it=Xe,wt=Oe}return wt}function Xs(s,p){var P=[];return Po(s,function(ae,pe,Oe){p(ae,pe,Oe)&&P.push(ae)}),P}function Wi(s,p,P,ae,pe){var Oe=-1,Xe=s.length;for(P||(P=Xd),pe||(pe=[]);++Oe<Xe;){var it=s[Oe];p>0&&P(it)?p>1?Wi(it,p-1,P,ae,pe):Ma(pe,it):ae||(pe[pe.length]=it)}return pe}var Ol=Zh(),Ti=Zh(!0);function Ro(s,p){return s&&Ol(s,p,Ji)}function Pl(s,p){return s&&Ti(s,p,Ji)}function fu(s,p){return Do(p,function(P){return fo(s[P])})}function Pa(s,p){for(var P=0,ae=(p=Es(p,s)).length;s!=null&&P<ae;)s=s[po(p[P++])];return P&&P==ae?s:o}function mu(s,p,P){var ae=p(s);return gr(s)?ae:Ma(ae,P(s))}function pa(s){return s==null?s===o?"[object Undefined]":"[object Null]":Pr&&Pr in Pt(s)?function(p){var P=Wn.call(p,Pr),ae=p[Pr];try{p[Pr]=o;var pe=!0}catch(Xe){}var Oe=ua.call(p);return pe&&(P?p[Pr]=ae:delete p[Pr]),Oe}(s):function(p){return ua.call(p)}(s)}function lr(s,p){return s>p}function sh(s,p){return s!=null&&Wn.call(s,p)}function cc(s,p){return s!=null&&p in Pt(s)}function Ss(s,p,P){for(var ae=P?zs:so,pe=s[0].length,Oe=s.length,Xe=Oe,it=rt(Oe),wt=1/0,gt=[];Xe--;){var Nt=s[Xe];Xe&&p&&(Nt=Wr(Nt,Re(p))),wt=Ii(Nt.length,wt),it[Xe]=!P&&(p||pe>=120&&Nt.length>=120)?new Mo(Xe&&Nt):o}Nt=s[0];var Kt=-1,Pn=it[0];e:for(;++Kt<pe&>.length<wt;){var jn=Nt[Kt],Qn=p?p(jn):jn;if(jn=P||jn!==0?jn:0,!(Pn?ra(Pn,Qn):ae(gt,Qn,P))){for(Xe=Oe;--Xe;){var Ut=it[Xe];if(!(Ut?ra(Ut,Qn):ae(s[Xe],Qn,P)))continue e}Pn&&Pn.push(Qn),gt.push(jn)}}return gt}function Qi(s,p,P){var ae=(s=Oh(s,p=Es(p,s)))==null?s:s[po(Ba(p))];return ae==null?o:hi(ae,s,P)}function lh(s){return yi(s)&&pa(s)==T}function uc(s,p,P,ae,pe){return s===p||(s==null||p==null||!yi(s)&&!yi(p)?s!=s&&p!=p:function(Oe,Xe,it,wt,gt,Nt){var Kt=gr(Oe),Pn=gr(Xe),jn=Kt?_:Ra(Oe),Qn=Pn?_:Ra(Xe),Ut=(jn=jn==T?u:jn)==u,on=(Qn=Qn==T?u:Qn)==u,Nn=jn==Qn;if(Nn&&Io(Oe)){if(!Io(Xe))return!1;Kt=!0,Ut=!1}if(Nn&&!Ut)return Nt||(Nt=new da),Kt||Zl(Oe)?Th(Oe,Xe,it,wt,gt,Nt):function(Vn,zn,ui,ii,Fi,Hr,ya){switch(ui){case ne:if(Vn.byteLength!=zn.byteLength||Vn.byteOffset!=zn.byteOffset)return!1;Vn=Vn.buffer,zn=zn.buffer;case te:return!(Vn.byteLength!=zn.byteLength||!Hr(new Zr(Vn),new Zr(zn)));case Y:case k:case R:return $a(+Vn,+zn);case S:return Vn.name==zn.name&&Vn.message==zn.message;case f:case W:return Vn==zn+"";case B:var va=Tl;case O:var xa=1ⅈif(va||(va=E),Vn.size!=zn.size&&!xa)return!1;var Qa=ya.get(Vn);if(Qa)return Qa==zn;ii|=2,ya.set(Vn,zn);var Ur=Th(va(Vn),va(zn),ii,Fi,Hr,ya);return ya.delete(Vn),Ur;case X:if(Mi)return Mi.call(Vn)==Mi.call(zn)}return!1}(Oe,Xe,jn,it,wt,gt,Nt);if(!(1&it)){var vn=Ut&&Wn.call(Oe,"__wrapped__"),pr=on&&Wn.call(Xe,"__wrapped__");if(vn||pr){var cr=vn?Oe.value():Oe,Ar=pr?Xe.value():Xe;return Nt||(Nt=new da),gt(cr,Ar,it,wt,Nt)}}return!!Nn&&(Nt||(Nt=new da),function(Vn,zn,ui,ii,Fi,Hr){var ya=1&ui,va=tl(Vn),xa=va.length;if(xa!=tl(zn).length&&!ya)return!1;for(var Qa=xa;Qa--;){var Ur=va[Qa];if(!(ya?Ur in zn:Wn.call(zn,Ur)))return!1}var qc=Hr.get(Vn),jo=Hr.get(zn);if(qc&&jo)return qc==zn&&jo==Vn;var vl=!0;Hr.set(Vn,zn),Hr.set(zn,Vn);for(var nc=ya;++Qa<xa;){var rc=Vn[Ur=va[Qa]],xl=zn[Ur];if(ii)var wl=ya?ii(xl,rc,Ur,zn,Vn,Hr):ii(rc,xl,Ur,Vn,zn,Hr);if(!(wl===o?rc===xl||Fi(rc,xl,ui,ii,Hr):wl)){vl=!1;break}nc||(nc=Ur=="constructor")}if(vl&&!nc){var bl=Vn.constructor,Ml=zn.constructor;bl==Ml||!("constructor"in Vn)||!("constructor"in zn)||typeof bl=="function"&&bl instanceof bl&&typeof Ml=="function"&&Ml instanceof Ml||(vl=!1)}return Hr.delete(Vn),Hr.delete(zn),vl}(Oe,Xe,it,wt,gt,Nt))}(s,p,P,ae,uc,pe))}function ch(s,p,P,ae){var pe=P.length,Oe=pe,Xe=!ae;if(s==null)return!Oe;for(s=Pt(s);pe--;){var it=P[pe];if(Xe&&it[2]?it[1]!==s[it[0]]:!(it[0]in s))return!1}for(;++pe<Oe;){var wt=(it=P[pe])[0],gt=s[wt],Nt=it[1];if(Xe&&it[2]){if(gt===o&&!(wt in s))return!1}else{var Kt=new da;if(ae)var Pn=ae(gt,Nt,wt,s,p,Kt);if(!(Pn===o?uc(Nt,gt,3,ae,Kt):Pn))return!1}}return!0}function Ya(s){return!(!gi(s)||(p=s,Uo&&Uo in p))&&(fo(s)?Ki:Yn).test(Yo(s));var p}function Lo(s){return typeof s=="function"?s:s==null?ma:typeof s=="object"?gr(s)?Ks(s[0],s[1]):Rl(s):ga(s)}function Ni(s){if(!Xo(s))return Sl(s);var p=[];for(var P in Pt(s))Wn.call(s,P)&&P!="constructor"&&p.push(P);return p}function Ys(s,p){return s<p}function Zs(s,p){var P=-1,ae=Ea(s)?rt(s.length):[];return Po(s,function(pe,Oe,Xe){ae[++P]=p(pe,Oe,Xe)}),ae}function Rl(s){var p=Ch(s);return p.length==1&&p[0][2]?ad(p[0][0],p[0][1]):function(P){return P===s||ch(P,s,p)}}function Ks(s,p){return Eh(s)&&rl(p)?ad(po(s),p):function(P){var ae=zu(P,s);return ae===o&&ae===p?hl(P,s):uc(p,ae,3)}}function $s(s,p,P,ae,pe){s!==p&&Ol(p,function(Oe,Xe){if(pe||(pe=new da),gi(Oe))(function(wt,gt,Nt,Kt,Pn,jn,Qn){var Ut=Ph(wt,Nt),on=Ph(gt,Nt),Nn=Qn.get(on);if(Nn)ji(wt,Nt,Nn);else{var vn=jn?jn(Ut,on,Nt+"",wt,gt,Qn):o,pr=vn===o;if(pr){var cr=gr(on),Ar=!cr&&Io(on),Vn=!cr&&!Ar&&Zl(on);vn=on,cr||Ar||Vn?gr(Ut)?vn=Ut:mi(Ut)?vn=Ka(Ut):Ar?(pr=!1,vn=Hh(on,!0)):Vn?(pr=!1,vn=Wh(on,!0)):vn=[]:Xl(on)||aa(on)?(vn=Ut,aa(Ut)?vn=Rs(Ut):gi(Ut)&&!fo(Ut)||(vn=rd(on))):pr=!1}pr&&(Qn.set(on,vn),Pn(vn,on,Kt,jn,Qn),Qn.delete(on)),ji(wt,Nt,vn)}})(s,p,Xe,P,$s,ae,pe);else{var it=ae?ae(Ph(s,Xe),Oe,Xe+"",s,p,pe):o;it===o&&(it=Oe),ji(s,Xe,it)}},fa)}function Qs(s,p){var P=s.length;if(P)return qo(p+=p<0?P:0,P)?s[p]:o}function wn(s,p,P){var ae=-1;return p=Wr(p=p.length?Wr(p,function(pe){return gr(pe)?function(Oe){return Pa(Oe,pe.length===1?pe[0]:pe)}:pe}):[ma],Re(nr())),function(pe,Oe){var Xe=pe.length;for(pe.sort(Oe);Xe--;)pe[Xe]=pe[Xe].value;return pe}(Zs(s,function(pe,Oe,Xe){return{criteria:Wr(p,function(it){return it(pe)}),index:++ae,value:pe}}),function(pe,Oe){return function(Xe,it,wt){for(var gt=-1,Nt=Xe.criteria,Kt=it.criteria,Pn=Nt.length,jn=wt.length;++gt<Pn;){var Qn=Jh(Nt[gt],Kt[gt]);if(Qn)return gt>=jn?Qn:Qn*(wt[gt]=="desc"?-1:1)}return Xe.index-it.index}(pe,Oe,P)})}function uh(s,p,P){for(var ae=-1,pe=p.length,Oe={};++ae<pe;){var Xe=p[ae],it=Pa(s,Xe);P(it,Xe)&&hc(Oe,Es(Xe,s),it)}return Oe}function Ll(s,p,P,ae){var pe=ae?zo:Ai,Oe=-1,Xe=p.length,it=s;for(s===p&&(p=Ka(p)),P&&(it=Wr(s,Re(P)));++Oe<Xe;)for(var wt=0,gt=p[Oe],Nt=P?P(gt):gt;(wt=pe(it,Nt,wt,ae))>-1;)it!==s&&Jn.call(it,wt,1),Jn.call(s,wt,1);return s}function el(s,p){for(var P=s?p.length:0,ae=P-1;P--;){var pe=p[P];if(P==ae||pe!==Oe){var Oe=pe;qo(pe)?Jn.call(s,pe,1):vu(s,pe)}}return s}function Er(s,p){return s+Ui(Dl()*(p-s+1))}function _o(s,p){var P="";if(!s||p<1||p>A)return P;do p%2&&(P+=s),(p=Ui(p/2))&&(s+=s);while(p);return P}function Lr(s,p){return fc(od(s,p,ma),s+"")}function hc(s,p,P,ae){if(!gi(s))return s;for(var pe=-1,Oe=(p=Es(p,s)).length,Xe=Oe-1,it=s;it!=null&&++pe<Oe;){var wt=po(p[pe]),gt=P;if(wt==="__proto__"||wt==="constructor"||wt==="prototype")return s;if(pe!=Xe){var Nt=it[wt];(gt=ae?ae(Nt,wt,it):o)===o&&(gt=gi(Nt)?Nt:qo(p[pe+1])?[]:{})}Cn(it,wt,gt),it=it[wt]}return s}var Ds=Rn?function(s,p){return Rn.set(s,p),s}:ma,gu=Da?function(s,p){return Da(s,"toString",{configurable:!0,enumerable:!1,value:js(p),writable:!0})}:ma;function Na(s,p,P){var ae=-1,pe=s.length;p<0&&(p=-p>pe?0:pe+p),(P=P>pe?pe:P)<0&&(P+=pe),pe=p>P?0:P-p>>>0,p>>>=0;for(var Oe=rt(pe);++ae<pe;)Oe[ae]=s[ae+p];return Oe}function zh(s,p){var P;return Po(s,function(ae,pe,Oe){return!(P=p(ae,pe,Oe))}),!!P}function yu(s,p,P){var ae=0,pe=s==null?ae:s.length;if(typeof p=="number"&&p==p&&pe<=2147483647){for(;ae<pe;){var Oe=ae+pe>>>1,Xe=s[Oe];Xe!==null&&!mo(Xe)&&(P?Xe<=p:Xe<p)?ae=Oe+1:pe=Oe}return pe}return hh(s,p,ma,P)}function hh(s,p,P,ae){var pe=0,Oe=s==null?0:s.length;if(Oe===0)return 0;for(var Xe=(p=P(p))!=p,it=p===null,wt=mo(p),gt=p===o;pe<Oe;){var Nt=Ui((pe+Oe)/2),Kt=P(s[Nt]),Pn=Kt!==o,jn=Kt===null,Qn=Kt==Kt,Ut=mo(Kt);if(Xe)var on=ae||Qn;else on=gt?Qn&&(ae||Pn):it?Qn&&Pn&&(ae||!jn):wt?Qn&&Pn&&!jn&&(ae||!Ut):!jn&&!Ut&&(ae?Kt<=p:Kt<p);on?pe=Nt+1:Oe=Nt}return Ii(Oe,4294967294)}function dh(s,p){for(var P=-1,ae=s.length,pe=0,Oe=[];++P<ae;){var Xe=s[P],it=p?p(Xe):Xe;if(!P||!$a(it,wt)){var wt=it;Oe[pe++]=Xe===0?0:Xe}}return Oe}function ph(s){return typeof s=="number"?s:mo(s)?M:+s}function Za(s){if(typeof s=="string")return s;if(gr(s))return Wr(s,Za)+"";if(mo(s))return pi?pi.call(s):"";var p=s+"";return p=="0"&&1/s==-1/0?"-0":p}function ss(s,p,P){var ae=-1,pe=so,Oe=s.length,Xe=!0,it=[],wt=it;if(P)Xe=!1,pe=zs;else if(Oe>=200){var gt=p?null:bh(s);if(gt)return E(gt);Xe=!1,pe=ra,wt=new Mo}else wt=p?[]:it;e:for(;++ae<Oe;){var Nt=s[ae],Kt=p?p(Nt):Nt;if(Nt=P||Nt!==0?Nt:0,Xe&&Kt==Kt){for(var Pn=wt.length;Pn--;)if(wt[Pn]===Kt)continue e;p&&wt.push(Kt),it.push(Nt)}else pe(wt,Kt,P)||(wt!==it&&wt.push(Kt),it.push(Nt))}return it}function vu(s,p){return(s=Oh(s,p=Es(p,s)))==null||delete s[po(Ba(p))]}function fh(s,p,P,ae){return hc(s,p,P(Pa(s,p)),ae)}function ls(s,p,P,ae){for(var pe=s.length,Oe=ae?pe:-1;(ae?Oe--:++Oe<pe)&&p(s[Oe],Oe,s););return P?Na(s,ae?0:Oe,ae?Oe+1:pe):Na(s,ae?Oe+1:0,ae?pe:Oe)}function ho(s,p){var P=s;return P instanceof xr&&(P=P.value()),ka(p,function(ae,pe){return pe.func.apply(pe.thisArg,Ma([ae],pe.args))},P)}function Va(s,p,P){var ae=s.length;if(ae<2)return ae?ss(s[0]):[];for(var pe=-1,Oe=rt(ae);++pe<ae;)for(var Xe=s[pe],it=-1;++it<ae;)it!=pe&&(Oe[pe]=Cs(Oe[pe]||Xe,s[it],p,P));return ss(Wi(Oe,1),p,P)}function mh(s,p,P){for(var ae=-1,pe=s.length,Oe=p.length,Xe={};++ae<pe;){var it=ae<Oe?p[ae]:o;P(Xe,s[ae],it)}return Xe}function gh(s){return mi(s)?s:[]}function yh(s){return typeof s=="function"?s:ma}function Es(s,p){return gr(s)?s:Eh(s,p)?[s]:Du($r(s))}var Jd=Lr;function As(s,p,P){var ae=s.length;return P=P===o?ae:P,!p&&P>=ae?s:Na(s,p,P)}var Uh=_s||function(s){return jr.clearTimeout(s)};function Hh(s,p){if(p)return s.slice();var P=s.length,ae=Kr?Kr(P):new s.constructor(P);return s.copy(ae),ae}function vh(s){var p=new s.constructor(s.byteLength);return new Zr(p).set(new Zr(s)),p}function Wh(s,p){var P=p?vh(s.buffer):s.buffer;return new s.constructor(P,s.byteOffset,s.length)}function Jh(s,p){if(s!==p){var P=s!==o,ae=s===null,pe=s==s,Oe=mo(s),Xe=p!==o,it=p===null,wt=p==p,gt=mo(p);if(!it&&!gt&&!Oe&&s>p||Oe&&Xe&&wt&&!it&&!gt||ae&&Xe&&wt||!P&&wt||!pe)return 1;if(!ae&&!Oe&&!gt&&s<p||gt&&P&&pe&&!ae&&!Oe||it&&P&&pe||!Xe&&pe||!wt)return-1}return 0}function qh(s,p,P,ae){for(var pe=-1,Oe=s.length,Xe=P.length,it=-1,wt=p.length,gt=di(Oe-Xe,0),Nt=rt(wt+gt),Kt=!ae;++it<wt;)Nt[it]=p[it];for(;++pe<Xe;)(Kt||pe<Oe)&&(Nt[P[pe]]=s[pe]);for(;gt--;)Nt[it++]=s[pe++];return Nt}function Xh(s,p,P,ae){for(var pe=-1,Oe=s.length,Xe=-1,it=P.length,wt=-1,gt=p.length,Nt=di(Oe-it,0),Kt=rt(Nt+gt),Pn=!ae;++pe<Nt;)Kt[pe]=s[pe];for(var jn=pe;++wt<gt;)Kt[jn+wt]=p[wt];for(;++Xe<it;)(Pn||pe<Oe)&&(Kt[jn+P[Xe]]=s[pe++]);return Kt}function Ka(s,p){var P=-1,ae=s.length;for(p||(p=rt(ae));++P<ae;)p[P]=s[P];return p}function Wo(s,p,P,ae){var pe=!P;P||(P={});for(var Oe=-1,Xe=p.length;++Oe<Xe;){var it=p[Oe],wt=ae?ae(P[it],s[it],it,P,s):o;wt===o&&(wt=s[it]),pe?ja(P,it,wt):Cn(P,it,wt)}return P}function xu(s,p){return function(P,ae){var pe=gr(P)?oo:qs,Oe=p?p():{};return pe(P,s,nr(ae,2),Oe)}}function Il(s){return Lr(function(p,P){var ae=-1,pe=P.length,Oe=pe>1?P[pe-1]:o,Xe=pe>2?P[2]:o;for(Oe=s.length>3&&typeof Oe=="function"?(pe--,Oe):o,Xe&&Fa(P[0],P[1],Xe)&&(Oe=pe<3?o:Oe,pe=1),p=Pt(p);++ae<pe;){var it=P[ae];it&&s(p,it,ae,Oe)}return p})}function Yh(s,p){return function(P,ae){if(P==null)return P;if(!Ea(P))return s(P,ae);for(var pe=P.length,Oe=p?pe:-1,Xe=Pt(P);(p?Oe--:++Oe<pe)&&ae(Xe[Oe],Oe,Xe)!==!1;);return P}}function Zh(s){return function(p,P,ae){for(var pe=-1,Oe=Pt(p),Xe=ae(p),it=Xe.length;it--;){var wt=Xe[s?it:++pe];if(P(Oe[wt],wt,Oe)===!1)break}return p}}function Kh(s){return function(p){var P=fr(p=$r(p))?re(p):o,ae=P?P[0]:p.charAt(0),pe=P?As(P,1).join(""):p.slice(1);return ae[s]()+pe}}function kl(s){return function(p){return ka(ks(pl(p).replace(gs,"")),s,"")}}function dc(s){return function(){var p=arguments;switch(p.length){case 0:return new s;case 1:return new s(p[0]);case 2:return new s(p[0],p[1]);case 3:return new s(p[0],p[1],p[2]);case 4:return new s(p[0],p[1],p[2],p[3]);case 5:return new s(p[0],p[1],p[2],p[3],p[4]);case 6:return new s(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new s(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var P=_i(s.prototype),ae=s.apply(P,p);return gi(ae)?ae:P}}function $h(s){return function(p,P,ae){var pe=Pt(p);if(!Ea(p)){var Oe=nr(P,3);p=Ji(p),P=function(it){return Oe(pe[it],it,pe)}}var Xe=s(p,P,ae);return Xe>-1?pe[Oe?p[Xe]:Xe]:o}}function Qh(s){return Jo(function(p){var P=p.length,ae=P,pe=Cr.prototype.thru;for(s&&p.reverse();ae--;){var Oe=p[ae];if(typeof Oe!="function")throw new zr(a);if(pe&&!Xe&&pc(Oe)=="wrapper")var Xe=new Cr([],!0)}for(ae=Xe?ae:P;++ae<P;){var it=pc(Oe=p[ae]),wt=it=="wrapper"?Cu(Oe):o;Xe=wt&&Ah(wt[0])&&wt[1]==424&&!wt[4].length&&wt[9]==1?Xe[pc(wt[0])].apply(Xe,wt[3]):Oe.length==1&&Ah(Oe)?Xe[it]():Xe.thru(Oe)}return function(){var gt=arguments,Nt=gt[0];if(Xe&>.length==1&&gr(Nt))return Xe.plant(Nt).value();for(var Kt=0,Pn=P?p[Kt].apply(this,gt):Nt;++Kt<P;)Pn=p[Kt].call(this,Pn);return Pn}})}function wu(s,p,P,ae,pe,Oe,Xe,it,wt,gt){var Nt=p&V,Kt=1&p,Pn=2&p,jn=24&p,Qn=512&p,Ut=Pn?o:dc(s);return function on(){for(var Nn=arguments.length,vn=rt(Nn),pr=Nn;pr--;)vn[pr]=arguments[pr];if(jn)var cr=jl(on),Ar=function(ii,Fi){for(var Hr=ii.length,ya=0;Hr--;)ii[Hr]===Fi&&++ya;return ya}(vn,cr);if(ae&&(vn=qh(vn,ae,pe,jn)),Oe&&(vn=Xh(vn,Oe,Xe,jn)),Nn-=Ar,jn&&Nn<gt){var Vn=y(vn,cr);return wh(s,p,wu,on.placeholder,P,vn,Vn,it,wt,gt-Nn)}var zn=Kt?P:this,ui=Pn?zn[s]:s;return Nn=vn.length,it?vn=function(ii,Fi){for(var Hr=ii.length,ya=Ii(Fi.length,Hr),va=Ka(ii);ya--;){var xa=Fi[ya];ii[ya]=qo(xa,Hr)?va[xa]:o}return ii}(vn,it):Qn&&Nn>1&&vn.reverse(),Nt&&wt<Nn&&(vn.length=wt),this&&this!==jr&&this instanceof on&&(ui=Ut||dc(ui)),ui.apply(zn,vn)}}function ed(s,p){return function(P,ae){return function(pe,Oe,Xe,it){return Ro(pe,function(wt,gt,Nt){Oe(it,Xe(wt),gt,Nt)}),it}(P,s,p(ae),{})}}function bu(s,p){return function(P,ae){var pe;if(P===o&&ae===o)return p;if(P!==o&&(pe=P),ae!==o){if(pe===o)return ae;typeof P=="string"||typeof ae=="string"?(P=Za(P),ae=Za(ae)):(P=ph(P),ae=ph(ae)),pe=s(P,ae)}return pe}}function xh(s){return Jo(function(p){return p=Wr(p,Re(nr())),Lr(function(P){var ae=this;return s(p,function(pe){return hi(pe,ae,P)})})})}function Mu(s,p){var P=(p=p===o?" ":Za(p)).length;if(P<2)return P?_o(p,s):p;var ae=_o(p,ha(s/K(p)));return fr(p)?As(re(ae),0,s).join(""):ae.slice(0,s)}function td(s){return function(p,P,ae){return ae&&typeof ae!="number"&&Fa(p,P,ae)&&(P=ae=o),p=ko(p),P===o?(P=p,p=0):P=ko(P),function(pe,Oe,Xe,it){for(var wt=-1,gt=di(ha((Oe-pe)/(Xe||1)),0),Nt=rt(gt);gt--;)Nt[it?gt:++wt]=pe,pe+=Xe;return Nt}(p,P,ae=ae===o?p<P?1:-1:ko(ae),s)}}function _u(s){return function(p,P){return typeof p=="string"&&typeof P=="string"||(p=oi(p),P=oi(P)),s(p,P)}}function wh(s,p,P,ae,pe,Oe,Xe,it,wt,gt){var Nt=8&p;p|=Nt?D:U,4&(p&=~(Nt?U:D))||(p&=-4);var Kt=[s,p,pe,Nt?Oe:o,Nt?Xe:o,Nt?o:Oe,Nt?o:Xe,it,wt,gt],Pn=P.apply(o,Kt);return Ah(s)&&sd(Pn,Kt),Pn.placeholder=ae,mc(Pn,s,p)}function Tu(s){var p=kn[s];return function(P,ae){if(P=oi(P),(ae=ae==null?0:Ii(Sr(ae),292))&&bo(P)){var pe=($r(P)+"e").split("e");return+((pe=($r(p(pe[0]+"e"+(+pe[1]+ae)))+"e").split("e"))[0]+"e"+(+pe[1]-ae))}return p(P)}}var bh=kt&&1/E(new kt([,-0]))[1]==g?function(s){return new kt(s)}:za;function Mh(s){return function(p){var P=Ra(p);return P==B?Tl(p):P==O?function(ae){var pe=-1,Oe=Array(ae.size);return ae.forEach(function(Xe){Oe[++pe]=[Xe,Xe]}),Oe}(p):function(ae,pe){return Wr(pe,function(Oe){return[Oe,ae[Oe]]})}(p,s(p))}}function cs(s,p,P,ae,pe,Oe,Xe,it){var wt=2&p;if(!wt&&typeof s!="function")throw new zr(a);var gt=ae?ae.length:0;if(gt||(p&=-97,ae=pe=o),Xe=Xe===o?Xe:di(Sr(Xe),0),it=it===o?it:Sr(it),gt-=pe?pe.length:0,p&U){var Nt=ae,Kt=pe;ae=pe=o}var Pn=wt?o:Cu(s),jn=[s,p,P,ae,pe,Nt,Kt,Oe,Xe,it];if(Pn&&function(Ut,on){var Nn=Ut[1],vn=on[1],pr=Nn|vn,cr=pr<131,Ar=vn==V&&Nn==8||vn==V&&Nn==I&&Ut[7].length<=on[8]||vn==384&&on[7].length<=on[8]&&Nn==8;if(!cr&&!Ar)return Ut;1&vn&&(Ut[2]=on[2],pr|=1&Nn?0:4);var Vn=on[3];if(Vn){var zn=Ut[3];Ut[3]=zn?qh(zn,Vn,on[4]):Vn,Ut[4]=zn?y(Ut[3],h):on[4]}(Vn=on[5])&&(zn=Ut[5],Ut[5]=zn?Xh(zn,Vn,on[6]):Vn,Ut[6]=zn?y(Ut[5],h):on[6]),(Vn=on[7])&&(Ut[7]=Vn),vn&V&&(Ut[8]=Ut[8]==null?on[8]:Ii(Ut[8],on[8])),Ut[9]==null&&(Ut[9]=on[9]),Ut[0]=on[0],Ut[1]=pr}(jn,Pn),s=jn[0],p=jn[1],P=jn[2],ae=jn[3],pe=jn[4],!(it=jn[9]=jn[9]===o?wt?0:s.length:di(jn[9]-gt,0))&&24&p&&(p&=-25),p&&p!=1)Qn=p==8||p==b?function(Ut,on,Nn){var vn=dc(Ut);return function pr(){for(var cr=arguments.length,Ar=rt(cr),Vn=cr,zn=jl(pr);Vn--;)Ar[Vn]=arguments[Vn];var ui=cr<3&&Ar[0]!==zn&&Ar[cr-1]!==zn?[]:y(Ar,zn);return(cr-=ui.length)<Nn?wh(Ut,on,wu,pr.placeholder,o,Ar,ui,o,o,Nn-cr):hi(this&&this!==jr&&this instanceof pr?vn:Ut,this,Ar)}}(s,p,it):p!=D&&p!=33||pe.length?wu.apply(o,jn):function(Ut,on,Nn,vn){var pr=1&on,cr=dc(Ut);return function Ar(){for(var Vn=-1,zn=arguments.length,ui=-1,ii=vn.length,Fi=rt(ii+zn),Hr=this&&this!==jr&&this instanceof Ar?cr:Ut;++ui<ii;)Fi[ui]=vn[ui];for(;zn--;)Fi[ui++]=arguments[++Vn];return hi(Hr,pr?Nn:this,Fi)}}(s,p,P,ae);else var Qn=function(Ut,on,Nn){var vn=1&on,pr=dc(Ut);return function cr(){return(this&&this!==jr&&this instanceof cr?pr:Ut).apply(vn?Nn:this,arguments)}}(s,p,P);return mc((Pn?Ds:sd)(Qn,jn),s,p)}function us(s,p,P,ae){return s===o||$a(s,dr[P])&&!Wn.call(ae,P)?p:s}function _h(s,p,P,ae,pe,Oe){return gi(s)&&gi(p)&&(Oe.set(p,s),$s(s,p,o,_h,Oe),Oe.delete(p)),s}function qd(s){return Xl(s)?o:s}function Th(s,p,P,ae,pe,Oe){var Xe=1&P,it=s.length,wt=p.length;if(it!=wt&&!(Xe&&wt>it))return!1;var gt=Oe.get(s),Nt=Oe.get(p);if(gt&&Nt)return gt==p&&Nt==s;var Kt=-1,Pn=!0,jn=2&P?new Mo:o;for(Oe.set(s,p),Oe.set(p,s);++Kt<it;){var Qn=s[Kt],Ut=p[Kt];if(ae)var on=Xe?ae(Ut,Qn,Kt,p,s,Oe):ae(Qn,Ut,Kt,s,p,Oe);if(on!==o){if(on)continue;Pn=!1;break}if(jn){if(!Go(p,function(Nn,vn){if(!ra(jn,vn)&&(Qn===Nn||pe(Qn,Nn,P,ae,Oe)))return jn.push(vn)})){Pn=!1;break}}else if(Qn!==Ut&&!pe(Qn,Ut,P,ae,Oe)){Pn=!1;break}}return Oe.delete(s),Oe.delete(p),Pn}function Jo(s){return fc(od(s,o,sl),s+"")}function tl(s){return mu(s,Ji,Sh)}function nl(s){return mu(s,fa,Dh)}var Cu=Rn?function(s){return Rn.get(s)}:za;function pc(s){for(var p=s.name+"",P=It[p],ae=Wn.call(It,p)?P.length:0;ae--;){var pe=P[ae],Oe=pe.func;if(Oe==null||Oe==s)return pe.name}return p}function jl(s){return(Wn.call(we,"placeholder")?we:s).placeholder}function nr(){var s=we.iteratee||ml;return s=s===ml?Lo:s,arguments.length?s(arguments[0],arguments[1]):s}function Su(s,p){var P,ae,pe=s.__data__;return((ae=typeof(P=p))=="string"||ae=="number"||ae=="symbol"||ae=="boolean"?P!=="__proto__":P===null)?pe[typeof p=="string"?"string":"hash"]:pe.map}function Ch(s){for(var p=Ji(s),P=p.length;P--;){var ae=p[P],pe=s[ae];p[P]=[ae,pe,rl(pe)]}return p}function Os(s,p){var P=function(ae,pe){return ae==null?o:ae[pe]}(s,p);return Ya(P)?P:o}var Sh=Ts?function(s){return s==null?[]:(s=Pt(s),Do(Ts(s),function(p){return bi.call(s,p)}))}:Ns,Dh=Ts?function(s){for(var p=[];s;)Ma(p,Sh(s)),s=Li(s);return p}:Ns,Ra=pa;function nd(s,p,P){for(var ae=-1,pe=(p=Es(p,s)).length,Oe=!1;++ae<pe;){var Xe=po(p[ae]);if(!(Oe=s!=null&&P(s,Xe)))break;s=s[Xe]}return Oe||++ae!=pe?Oe:!!(pe=s==null?0:s.length)&&Ps(pe)&&qo(Xe,pe)&&(gr(s)||aa(s))}function rd(s){return typeof s.constructor!="function"||Xo(s)?{}:_i(Li(s))}function Xd(s){return gr(s)||aa(s)||!!(li&&s&&s[li])}function qo(s,p){var P=typeof s;return!!(p=p==null?A:p)&&(P=="number"||P!="symbol"&&Br.test(s))&&s>-1&&s%1==0&&s<p}function Fa(s,p,P){if(!gi(P))return!1;var ae=typeof p;return!!(ae=="number"?Ea(P)&&qo(p,P.length):ae=="string"&&p in P)&&$a(P[p],s)}function Eh(s,p){if(gr(s))return!1;var P=typeof s;return!(P!="number"&&P!="symbol"&&P!="boolean"&&s!=null&&!mo(s))||He.test(s)||!Ot.test(s)||p!=null&&s in Pt(p)}function Ah(s){var p=pc(s),P=we[p];if(typeof P!="function"||!(p in xr.prototype))return!1;if(s===P)return!0;var ae=Cu(P);return!!ae&&s===ae[0]}(ot&&Ra(new ot(new ArrayBuffer(1)))!=ne||Qe&&Ra(new Qe)!=B||Ct&&Ra(Ct.resolve())!=c||kt&&Ra(new kt)!=O||mn&&Ra(new mn)!=J)&&(Ra=function(s){var p=pa(s),P=p==u?s.constructor:o,ae=P?Yo(P):"";if(ae)switch(ae){case _r:return ne;case Tn:return B;case Qt:return c;case Rr:return O;case tr:return J}return p});var id=Ca?fo:ec;function Xo(s){var p=s&&s.constructor;return s===(typeof p=="function"&&p.prototype||dr)}function rl(s){return s==s&&!gi(s)}function ad(s,p){return function(P){return P!=null&&P[s]===p&&(p!==o||s in Pt(P))}}function od(s,p,P){return p=di(p===o?s.length-1:p,0),function(){for(var ae=arguments,pe=-1,Oe=di(ae.length-p,0),Xe=rt(Oe);++pe<Oe;)Xe[pe]=ae[p+pe];pe=-1;for(var it=rt(p+1);++pe<p;)it[pe]=ae[pe];return it[p]=P(Xe),hi(s,this,it)}}function Oh(s,p){return p.length<2?s:Pa(s,Na(p,0,-1))}function Ph(s,p){if((p!=="constructor"||typeof s[p]!="function")&&p!="__proto__")return s[p]}var sd=il(Ds),Nl=ia||function(s,p){return jr.setTimeout(s,p)},fc=il(gu);function mc(s,p,P){var ae=p+"";return fc(s,function(pe,Oe){var Xe=Oe.length;if(!Xe)return pe;var it=Xe-1;return Oe[it]=(Xe>1?"& ":"")+Oe[it],Oe=Oe.join(Xe>2?", ":" "),pe.replace(yt,`{
|
|
/* [wrapped with `+Oe+`] */
|
|
`)}(ae,function(pe,Oe){return Ei(F,function(Xe){var it="_."+Xe[0];Oe&Xe[1]&&!so(pe,it)&&pe.push(it)}),pe.sort()}(function(pe){var Oe=ae.match(Ue);return Oe?Oe[1].split(Zt):[]}(),P)))}function il(s){var p=0,P=0;return function(){var ae=Js(),pe=16-(ae-P);if(P=ae,pe>0){if(++p>=800)return arguments[0]}else p=0;return s.apply(o,arguments)}}function gc(s,p){var P=-1,ae=s.length,pe=ae-1;for(p=p===o?ae:p;++P<p;){var Oe=Er(P,pe),Xe=s[Oe];s[Oe]=s[P],s[P]=Xe}return s.length=p,s}var Du=function(s){var p=Hl(function(ae){var pe=[];return ae.charCodeAt(0)===46&&pe.push(""),ae.replace(Vt,function(Oe,Xe,it,wt){pe.push(it?wt.replace(dt,"$1"):Xe||Oe)}),pe},function(ae){return P.size===500&&P.clear(),ae}),P=p.cache;return p}();function po(s){if(typeof s=="string"||mo(s))return s;var p=s+"";return p=="0"&&1/s==-1/0?"-0":p}function Yo(s){if(s!=null){try{return vr.call(s)}catch(p){}try{return s+""}catch(p){}}return""}function Zo(s){if(s instanceof xr)return s.clone();var p=new Cr(s.__wrapped__,s.__chain__);return p.__actions__=Ka(s.__actions__),p.__index__=s.__index__,p.__values__=s.__values__,p}var Vl=Lr(function(s,p){return mi(s)?Cs(s,Wi(p,1,mi,!0)):[]}),al=Lr(function(s,p){var P=Ba(p);return mi(P)&&(P=o),mi(s)?Cs(s,Wi(p,1,mi,!0),nr(P,2)):[]}),yc=Lr(function(s,p){var P=Ba(p);return mi(P)&&(P=o),mi(s)?Cs(s,Wi(p,1,mi,!0),o,P):[]});function ol(s,p,P){var ae=s==null?0:s.length;if(!ae)return-1;var pe=P==null?0:Sr(P);return pe<0&&(pe=di(ae+pe,0)),zt(s,nr(p,3),pe)}function Fl(s,p,P){var ae=s==null?0:s.length;if(!ae)return-1;var pe=ae-1;return P!==o&&(pe=Sr(P),pe=P<0?di(ae+pe,0):Ii(pe,ae-1)),zt(s,nr(p,3),pe,!0)}function sl(s){return s!=null&&s.length?Wi(s,1):[]}function ll(s){return s&&s.length?s[0]:o}var Bl=Lr(function(s){var p=Wr(s,gh);return p.length&&p[0]===s[0]?Ss(p):[]}),vc=Lr(function(s){var p=Ba(s),P=Wr(s,gh);return p===Ba(P)?p=o:P.pop(),P.length&&P[0]===s[0]?Ss(P,nr(p,2)):[]}),ld=Lr(function(s){var p=Ba(s),P=Wr(s,gh);return(p=typeof p=="function"?p:o)&&P.pop(),P.length&&P[0]===s[0]?Ss(P,o,p):[]});function Ba(s){var p=s==null?0:s.length;return p?s[p-1]:o}var xc=Lr(wc);function wc(s,p){return s&&s.length&&p&&p.length?Ll(s,p):s}var cd=Jo(function(s,p){var P=s==null?0:s.length,ae=as(s,p);return el(s,Wr(p,function(pe){return qo(pe,P)?+pe:pe}).sort(Jh)),ae});function bc(s){return s==null?s:ke.call(s)}var ud=Lr(function(s){return ss(Wi(s,1,mi,!0))}),Mc=Lr(function(s){var p=Ba(s);return mi(p)&&(p=o),ss(Wi(s,1,mi,!0),nr(p,2))}),Eu=Lr(function(s){var p=Ba(s);return p=typeof p=="function"?p:o,ss(Wi(s,1,mi,!0),o,p)});function Gl(s){if(!s||!s.length)return[];var p=0;return s=Do(s,function(P){if(mi(P))return p=di(P.length,p),!0}),bs(p,function(P){return Wr(s,Jr(P))})}function Rh(s,p){if(!s||!s.length)return[];var P=Gl(s);return p==null?P:Wr(P,function(ae){return hi(p,o,ae)})}var _c=Lr(function(s,p){return mi(s)?Cs(s,p):[]}),Tc=Lr(function(s){return Va(Do(s,mi))}),hd=Lr(function(s){var p=Ba(s);return mi(p)&&(p=o),Va(Do(s,mi),nr(p,2))}),Yd=Lr(function(s){var p=Ba(s);return p=typeof p=="function"?p:o,Va(Do(s,mi),o,p)}),Au=Lr(Gl),Lh=Lr(function(s){var p=s.length,P=p>1?s[p-1]:o;return Rh(s,P=typeof P=="function"?(s.pop(),P):o)});function Ih(s){var p=we(s);return p.__chain__=!0,p}function Cc(s,p){return p(s)}var zl=Jo(function(s){var p=s.length,P=p?s[0]:0,ae=this.__wrapped__,pe=function(Oe){return as(Oe,s)};return!(p>1||this.__actions__.length)&&ae instanceof xr&&qo(P)?((ae=ae.slice(P,+P+(p?1:0))).__actions__.push({func:Cc,args:[pe],thisArg:o}),new Cr(ae,this.__chain__).thru(function(Oe){return p&&!Oe.length&&Oe.push(o),Oe})):this.thru(pe)}),Sc=xu(function(s,p,P){Wn.call(s,P)?++s[P]:ja(s,P,1)}),Ou=$h(ol),Vi=$h(Fl);function kh(s,p){return(gr(s)?Ei:Po)(s,nr(p,3))}function jh(s,p){return(gr(s)?function(P,ae){for(var pe=P==null?0:P.length;pe--&&ae(P[pe],pe,P)!==!1;);return P}:lc)(s,nr(p,3))}var dd=xu(function(s,p,P){Wn.call(s,P)?s[P].push(p):ja(s,P,[p])}),Pu=Lr(function(s,p,P){var ae=-1,pe=typeof p=="function",Oe=Ea(s)?rt(s.length):[];return Po(s,function(Xe){Oe[++ae]=pe?hi(p,Xe,P):Qi(Xe,p,P)}),Oe}),Ru=xu(function(s,p,P){ja(s,P,p)});function La(s,p){return(gr(s)?Wr:Zs)(s,nr(p,3))}var Lu=xu(function(s,p,P){s[P?0:1].push(p)},function(){return[[],[]]}),Iu=Lr(function(s,p){if(s==null)return[];var P=p.length;return P>1&&Fa(s,p[0],p[1])?p=[]:P>2&&Fa(p[0],p[1],p[2])&&(p=[p[0]]),wn(s,Wi(p,1),[])}),fi=Cl||function(){return jr.Date.now()};function Dc(s,p,P){return p=P?o:p,p=s&&p==null?s.length:p,cs(s,V,o,o,o,o,p)}function Ko(s,p){var P;if(typeof p!="function")throw new zr(a);return s=Sr(s),function(){return--s>0&&(P=p.apply(this,arguments)),s<=1&&(p=o),P}}var ku=Lr(function(s,p,P){var ae=1;if(P.length){var pe=y(P,jl(ku));ae|=D}return cs(s,ae,p,P,pe)}),ju=Lr(function(s,p,P){var ae=3;if(P.length){var pe=y(P,jl(ju));ae|=D}return cs(p,ae,s,P,pe)});function Ec(s,p,P){var ae,pe,Oe,Xe,it,wt,gt=0,Nt=!1,Kt=!1,Pn=!0;if(typeof s!="function")throw new zr(a);function jn(vn){var pr=ae,cr=pe;return ae=pe=o,gt=vn,Xe=s.apply(cr,pr)}function Qn(vn){var pr=vn-wt;return wt===o||pr>=p||pr<0||Kt&&vn-gt>=Oe}function Ut(){var vn=fi();if(Qn(vn))return on(vn);it=Nl(Ut,function(pr){var cr=p-(pr-wt);return Kt?Ii(cr,Oe-(pr-gt)):cr}(vn))}function on(vn){return it=o,Pn&&ae?jn(vn):(ae=pe=o,Xe)}function Nn(){var vn=fi(),pr=Qn(vn);if(ae=arguments,pe=this,wt=vn,pr){if(it===o)return function(cr){return gt=cr,it=Nl(Ut,p),Nt?jn(cr):Xe}(wt);if(Kt)return Uh(it),it=Nl(Ut,p),jn(wt)}return it===o&&(it=Nl(Ut,p)),Xe}return p=oi(p)||0,gi(P)&&(Nt=!!P.leading,Oe=(Kt="maxWait"in P)?di(oi(P.maxWait)||0,p):Oe,Pn="trailing"in P?!!P.trailing:Pn),Nn.cancel=function(){it!==o&&Uh(it),gt=0,ae=wt=pe=it=o},Nn.flush=function(){return it===o?Xe:on(fi())},Nn}var Nu=Lr(function(s,p){return pu(s,1,p)}),Ul=Lr(function(s,p,P){return pu(s,oi(p)||0,P)});function Hl(s,p){if(typeof s!="function"||p!=null&&typeof p!="function")throw new zr(a);var P=function(){var ae=arguments,pe=p?p.apply(this,ae):ae[0],Oe=P.cache;if(Oe.has(pe))return Oe.get(pe);var Xe=s.apply(this,ae);return P.cache=Oe.set(pe,Xe)||Oe,Xe};return P.cache=new(Hl.Cache||Hi),P}function Wl(s){if(typeof s!="function")throw new zr(a);return function(){var p=arguments;switch(p.length){case 0:return!s.call(this);case 1:return!s.call(this,p[0]);case 2:return!s.call(this,p[0],p[1]);case 3:return!s.call(this,p[0],p[1],p[2])}return!s.apply(this,p)}}Hl.Cache=Hi;var Vu=Jd(function(s,p){var P=(p=p.length==1&&gr(p[0])?Wr(p[0],Re(nr())):Wr(Wi(p,1),Re(nr()))).length;return Lr(function(ae){for(var pe=-1,Oe=Ii(ae.length,P);++pe<Oe;)ae[pe]=p[pe].call(this,ae[pe]);return hi(s,this,ae)})}),Ac=Lr(function(s,p){var P=y(p,jl(Ac));return cs(s,D,o,p,P)}),Fu=Lr(function(s,p){var P=y(p,jl(Fu));return cs(s,U,o,p,P)}),Oc=Jo(function(s,p){return cs(s,I,o,o,o,p)});function $a(s,p){return s===p||s!=s&&p!=p}var Pc=_u(lr),Bu=_u(function(s,p){return s>=p}),aa=lh(function(){return arguments}())?lh:function(s){return yi(s)&&Wn.call(s,"callee")&&!bi.call(s,"callee")},gr=rt.isArray,Rc=vt?Re(vt):function(s){return yi(s)&&pa(s)==te};function Ea(s){return s!=null&&Ps(s.length)&&!fo(s)}function mi(s){return yi(s)&&Ea(s)}var Io=Wa||ec,Lc=Ft?Re(Ft):function(s){return yi(s)&&pa(s)==k};function Jl(s){if(!yi(s))return!1;var p=pa(s);return p==S||p=="[object DOMException]"||typeof s.message=="string"&&typeof s.name=="string"&&!Xl(s)}function fo(s){if(!gi(s))return!1;var p=pa(s);return p==G||p==C||p=="[object AsyncFunction]"||p=="[object Proxy]"}function Ic(s){return typeof s=="number"&&s==Sr(s)}function Ps(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=A}function gi(s){var p=typeof s;return s!=null&&(p=="object"||p=="function")}function yi(s){return s!=null&&typeof s=="object"}var kc=Jt?Re(Jt):function(s){return yi(s)&&Ra(s)==B};function ql(s){return typeof s=="number"||yi(s)&&pa(s)==R}function Xl(s){if(!yi(s)||pa(s)!=u)return!1;var p=Li(s);if(p===null)return!0;var P=Wn.call(p,"constructor")&&p.constructor;return typeof P=="function"&&P instanceof P&&vr.call(P)==Ho}var cl=In?Re(In):function(s){return yi(s)&&pa(s)==f},Yl=Gn?Re(Gn):function(s){return yi(s)&&Ra(s)==O};function Gu(s){return typeof s=="string"||!gr(s)&&yi(s)&&pa(s)==W}function mo(s){return typeof s=="symbol"||yi(s)&&pa(s)==X}var Zl=sr?Re(sr):function(s){return yi(s)&&Ps(s.length)&&!!qr[pa(s)]},Zd=_u(Ys),Kd=_u(function(s,p){return s<=p});function pd(s){if(!s)return[];if(Ea(s))return Gu(s)?re(s):Ka(s);if(ri&&s[ri])return function(P){for(var ae,pe=[];!(ae=P.next()).done;)pe.push(ae.value);return pe}(s[ri]());var p=Ra(s);return(p==B?Tl:p==O?E:$o)(s)}function ko(s){return s?(s=oi(s))===g||s===-1/0?17976931348623157e292*(s<0?-1:1):s==s?s:0:s===0?s:0}function Sr(s){var p=ko(s),P=p%1;return p==p?P?p-P:p:0}function ul(s){return s?uo(Sr(s),0,N):0}function oi(s){if(typeof s=="number")return s;if(mo(s))return M;if(gi(s)){var p=typeof s.valueOf=="function"?s.valueOf():s;s=gi(p)?p+"":p}if(typeof s!="string")return s===0?s:+s;s=Hs(s);var P=$t.test(s);return P||kr.test(s)?is(s.slice(2),P?2:8):xn.test(s)?M:+s}function Rs(s){return Wo(s,fa(s))}function $r(s){return s==null?"":Za(s)}var jc=Il(function(s,p){if(Xo(p)||Ea(p))Wo(p,Ji(p),s);else for(var P in p)Wn.call(p,P)&&Cn(s,P,p[P])}),Nh=Il(function(s,p){Wo(p,fa(p),s)}),Nc=Il(function(s,p,P,ae){Wo(p,fa(p),s,ae)}),Vc=Il(function(s,p,P,ae){Wo(p,Ji(p),s,ae)}),Vh=Jo(as),hs=Lr(function(s,p){s=Pt(s);var P=-1,ae=p.length,pe=ae>2?p[2]:o;for(pe&&Fa(p[0],p[1],pe)&&(ae=1);++P<ae;)for(var Oe=p[P],Xe=fa(Oe),it=-1,wt=Xe.length;++it<wt;){var gt=Xe[it],Nt=s[gt];(Nt===o||$a(Nt,dr[gt])&&!Wn.call(s,gt))&&(s[gt]=Oe[gt])}return s}),fd=Lr(function(s){return s.push(o,_h),hi(dl,o,s)});function zu(s,p,P){var ae=s==null?o:Pa(s,p);return ae===o?P:ae}function hl(s,p){return s!=null&&nd(s,p,cc)}var Ls=ed(function(s,p,P){p!=null&&typeof p.toString!="function"&&(p=ua.call(p)),s[p]=P},js(ma)),$d=ed(function(s,p,P){p!=null&&typeof p.toString!="function"&&(p=ua.call(p)),Wn.call(s,p)?s[p].push(P):s[p]=[P]},nr),md=Lr(Qi);function Ji(s){return Ea(s)?qa(s):Ni(s)}function fa(s){return Ea(s)?qa(s,!0):function(p){if(!gi(p))return function(Oe){var Xe=[];if(Oe!=null)for(var it in Pt(Oe))Xe.push(it);return Xe}(p);var P=Xo(p),ae=[];for(var pe in p)(pe!="constructor"||!P&&Wn.call(p,pe))&&ae.push(pe);return ae}(s)}var Uu=Il(function(s,p,P){$s(s,p,P)}),dl=Il(function(s,p,P,ae){$s(s,p,P,ae)}),Hu=Jo(function(s,p){var P={};if(s==null)return P;var ae=!1;p=Wr(p,function(Oe){return Oe=Es(Oe,s),ae||(ae=Oe.length>1),Oe}),Wo(s,nl(s),P),ae&&(P=Xa(P,7,qd));for(var pe=p.length;pe--;)vu(P,p[pe]);return P}),Fc=Jo(function(s,p){return s==null?{}:function(P,ae){return uh(P,ae,function(pe,Oe){return hl(P,Oe)})}(s,p)});function Bc(s,p){if(s==null)return{};var P=Wr(nl(s),function(ae){return[ae]});return p=nr(p),uh(s,P,function(ae,pe){return p(ae,pe[0])})}var Kl=Mh(Ji),$l=Mh(fa);function $o(s){return s==null?[]:Eo(s,Ji(s))}var gd=kl(function(s,p,P){return p=p.toLowerCase(),s+(P?Ql(p):p)});function Ql(s){return fl($r(s).toLowerCase())}function pl(s){return(s=$r(s))&&s.replace($e,Ao).replace(Gs,"")}var Is=kl(function(s,p,P){return s+(P?"-":"")+p.toLowerCase()}),Wu=kl(function(s,p,P){return s+(P?" ":"")+p.toLowerCase()}),Ju=Kh("toLowerCase"),qu=kl(function(s,p,P){return s+(P?"_":"")+p.toLowerCase()}),Gc=kl(function(s,p,P){return s+(P?" ":"")+fl(p)}),Ga=kl(function(s,p,P){return s+(P?" ":"")+p.toUpperCase()}),fl=Kh("toUpperCase");function ks(s,p,P){return s=$r(s),(p=P?o:p)===o?function(ae){return vs.test(ae)}(s)?function(ae){return ae.match(ys)||[]}(s):function(ae){return ae.match(On)||[]}(s):s.match(p)||[]}var ds=Lr(function(s,p){try{return hi(s,o,p)}catch(P){return Jl(P)?P:new ct(P)}}),zc=Jo(function(s,p){return Ei(p,function(P){P=po(P),ja(s,P,ku(s[P],s))}),s});function js(s){return function(){return s}}var Uc=Qh(),Hc=Qh(!0);function ma(s){return s}function ml(s){return Lo(typeof s=="function"?s:Xa(s,1))}var Wc=Lr(function(s,p){return function(P){return Qi(P,s,p)}}),Qd=Lr(function(s,p){return function(P){return Qi(s,P,p)}});function Oi(s,p,P){var ae=Ji(p),pe=fu(p,ae);P!=null||gi(p)&&(pe.length||!ae.length)||(P=p,p=s,s=this,pe=fu(p,Ji(p)));var Oe=!(gi(P)&&"chain"in P&&!P.chain),Xe=fo(s);return Ei(pe,function(it){var wt=p[it];s[it]=wt,Xe&&(s.prototype[it]=function(){var gt=this.__chain__;if(Oe||gt){var Nt=s(this.__wrapped__);return(Nt.__actions__=Ka(this.__actions__)).push({func:wt,args:arguments,thisArg:s}),Nt.__chain__=gt,Nt}return wt.apply(s,Ma([this.value()],arguments))})}),s}function za(){}var Xu=xh(Wr),Jc=xh(wo),Yu=xh(Go);function ga(s){return Eh(s)?Jr(po(s)):function(p){return function(P){return Pa(P,p)}}(s)}var Zu=td(),Ku=td(!0);function Ns(){return[]}function ec(){return!1}var gl,$u=bu(function(s,p){return s+p},0),tc=Tu("ceil"),To=bu(function(s,p){return s/p},1),ep=Tu("floor"),yl=bu(function(s,p){return s*p},1),Fh=Tu("round"),yd=bu(function(s,p){return s-p},0);return we.after=function(s,p){if(typeof p!="function")throw new zr(a);return s=Sr(s),function(){if(--s<1)return p.apply(this,arguments)}},we.ary=Dc,we.assign=jc,we.assignIn=Nh,we.assignInWith=Nc,we.assignWith=Vc,we.at=Vh,we.before=Ko,we.bind=ku,we.bindAll=zc,we.bindKey=ju,we.castArray=function(){if(!arguments.length)return[];var s=arguments[0];return gr(s)?s:[s]},we.chain=Ih,we.chunk=function(s,p,P){p=(P?Fa(s,p,P):p===o)?1:di(Sr(p),0);var ae=s==null?0:s.length;if(!ae||p<1)return[];for(var pe=0,Oe=0,Xe=rt(ha(ae/p));pe<ae;)Xe[Oe++]=Na(s,pe,pe+=p);return Xe},we.compact=function(s){for(var p=-1,P=s==null?0:s.length,ae=0,pe=[];++p<P;){var Oe=s[p];Oe&&(pe[ae++]=Oe)}return pe},we.concat=function(){var s=arguments.length;if(!s)return[];for(var p=rt(s-1),P=arguments[0],ae=s;ae--;)p[ae-1]=arguments[ae];return Ma(gr(P)?Ka(P):[P],Wi(p,1))},we.cond=function(s){var p=s==null?0:s.length,P=nr();return s=p?Wr(s,function(ae){if(typeof ae[1]!="function")throw new zr(a);return[P(ae[0]),ae[1]]}):[],Lr(function(ae){for(var pe=-1;++pe<p;){var Oe=s[pe];if(hi(Oe[0],this,ae))return hi(Oe[1],this,ae)}})},we.conforms=function(s){return function(p){var P=Ji(p);return function(ae){return du(ae,p,P)}}(Xa(s,1))},we.constant=js,we.countBy=Sc,we.create=function(s,p){var P=_i(s);return p==null?P:hu(P,p)},we.curry=function s(p,P,ae){var pe=cs(p,8,o,o,o,o,o,P=ae?o:P);return pe.placeholder=s.placeholder,pe},we.curryRight=function s(p,P,ae){var pe=cs(p,b,o,o,o,o,o,P=ae?o:P);return pe.placeholder=s.placeholder,pe},we.debounce=Ec,we.defaults=hs,we.defaultsDeep=fd,we.defer=Nu,we.delay=Ul,we.difference=Vl,we.differenceBy=al,we.differenceWith=yc,we.drop=function(s,p,P){var ae=s==null?0:s.length;return ae?Na(s,(p=P||p===o?1:Sr(p))<0?0:p,ae):[]},we.dropRight=function(s,p,P){var ae=s==null?0:s.length;return ae?Na(s,0,(p=ae-(p=P||p===o?1:Sr(p)))<0?0:p):[]},we.dropRightWhile=function(s,p){return s&&s.length?ls(s,nr(p,3),!0,!0):[]},we.dropWhile=function(s,p){return s&&s.length?ls(s,nr(p,3),!0):[]},we.fill=function(s,p,P,ae){var pe=s==null?0:s.length;return pe?(P&&typeof P!="number"&&Fa(s,p,P)&&(P=0,ae=pe),function(Oe,Xe,it,wt){var gt=Oe.length;for((it=Sr(it))<0&&(it=-it>gt?0:gt+it),(wt=wt===o||wt>gt?gt:Sr(wt))<0&&(wt+=gt),wt=it>wt?0:ul(wt);it<wt;)Oe[it++]=Xe;return Oe}(s,p,P,ae)):[]},we.filter=function(s,p){return(gr(s)?Do:Xs)(s,nr(p,3))},we.flatMap=function(s,p){return Wi(La(s,p),1)},we.flatMapDeep=function(s,p){return Wi(La(s,p),g)},we.flatMapDepth=function(s,p,P){return P=P===o?1:Sr(P),Wi(La(s,p),P)},we.flatten=sl,we.flattenDeep=function(s){return s!=null&&s.length?Wi(s,g):[]},we.flattenDepth=function(s,p){return s!=null&&s.length?Wi(s,p=p===o?1:Sr(p)):[]},we.flip=function(s){return cs(s,512)},we.flow=Uc,we.flowRight=Hc,we.fromPairs=function(s){for(var p=-1,P=s==null?0:s.length,ae={};++p<P;){var pe=s[p];ae[pe[0]]=pe[1]}return ae},we.functions=function(s){return s==null?[]:fu(s,Ji(s))},we.functionsIn=function(s){return s==null?[]:fu(s,fa(s))},we.groupBy=dd,we.initial=function(s){return s!=null&&s.length?Na(s,0,-1):[]},we.intersection=Bl,we.intersectionBy=vc,we.intersectionWith=ld,we.invert=Ls,we.invertBy=$d,we.invokeMap=Pu,we.iteratee=ml,we.keyBy=Ru,we.keys=Ji,we.keysIn=fa,we.map=La,we.mapKeys=function(s,p){var P={};return p=nr(p,3),Ro(s,function(ae,pe,Oe){ja(P,p(ae,pe,Oe),ae)}),P},we.mapValues=function(s,p){var P={};return p=nr(p,3),Ro(s,function(ae,pe,Oe){ja(P,pe,p(ae,pe,Oe))}),P},we.matches=function(s){return Rl(Xa(s,1))},we.matchesProperty=function(s,p){return Ks(s,Xa(p,1))},we.memoize=Hl,we.merge=Uu,we.mergeWith=dl,we.method=Wc,we.methodOf=Qd,we.mixin=Oi,we.negate=Wl,we.nthArg=function(s){return s=Sr(s),Lr(function(p){return Qs(p,s)})},we.omit=Hu,we.omitBy=function(s,p){return Bc(s,Wl(nr(p)))},we.once=function(s){return Ko(2,s)},we.orderBy=function(s,p,P,ae){return s==null?[]:(gr(p)||(p=p==null?[]:[p]),gr(P=ae?o:P)||(P=P==null?[]:[P]),wn(s,p,P))},we.over=Xu,we.overArgs=Vu,we.overEvery=Jc,we.overSome=Yu,we.partial=Ac,we.partialRight=Fu,we.partition=Lu,we.pick=Fc,we.pickBy=Bc,we.property=ga,we.propertyOf=function(s){return function(p){return s==null?o:Pa(s,p)}},we.pull=xc,we.pullAll=wc,we.pullAllBy=function(s,p,P){return s&&s.length&&p&&p.length?Ll(s,p,nr(P,2)):s},we.pullAllWith=function(s,p,P){return s&&s.length&&p&&p.length?Ll(s,p,o,P):s},we.pullAt=cd,we.range=Zu,we.rangeRight=Ku,we.rearg=Oc,we.reject=function(s,p){return(gr(s)?Do:Xs)(s,Wl(nr(p,3)))},we.remove=function(s,p){var P=[];if(!s||!s.length)return P;var ae=-1,pe=[],Oe=s.length;for(p=nr(p,3);++ae<Oe;){var Xe=s[ae];p(Xe,ae,s)&&(P.push(Xe),pe.push(ae))}return el(s,pe),P},we.rest=function(s,p){if(typeof s!="function")throw new zr(a);return Lr(s,p=p===o?p:Sr(p))},we.reverse=bc,we.sampleSize=function(s,p,P){return p=(P?Fa(s,p,P):p===o)?1:Sr(p),(gr(s)?function(ae,pe){return gc(Ka(ae),uo(pe,0,ae.length))}:function(ae,pe){var Oe=$o(ae);return gc(Oe,uo(pe,0,Oe.length))})(s,p)},we.set=function(s,p,P){return s==null?s:hc(s,p,P)},we.setWith=function(s,p,P,ae){return ae=typeof ae=="function"?ae:o,s==null?s:hc(s,p,P,ae)},we.shuffle=function(s){return(gr(s)?function(p){return gc(Ka(p))}:function(p){return gc($o(p))})(s)},we.slice=function(s,p,P){var ae=s==null?0:s.length;return ae?(P&&typeof P!="number"&&Fa(s,p,P)?(p=0,P=ae):(p=p==null?0:Sr(p),P=P===o?ae:Sr(P)),Na(s,p,P)):[]},we.sortBy=Iu,we.sortedUniq=function(s){return s&&s.length?dh(s):[]},we.sortedUniqBy=function(s,p){return s&&s.length?dh(s,nr(p,2)):[]},we.split=function(s,p,P){return P&&typeof P!="number"&&Fa(s,p,P)&&(p=P=o),(P=P===o?N:P>>>0)?(s=$r(s))&&(typeof p=="string"||p!=null&&!cl(p))&&!(p=Za(p))&&fr(s)?As(re(s),0,P):s.split(p,P):[]},we.spread=function(s,p){if(typeof s!="function")throw new zr(a);return p=p==null?0:di(Sr(p),0),Lr(function(P){var ae=P[p],pe=As(P,0,p);return ae&&Ma(pe,ae),hi(s,this,pe)})},we.tail=function(s){var p=s==null?0:s.length;return p?Na(s,1,p):[]},we.take=function(s,p,P){return s&&s.length?Na(s,0,(p=P||p===o?1:Sr(p))<0?0:p):[]},we.takeRight=function(s,p,P){var ae=s==null?0:s.length;return ae?Na(s,(p=ae-(p=P||p===o?1:Sr(p)))<0?0:p,ae):[]},we.takeRightWhile=function(s,p){return s&&s.length?ls(s,nr(p,3),!1,!0):[]},we.takeWhile=function(s,p){return s&&s.length?ls(s,nr(p,3)):[]},we.tap=function(s,p){return p(s),s},we.throttle=function(s,p,P){var ae=!0,pe=!0;if(typeof s!="function")throw new zr(a);return gi(P)&&(ae="leading"in P?!!P.leading:ae,pe="trailing"in P?!!P.trailing:pe),Ec(s,p,{leading:ae,maxWait:p,trailing:pe})},we.thru=Cc,we.toArray=pd,we.toPairs=Kl,we.toPairsIn=$l,we.toPath=function(s){return gr(s)?Wr(s,po):mo(s)?[s]:Ka(Du($r(s)))},we.toPlainObject=Rs,we.transform=function(s,p,P){var ae=gr(s),pe=ae||Io(s)||Zl(s);if(p=nr(p,4),P==null){var Oe=s&&s.constructor;P=pe?ae?new Oe:[]:gi(s)&&fo(Oe)?_i(Li(s)):{}}return(pe?Ei:Ro)(s,function(Xe,it,wt){return p(P,Xe,it,wt)}),P},we.unary=function(s){return Dc(s,1)},we.union=ud,we.unionBy=Mc,we.unionWith=Eu,we.uniq=function(s){return s&&s.length?ss(s):[]},we.uniqBy=function(s,p){return s&&s.length?ss(s,nr(p,2)):[]},we.uniqWith=function(s,p){return p=typeof p=="function"?p:o,s&&s.length?ss(s,o,p):[]},we.unset=function(s,p){return s==null||vu(s,p)},we.unzip=Gl,we.unzipWith=Rh,we.update=function(s,p,P){return s==null?s:fh(s,p,yh(P))},we.updateWith=function(s,p,P,ae){return ae=typeof ae=="function"?ae:o,s==null?s:fh(s,p,yh(P),ae)},we.values=$o,we.valuesIn=function(s){return s==null?[]:Eo(s,fa(s))},we.without=_c,we.words=ks,we.wrap=function(s,p){return Ac(yh(p),s)},we.xor=Tc,we.xorBy=hd,we.xorWith=Yd,we.zip=Au,we.zipObject=function(s,p){return mh(s||[],p||[],Cn)},we.zipObjectDeep=function(s,p){return mh(s||[],p||[],hc)},we.zipWith=Lh,we.entries=Kl,we.entriesIn=$l,we.extend=Nh,we.extendWith=Nc,Oi(we,we),we.add=$u,we.attempt=ds,we.camelCase=gd,we.capitalize=Ql,we.ceil=tc,we.clamp=function(s,p,P){return P===o&&(P=p,p=o),P!==o&&(P=(P=oi(P))==P?P:0),p!==o&&(p=(p=oi(p))==p?p:0),uo(oi(s),p,P)},we.clone=function(s){return Xa(s,4)},we.cloneDeep=function(s){return Xa(s,5)},we.cloneDeepWith=function(s,p){return Xa(s,5,p=typeof p=="function"?p:o)},we.cloneWith=function(s,p){return Xa(s,4,p=typeof p=="function"?p:o)},we.conformsTo=function(s,p){return p==null||du(s,p,Ji(p))},we.deburr=pl,we.defaultTo=function(s,p){return s==null||s!=s?p:s},we.divide=To,we.endsWith=function(s,p,P){s=$r(s),p=Za(p);var ae=s.length,pe=P=P===o?ae:uo(Sr(P),0,ae);return(P-=p.length)>=0&&s.slice(P,pe)==p},we.eq=$a,we.escape=function(s){return(s=$r(s))&&tt.test(s)?s.replace(xe,Ws):s},we.escapeRegExp=function(s){return(s=$r(s))&&Ln.test(s)?s.replace(jt,"\\$&"):s},we.every=function(s,p,P){var ae=gr(s)?wo:Al;return P&&Fa(s,p,P)&&(p=o),ae(s,nr(p,3))},we.find=Ou,we.findIndex=ol,we.findKey=function(s,p){return yr(s,nr(p,3),Ro)},we.findLast=Vi,we.findLastIndex=Fl,we.findLastKey=function(s,p){return yr(s,nr(p,3),Pl)},we.floor=ep,we.forEach=kh,we.forEachRight=jh,we.forIn=function(s,p){return s==null?s:Ol(s,nr(p,3),fa)},we.forInRight=function(s,p){return s==null?s:Ti(s,nr(p,3),fa)},we.forOwn=function(s,p){return s&&Ro(s,nr(p,3))},we.forOwnRight=function(s,p){return s&&Pl(s,nr(p,3))},we.get=zu,we.gt=Pc,we.gte=Bu,we.has=function(s,p){return s!=null&&nd(s,p,sh)},we.hasIn=hl,we.head=ll,we.identity=ma,we.includes=function(s,p,P,ae){s=Ea(s)?s:$o(s),P=P&&!ae?Sr(P):0;var pe=s.length;return P<0&&(P=di(pe+P,0)),Gu(s)?P<=pe&&s.indexOf(p,P)>-1:!!pe&&Ai(s,p,P)>-1},we.indexOf=function(s,p,P){var ae=s==null?0:s.length;if(!ae)return-1;var pe=P==null?0:Sr(P);return pe<0&&(pe=di(ae+pe,0)),Ai(s,p,pe)},we.inRange=function(s,p,P){return p=ko(p),P===o?(P=p,p=0):P=ko(P),function(ae,pe,Oe){return ae>=Ii(pe,Oe)&&ae<di(pe,Oe)}(s=oi(s),p,P)},we.invoke=md,we.isArguments=aa,we.isArray=gr,we.isArrayBuffer=Rc,we.isArrayLike=Ea,we.isArrayLikeObject=mi,we.isBoolean=function(s){return s===!0||s===!1||yi(s)&&pa(s)==Y},we.isBuffer=Io,we.isDate=Lc,we.isElement=function(s){return yi(s)&&s.nodeType===1&&!Xl(s)},we.isEmpty=function(s){if(s==null)return!0;if(Ea(s)&&(gr(s)||typeof s=="string"||typeof s.splice=="function"||Io(s)||Zl(s)||aa(s)))return!s.length;var p=Ra(s);if(p==B||p==O)return!s.size;if(Xo(s))return!Ni(s).length;for(var P in s)if(Wn.call(s,P))return!1;return!0},we.isEqual=function(s,p){return uc(s,p)},we.isEqualWith=function(s,p,P){var ae=(P=typeof P=="function"?P:o)?P(s,p):o;return ae===o?uc(s,p,o,P):!!ae},we.isError=Jl,we.isFinite=function(s){return typeof s=="number"&&bo(s)},we.isFunction=fo,we.isInteger=Ic,we.isLength=Ps,we.isMap=kc,we.isMatch=function(s,p){return s===p||ch(s,p,Ch(p))},we.isMatchWith=function(s,p,P){return P=typeof P=="function"?P:o,ch(s,p,Ch(p),P)},we.isNaN=function(s){return ql(s)&&s!=+s},we.isNative=function(s){if(id(s))throw new ct("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ya(s)},we.isNil=function(s){return s==null},we.isNull=function(s){return s===null},we.isNumber=ql,we.isObject=gi,we.isObjectLike=yi,we.isPlainObject=Xl,we.isRegExp=cl,we.isSafeInteger=function(s){return Ic(s)&&s>=-9007199254740991&&s<=A},we.isSet=Yl,we.isString=Gu,we.isSymbol=mo,we.isTypedArray=Zl,we.isUndefined=function(s){return s===o},we.isWeakMap=function(s){return yi(s)&&Ra(s)==J},we.isWeakSet=function(s){return yi(s)&&pa(s)=="[object WeakSet]"},we.join=function(s,p){return s==null?"":Oo.call(s,p)},we.kebabCase=Is,we.last=Ba,we.lastIndexOf=function(s,p,P){var ae=s==null?0:s.length;if(!ae)return-1;var pe=ae;return P!==o&&(pe=(pe=Sr(P))<0?di(ae+pe,0):Ii(pe,ae-1)),p==p?function(Oe,Xe,it){for(var wt=pe+1;wt--;)if(Oe[wt]===Xe)return wt;return wt}(s,p):zt(s,cu,pe,!0)},we.lowerCase=Wu,we.lowerFirst=Ju,we.lt=Zd,we.lte=Kd,we.max=function(s){return s&&s.length?os(s,ma,lr):o},we.maxBy=function(s,p){return s&&s.length?os(s,nr(p,2),lr):o},we.mean=function(s){return Xr(s,ma)},we.meanBy=function(s,p){return Xr(s,nr(p,2))},we.min=function(s){return s&&s.length?os(s,ma,Ys):o},we.minBy=function(s,p){return s&&s.length?os(s,nr(p,2),Ys):o},we.stubArray=Ns,we.stubFalse=ec,we.stubObject=function(){return{}},we.stubString=function(){return""},we.stubTrue=function(){return!0},we.multiply=yl,we.nth=function(s,p){return s&&s.length?Qs(s,Sr(p)):o},we.noConflict=function(){return jr._===this&&(jr._=Sa),this},we.noop=za,we.now=fi,we.pad=function(s,p,P){s=$r(s);var ae=(p=Sr(p))?K(s):0;if(!p||ae>=p)return s;var pe=(p-ae)/2;return Mu(Ui(pe),P)+s+Mu(ha(pe),P)},we.padEnd=function(s,p,P){s=$r(s);var ae=(p=Sr(p))?K(s):0;return p&&ae<p?s+Mu(p-ae,P):s},we.padStart=function(s,p,P){s=$r(s);var ae=(p=Sr(p))?K(s):0;return p&&ae<p?Mu(p-ae,P)+s:s},we.parseInt=function(s,p,P){return P||p==null?p=0:p&&(p=+p),ki($r(s).replace(nn,""),p||0)},we.random=function(s,p,P){if(P&&typeof P!="boolean"&&Fa(s,p,P)&&(p=P=o),P===o&&(typeof p=="boolean"?(P=p,p=o):typeof s=="boolean"&&(P=s,s=o)),s===o&&p===o?(s=0,p=1):(s=ko(s),p===o?(p=s,s=0):p=ko(p)),s>p){var ae=s;s=p,p=ae}if(P||s%1||p%1){var pe=Dl();return Ii(s+pe*(p-s+xs("1e-"+((pe+"").length-1))),p)}return Er(s,p)},we.reduce=function(s,p,P){var ae=gr(s)?ka:Us,pe=arguments.length<3;return ae(s,nr(p,4),P,pe,Po)},we.reduceRight=function(s,p,P){var ae=gr(s)?na:Us,pe=arguments.length<3;return ae(s,nr(p,4),P,pe,lc)},we.repeat=function(s,p,P){return p=(P?Fa(s,p,P):p===o)?1:Sr(p),_o($r(s),p)},we.replace=function(){var s=arguments,p=$r(s[0]);return s.length<3?p:p.replace(s[1],s[2])},we.result=function(s,p,P){var ae=-1,pe=(p=Es(p,s)).length;for(pe||(pe=1,s=o);++ae<pe;){var Oe=s==null?o:s[po(p[ae])];Oe===o&&(ae=pe,Oe=P),s=fo(Oe)?Oe.call(s):Oe}return s},we.round=Fh,we.runInContext=Me,we.sample=function(s){return(gr(s)?El:function(p){return El($o(p))})(s)},we.size=function(s){if(s==null)return 0;if(Ea(s))return Gu(s)?K(s):s.length;var p=Ra(s);return p==B||p==O?s.size:Ni(s).length},we.snakeCase=qu,we.some=function(s,p,P){var ae=gr(s)?Go:zh;return P&&Fa(s,p,P)&&(p=o),ae(s,nr(p,3))},we.sortedIndex=function(s,p){return yu(s,p)},we.sortedIndexBy=function(s,p,P){return hh(s,p,nr(P,2))},we.sortedIndexOf=function(s,p){var P=s==null?0:s.length;if(P){var ae=yu(s,p);if(ae<P&&$a(s[ae],p))return ae}return-1},we.sortedLastIndex=function(s,p){return yu(s,p,!0)},we.sortedLastIndexBy=function(s,p,P){return hh(s,p,nr(P,2),!0)},we.sortedLastIndexOf=function(s,p){if(s!=null&&s.length){var P=yu(s,p,!0)-1;if($a(s[P],p))return P}return-1},we.startCase=Gc,we.startsWith=function(s,p,P){return s=$r(s),P=P==null?0:uo(Sr(P),0,s.length),p=Za(p),s.slice(P,P+p.length)==p},we.subtract=yd,we.sum=function(s){return s&&s.length?Gi(s,ma):0},we.sumBy=function(s,p){return s&&s.length?Gi(s,nr(p,2)):0},we.template=function(s,p,P){var ae=we.templateSettings;P&&Fa(s,p,P)&&(p=o),s=$r(s),p=Nc({},p,ae,us);var pe,Oe,Xe=Nc({},p.imports,ae.imports,us),it=Ji(Xe),wt=Eo(Xe,it),gt=0,Nt=p.interpolate||We,Kt="__p += '",Pn=Hn((p.escape||We).source+"|"+Nt.source+"|"+(Nt===Rt?lt:We).source+"|"+(p.evaluate||We).source+"|$","g"),jn="//# sourceURL="+(Wn.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ao+"]")+`
|
|
`;s.replace(Pn,function(on,Nn,vn,pr,cr,Ar){return vn||(vn=pr),Kt+=s.slice(gt,Ar).replace(ut,_a),Nn&&(pe=!0,Kt+=`' +
|
|
__e(`+Nn+`) +
|
|
'`),cr&&(Oe=!0,Kt+=`';
|
|
`+cr+`;
|
|
__p += '`),vn&&(Kt+=`' +
|
|
((__t = (`+vn+`)) == null ? '' : __t) +
|
|
'`),gt=Ar+on.length,on}),Kt+=`';
|
|
`;var Qn=Wn.call(p,"variable")&&p.variable;if(Qn){if(Xn.test(Qn))throw new ct("Invalid `variable` option passed into `_.template`")}else Kt=`with (obj) {
|
|
`+Kt+`
|
|
}
|
|
`;Kt=(Oe?Kt.replace(Pe,""):Kt).replace(Ye,"$1").replace(ze,"$1;"),Kt="function("+(Qn||"obj")+`) {
|
|
`+(Qn?"":`obj || (obj = {});
|
|
`)+"var __t, __p = ''"+(pe?", __e = _.escape":"")+(Oe?`, __j = Array.prototype.join;
|
|
function print() { __p += __j.call(arguments, '') }
|
|
`:`;
|
|
`)+Kt+`return __p
|
|
}`;var Ut=ds(function(){return Lt(it,jn+"return "+Kt).apply(o,wt)});if(Ut.source=Kt,Jl(Ut))throw Ut;return Ut},we.times=function(s,p){if((s=Sr(s))<1||s>A)return[];var P=N,ae=Ii(s,N);p=nr(p),s-=N;for(var pe=bs(ae,p);++P<s;)p(P);return pe},we.toFinite=ko,we.toInteger=Sr,we.toLength=ul,we.toLower=function(s){return $r(s).toLowerCase()},we.toNumber=oi,we.toSafeInteger=function(s){return s?uo(Sr(s),-9007199254740991,A):s===0?s:0},we.toString=$r,we.toUpper=function(s){return $r(s).toUpperCase()},we.trim=function(s,p,P){if((s=$r(s))&&(P||p===o))return Hs(s);if(!s||!(p=Za(p)))return s;var ae=re(s),pe=re(p);return As(ae,uu(ae,pe),Ms(ae,pe)+1).join("")},we.trimEnd=function(s,p,P){if((s=$r(s))&&(P||p===o))return s.slice(0,de(s)+1);if(!s||!(p=Za(p)))return s;var ae=re(s);return As(ae,0,Ms(ae,re(p))+1).join("")},we.trimStart=function(s,p,P){if((s=$r(s))&&(P||p===o))return s.replace(nn,"");if(!s||!(p=Za(p)))return s;var ae=re(s);return As(ae,uu(ae,re(p))).join("")},we.truncate=function(s,p){var P=30,ae="...";if(gi(p)){var pe="separator"in p?p.separator:pe;P="length"in p?Sr(p.length):P,ae="omission"in p?Za(p.omission):ae}var Oe=(s=$r(s)).length;if(fr(s)){var Xe=re(s);Oe=Xe.length}if(P>=Oe)return s;var it=P-K(ae);if(it<1)return ae;var wt=Xe?As(Xe,0,it).join(""):s.slice(0,it);if(pe===o)return wt+ae;if(Xe&&(it+=wt.length-it),cl(pe)){if(s.slice(it).search(pe)){var gt,Nt=wt;for(pe.global||(pe=Hn(pe.source,$r(Xt.exec(pe))+"g")),pe.lastIndex=0;gt=pe.exec(Nt);)var Kt=gt.index;wt=wt.slice(0,Kt===o?it:Kt)}}else if(s.indexOf(Za(pe),it)!=it){var Pn=wt.lastIndexOf(pe);Pn>-1&&(wt=wt.slice(0,Pn))}return wt+ae},we.unescape=function(s){return(s=$r(s))&&De.test(s)?s.replace(se,fe):s},we.uniqueId=function(s){var p=++lo;return $r(s)+p},we.upperCase=Ga,we.upperFirst=fl,we.each=kh,we.eachRight=jh,we.first=ll,Oi(we,(gl={},Ro(we,function(s,p){Wn.call(we.prototype,p)||(gl[p]=s)}),gl),{chain:!1}),we.VERSION="4.17.21",Ei(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){we[s].placeholder=we}),Ei(["drop","take"],function(s,p){xr.prototype[s]=function(P){P=P===o?1:di(Sr(P),0);var ae=this.__filtered__&&!p?new xr(this):this.clone();return ae.__filtered__?ae.__takeCount__=Ii(P,ae.__takeCount__):ae.__views__.push({size:Ii(P,N),type:s+(ae.__dir__<0?"Right":"")}),ae},xr.prototype[s+"Right"]=function(P){return this.reverse()[s](P).reverse()}}),Ei(["filter","map","takeWhile"],function(s,p){var P=p+1,ae=P==1||P==3;xr.prototype[s]=function(pe){var Oe=this.clone();return Oe.__iteratees__.push({iteratee:nr(pe,3),type:P}),Oe.__filtered__=Oe.__filtered__||ae,Oe}}),Ei(["head","last"],function(s,p){var P="take"+(p?"Right":"");xr.prototype[s]=function(){return this[P](1).value()[0]}}),Ei(["initial","tail"],function(s,p){var P="drop"+(p?"":"Right");xr.prototype[s]=function(){return this.__filtered__?new xr(this):this[P](1)}}),xr.prototype.compact=function(){return this.filter(ma)},xr.prototype.find=function(s){return this.filter(s).head()},xr.prototype.findLast=function(s){return this.reverse().find(s)},xr.prototype.invokeMap=Lr(function(s,p){return typeof s=="function"?new xr(this):this.map(function(P){return Qi(P,s,p)})}),xr.prototype.reject=function(s){return this.filter(Wl(nr(s)))},xr.prototype.slice=function(s,p){s=Sr(s);var P=this;return P.__filtered__&&(s>0||p<0)?new xr(P):(s<0?P=P.takeRight(-s):s&&(P=P.drop(s)),p!==o&&(P=(p=Sr(p))<0?P.dropRight(-p):P.take(p-s)),P)},xr.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},xr.prototype.toArray=function(){return this.take(N)},Ro(xr.prototype,function(s,p){var P=/^(?:filter|find|map|reject)|While$/.test(p),ae=/^(?:head|last)$/.test(p),pe=we[ae?"take"+(p=="last"?"Right":""):p],Oe=ae||/^find/.test(p);pe&&(we.prototype[p]=function(){var Xe=this.__wrapped__,it=ae?[1]:arguments,wt=Xe instanceof xr,gt=it[0],Nt=wt||gr(Xe),Kt=function(Nn){var vn=pe.apply(we,Ma([Nn],it));return ae&&Pn?vn[0]:vn};Nt&&P&&typeof gt=="function"&>.length!=1&&(wt=Nt=!1);var Pn=this.__chain__,jn=!!this.__actions__.length,Qn=Oe&&!Pn,Ut=wt&&!jn;if(!Oe&&Nt){Xe=Ut?Xe:new xr(this);var on=s.apply(Xe,it);return on.__actions__.push({func:Cc,args:[Kt],thisArg:o}),new Cr(on,Pn)}return Qn&&Ut?s.apply(this,it):(on=this.thru(Kt),Qn?ae?on.value()[0]:on.value():on)})}),Ei(["pop","push","shift","sort","splice","unshift"],function(s){var p=ca[s],P=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",ae=/^(?:pop|shift)$/.test(s);we.prototype[s]=function(){var pe=arguments;if(ae&&!this.__chain__){var Oe=this.value();return p.apply(gr(Oe)?Oe:[],pe)}return this[P](function(Xe){return p.apply(gr(Xe)?Xe:[],pe)})}}),Ro(xr.prototype,function(s,p){var P=we[p];if(P){var ae=P.name+"";Wn.call(It,ae)||(It[ae]=[]),It[ae].push({name:p,func:P})}}),It[wu(o,2).name]=[{name:"wrapper",func:o}],xr.prototype.clone=function(){var s=new xr(this.__wrapped__);return s.__actions__=Ka(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Ka(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Ka(this.__views__),s},xr.prototype.reverse=function(){if(this.__filtered__){var s=new xr(this);s.__dir__=-1,s.__filtered__=!0}else(s=this.clone()).__dir__*=-1;return s},xr.prototype.value=function(){var s=this.__wrapped__.value(),p=this.__dir__,P=gr(s),ae=p<0,pe=P?s.length:0,Oe=function(Ar,Vn,zn){for(var ui=-1,ii=zn.length;++ui<ii;){var Fi=zn[ui],Hr=Fi.size;switch(Fi.type){case"drop":Ar+=Hr;break;case"dropRight":Vn-=Hr;break;case"take":Vn=Ii(Vn,Ar+Hr);break;case"takeRight":Ar=di(Ar,Vn-Hr)}}return{start:Ar,end:Vn}}(0,pe,this.__views__),Xe=Oe.start,it=Oe.end,wt=it-Xe,gt=ae?it:Xe-1,Nt=this.__iteratees__,Kt=Nt.length,Pn=0,jn=Ii(wt,this.__takeCount__);if(!P||!ae&&pe==wt&&jn==wt)return ho(s,this.__actions__);var Qn=[];e:for(;wt--&&Pn<jn;){for(var Ut=-1,on=s[gt+=p];++Ut<Kt;){var Nn=Nt[Ut],vn=Nn.iteratee,pr=Nn.type,cr=vn(on);if(pr==2)on=cr;else if(!cr){if(pr==1)continue e;break e}}Qn[Pn++]=on}return Qn},we.prototype.at=zl,we.prototype.chain=function(){return Ih(this)},we.prototype.commit=function(){return new Cr(this.value(),this.__chain__)},we.prototype.next=function(){this.__values__===o&&(this.__values__=pd(this.value()));var s=this.__index__>=this.__values__.length;return{done:s,value:s?o:this.__values__[this.__index__++]}},we.prototype.plant=function(s){for(var p,P=this;P instanceof an;){var ae=Zo(P);ae.__index__=0,ae.__values__=o,p?pe.__wrapped__=ae:p=ae;var pe=ae;P=P.__wrapped__}return pe.__wrapped__=s,p},we.prototype.reverse=function(){var s=this.__wrapped__;if(s instanceof xr){var p=s;return this.__actions__.length&&(p=new xr(this)),(p=p.reverse()).__actions__.push({func:Cc,args:[bc],thisArg:o}),new Cr(p,this.__chain__)}return this.thru(bc)},we.prototype.toJSON=we.prototype.valueOf=we.prototype.value=function(){return ho(this.__wrapped__,this.__actions__)},we.prototype.first=we.prototype.head,ri&&(we.prototype[ri]=function(){return this}),we}();Ce?((Ce.exports=_e)._=_e,Q._=_e):jr._=_e}).call(commonjsGlobal)}),MrxDbgUiPrBaseReturn;function useCanvasResizeListener(w,r,o=100){return Si(this,null,function*(){if(!store.state.MxFun)return void console.error("请先调用loadCoreCode方法! ");if(!w)return void console.error("请确保mxdrawObj参数 是通过调用MxFun.createMxObject的callback回调函数拿到的mxDraw对象");let a=w;if(!a.isLoadCanvasResizeListene){let v;a.isLoadCanvasResizeListene=!0,w.addEvent("addResizeEvent",b=>{v=b}),yield dynamicImport("element-resize-event-polyfill");let h=createCanvasParent(r);h.addEventListener?h.addEventListener("resize",lodash.throttle(function(b){v&&v()},o),!1):console.log("mx: parentdiv[addEventListener] invalid")}})}class McEdGetPointWorldDrawObject{constructor(){var r;this._McEdGetPointWorldDraw=new((r=store.state.MxFun)===null||r===void 0?void 0:r.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass()),this._get=()=>this._McEdGetPointWorldDraw}drawCircle(r,o){return this._McEdGetPointWorldDraw.drawCircle(r,o)}drawLine(r,o){return this._McEdGetPointWorldDraw.drawLine(r,o)}drawSolid(r,o){this.drawSolid(r,o)}drawRect(r,o){return this._McEdGetPointWorldDraw.drawRect(r,o)}drawEntity(r,o){return this._McEdGetPointWorldDraw.drawEntity(r,o)}drawMcDbEntity(r,o){return this._McEdGetPointWorldDraw.drawMcDbEntity(r,o)}drawMcDbLine(r,o,a,v,h,b){return this._McEdGetPointWorldDraw.drawMcDbLine(r,o,a,v,h,b)}drawText(r,o,a,v){return this._McEdGetPointWorldDraw.drawText(r,o,a,v)}setDraw(r){return this._McEdGetPointWorldDraw.setDraw(r)}setColor(r){return this._McEdGetPointWorldDraw.setColor(r)}getColor(){return this._McEdGetPointWorldDraw.getColor()}drawCustomEntity(r,o){return this._McEdGetPointWorldDraw.drawCustomEntity(r,o)}}(function(w){w[w.kCancel=-2]="kCancel",w[w.kNone=-1]="kNone",w[w.kOk=0]="kOk",w[w.kKeyWord=1]="kKeyWord"})(MrxDbgUiPrBaseReturn||(MrxDbgUiPrBaseReturn={}));var MrxDbgUiPrBaseReturn$1=MrxDbgUiPrBaseReturn,MxCursorType,DynamicInputType,DetailedResult,UserInputControls;(function(w){w[w.kNormal=0]="kNormal",w[w.kRect=1]="kRect",w[w.kCross=2]="kCross"})(MxCursorType||(MxCursorType={})),function(w){w[w.kNoInput=0]="kNoInput",w[w.kXYCoordInput=1]="kXYCoordInput",w[w.kDistanceInput=2]="kDistanceInput",w[w.kDynTip=3]="kDynTip",w[w.kAutoInput=4]="kAutoInput"}(DynamicInputType||(DynamicInputType={})),function(w){w[w.kUnknown=1]="kUnknown",w[w.kTouchDownIn=2]="kTouchDownIn",w[w.kTouchUpIn=3]="kTouchUpIn",w[w.kMouseLeftIn=4]="kMouseLeftIn",w[w.kMouseLeftUpIn=5]="kMouseLeftUpIn",w[w.kMouseRightIn=6]="kMouseRightIn",w[w.kKeyIn=7]="kKeyIn",w[w.kCoordIn=8]="kCoordIn",w[w.kNullEnterIn=9]="kNullEnterIn",w[w.kNullSpaceIn=10]="kNullSpaceIn",w[w.kEcsIn=11]="kEcsIn",w[w.kNewCommadIn=12]="kNewCommadIn",w[w.kCodeAbort=13]="kCodeAbort"}(DetailedResult||(DetailedResult={})),function(w){w[w.kGovernedByOrthoMode=1]="kGovernedByOrthoMode",w[w.kNullResponseAccepted=2]="kNullResponseAccepted",w[w.kDontEchoCancelForCtrlC=4]="kDontEchoCancelForCtrlC",w[w.kDontUpdateLastPoint=8]="kDontUpdateLastPoint",w[w.kNoDwgLimitsChecking=16]="kNoDwgLimitsChecking",w[w.kNoZeroResponseAccepted=32]="kNoZeroResponseAccepted",w[w.kNoNegativeResponseAccepted=64]="kNoNegativeResponseAccepted",w[w.kAccept3dCoordinates=128]="kAccept3dCoordinates",w[w.kAcceptMouseUpAsPoint=256]="kAcceptMouseUpAsPoint",w[w.kAnyBlankTerminatesInput=512]="kAnyBlankTerminatesInput",w[w.kInitialBlankTerminatesInput=1024]="kInitialBlankTerminatesInput",w[w.kAcceptOtherInputString=2048]="kAcceptOtherInputString",w[w.kGovernedByUCSDetect=4096]="kGovernedByUCSDetect",w[w.kNoZDirectionOrtho=8192]="kNoZDirectionOrtho",w[w.kSpacesInAccepted=16384]="kSpacesInAccepted"}(UserInputControls||(UserInputControls={}));class MrxDbgUiPrBase{constructor(r){this.imp=r,this.status=MrxDbgUiPrBaseReturn$1.kCancel}keyWords(){return this.imp.keyWords()}setKeyWords(r){return this.imp.setKeyWords(r)}message(){return this.imp.message()}setMessage(r){return this.imp.setMessage(r)}clearLastInputPoint(){this.imp.clearLastInputPoint()}setLastInputPoint(r){this.imp.SetLASTPOINT(r)}keyWordPicked(){return this.imp.keyWordPicked()}isKeyWordPicked(r){return this.status==MrxDbgUiPrBaseReturn$1.kKeyWord&&this.imp.isKeyWordPicked(r)}setUserDraw(r){if(typeof r!="function")return this.imp.setUserDraw(r._get?r._get():r);{const o=new McEdGetPointWorldDrawObject;o.setDraw(r),this.imp.setUserDraw(o._get())}}getDetailedResult(){return this.imp.getDetailedResult()}getStatus(){return this.status}drawReserve(r){return this.imp.drawReserve(r)}setInputToucheType(r){return this.imp.setInputToucheType(r)}getInputToucheType(){return this.imp.getInputToucheType()}setCursorType(r){this.imp.setCursorType(r)}getCursorType(){return this.imp.getCursorType()}setDynamicInputType(r){this.imp.setDynamicInputType(r)}getDynamicInputType(){return this.imp.getDynamicInputType()}isDisableDynInput(){return this.imp.isDisableDynInput()}setDisableDynInput(r){return this.imp.setDisableDynInput(r)}setDisableOsnap(r){return this.imp.setDisableOsnap(r)}isOffsetInputPostion(){return this.imp.isOffsetInputPostion()}setOffsetInputPostion(r){return this.imp.setOffsetInputPostion(r)}isDisableOsnap(){return this.imp.isDisableOsnap()}setDisableDynamicTrace(r){this.imp.setDisableDynamicTrace(r)}isDisableDynamicTrace(){return this.imp.isDisableDynamicTrace()}setDisablePolarAxisTrace(r){this.imp.setDisablePolarAxisTrace(r)}isDisablePolarAxisTrace(){return this.imp.isDisablePolarAxisTrace()}setDisableGridTrace(r){this.imp.setDisableGridTrace(r)}isDisableGridTrace(){return this.imp.isDisableGridTrace()}setDisableOrthoTrace(r){this.imp.setDisableOrthoTrace(r)}isDisableOrthoTrace(){return this.imp.isDisableOrtho()}disableAllTrace(r=!0){this.imp.disableAllTrace(r)}userInputControls(){return this.imp.userInputControls()}setUserInputControls(r){this.imp.setUserInputControls(r)}}class MrxDbgUiPrPoint extends MrxDbgUiPrBase{constructor(){var r;super(new((r=store.state.MxFun)===null||r===void 0?void 0:r.getMxJigCmdManager().getMrxDbgUiPrPointClass()))}value(){return this.imp.value()}getCADValue(){return this.imp.getCADValue()}valueDocCoord(){return this.imp.valueDocCoord()}basePt(){return this.imp.basePt()}setBasePt(r){return this.imp.setBasePt(r)}setUseBasePt(r){return this.imp.setUseBasePt(r)}go(r){let o=this;return r?(o.imp.go(a=>{o.status=a,r(a)}),new Promise((a,v)=>{a(null)})):new Promise((a,v)=>{o.imp.go(h=>{o.status=h,a(h!=0?null:o.imp.value())})})}goWhile(r,o){return this.imp.goWhile(r,o)}abort(r){this.imp.abort(r)}}class MxVueComandLine{constructor(){this.msCmdText="",this.msCmdDisplay="",this.msCmdTip="",this.mxFunObject=void 0,this.mountUpDisplayFun=r=>{this.mUpDisplayFun=r},this.setCmdText=r=>{this.msCmdText=r},this.getCmdText=()=>this.msCmdText,this.getCmdDisplay=()=>this.msCmdDisplay,this.setCmdDisplay=r=>{this.msCmdDisplay=r},this.addCmdDisplay=r=>{this.msCmdDisplay.length>1024?(this.msCmdDisplay=this.msCmdDisplay.substring(this.msCmdDisplay.length-1024,this.msCmdDisplay.length),this.msCmdDisplay=this.msCmdDisplay+r):this.msCmdDisplay=this.msCmdDisplay+r},this.setCmdTip=r=>{this.msCmdTip=r},this.getCmdTip=()=>this.msCmdTip}upDisplay(){const{msCmdTip:r,msCmdDisplay:o,msCmdText:a}=this;this.mUpDisplayFun!=null&&this.mUpDisplayFun({msCmdTip:r,msCmdDisplay:o,msCmdText:a})}}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.focusIndex=0,this.mLockValues=new Map,this.mOnKeydownEvent=void 0,this.mFocusValue="",this.setFocusValue=r=>{this.mFocusValue=r},this.getFocusValue=()=>this.mFocusValue,this.getFocusIndex=()=>this.focusIndex,this.setFocusIndex=r=>{this.focusIndex=r},this.mountKeydownEvent=r=>{this.mOnKeydownEvent=r},this.onKeydown=r=>this.mOnKeydownEvent==null?0:this.mOnKeydownEvent(r),this.setType=r=>{this.mType=r},this.getType=()=>this.mType,this.isShow=()=>this.misShow,this.setPos=r=>{this.mPos=r},this.setTip=r=>{this.mTip=r},this.setValue1=r=>{this.mValue1=r},this.getValue1=()=>this.mValue1,this.setValue1Pos=r=>{this.mValue1Pos=r},this.setValue2=r=>{this.mValue2=r},this.getValue2=()=>this.mValue2,this.setValue2Pos=r=>{this.mValue2Pos=r},this.setShow=r=>{this.misShow=r},this.getData=()=>{if(!this.misShow)return;let r={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?(r.list[0].show=!0,r.list[0].value=this.mTip,r.list[0].readonly=!0,r.list[1].show=!0,r.list[1].value=this.mValue1,r.list[1].readonly=!1,r.list[2].show=!0,r.list[2].value=this.mValue2,r.list[2].readonly=!1):this.mType==MxInputType.kDistanceInput?(r.list[0].show=!0,r.list[0].value=this.mTip,r.list[0].readonly=!0,r.list[1].show=!0,r.list[1].value=this.mValue1,r.list[1].readonly=!1,r.list[1].pos=this.mValue1Pos,r.list[2].show=!0,r.list[2].value=this.mValue2,r.list[2].readonly=!1,r.list[2].pos=this.mValue2Pos,r.postype=MxInputPostionType.kAbsolutely):this.mType==MxInputType.kDynTip?(r.list[0].show=!0,r.list[0].value=this.mTip,r.list[0].readonly=!0,r.list[1].show=!1,r.list[2].show=!1):r=void 0,r):void 0}}setLockValues(r,o){o.length==0?this.mLockValues.delete(r):this.mLockValues.set(r,o)}getLockValues(r){return this.mLockValues.has(r)?this.mLockValues.get(r):""}getLockValuesMap(){return this.mLockValues}clearLockValuesMap(){this.mLockValues.clear()}}const CursorType={kNormal:"Normal",kRect:"Rect",kCross:"Cross",kPan:"Pan"},RightMenuType={kNoShow:0,kDefautMenu:1,kCommandRuningMenu:2,kOsnapSetCommandRuningMenu:3};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=r=>{this.mSetCoordFun=r},this.mountUpdateCursorFun=r=>{this.mUpdateCursorFun=r},this.mountKeydownEvent=r=>{this.mOnKeydownEvent=r},this.onKeydown=r=>{this.mOnKeydownEvent!=null&&this.mOnKeydownEvent(r)},this.mountsetRightMenuSnapTypeFun=r=>{this.mRightMenuSnapTypeFun=r},this.setTipCoord=r=>{this.mSetCoordFun!=null&&this.mSetCoordFun(r)},this.getCursorType=()=>this.mCursorType,this.setCursorType=r=>{if(typeof r=="number")switch(r){case 0:this.mCursorType=CursorType.kNormal;break;case 1:this.mCursorType=CursorType.kRect;break;case 2:this.mCursorType=CursorType.kCross;break;case 3:this.mCursorType=CursorType.kPan}else this.mCursorType=r;this.mUpdateCursorFun!=null&&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=r=>{this.mxFunObject.sendStringToExecute(r)},this.getCmdLine=()=>this.mComandLine,this.getDynamicInput=()=>this.mdynamicInput,this.init=r=>{this.mxFunObject=r},this.OnMxEvent=r=>{const o=r.name;if(o==null)return;const a=this.mMxEvents[o];a!=null&&a(r.param)},this.mountMxEvent=(r,o)=>{this.mMxEvents[r]=o}}setRightMenuOSmodeValue(r){this.mRightMenuSnapTypeFun!=null&&this.mRightMenuSnapTypeFun(r)}executeOperations(r){this.mTsWeb_MxUiVue.executeOperations(r)}mountTsWeb_MxUiVue(r){this.mTsWeb_MxUiVue=r}getRightMenuType(r){let o=MxFun.getRunningCommand();return o?r&&o.isEnableOsnap()?RightMenuType.kOsnapSetCommandRuningMenu:RightMenuType.kCommandRuningMenu:RightMenuType.kDefautMenu}}const mxUiData$1=new MxVueInterface;function createReandomId(w=10){return new Number(Math.random().toString().substr(3,w)+Date.now()).toString(36)}class Node extends PubSub{constructor(){super(...arguments),this.parent=null,this.children=[]}add(...r){if(r.length>1){for(let a=0;a<r.length;a++){const v=r[a];this.add(v)}return this}const o=r[0];return o===this?(console.error("Node.add 不可以添加它自己"),this):(o&&(o.parent!==null&&o.parent.remove(o),o.parent=this,this.children.push(o)),this)}remove(...r){r.length>1&&r.forEach(v=>{this.remove(v)});const o=r[0],a=this.children.indexOf(o);return a!==-1&&(o.parent=null,this.children.splice(a,1)),this}removeFromParent(){const r=this.parent;return r!==null&&r.remove(this),this}clear(){for(let r=0;r<this.children.length;r++)this.children[r].parent=null;return this.children.length=0,this}getNodeByProperty(r,o){if(this[r]===o)return this;for(let a=0,v=this.children.length;a<v;a++){const h=this.children[a].getNodeByProperty(r,o);if(h!==void 0)return h}}getNodesByProperty(r,o){let a=[];this[r]===o&&a.push(this);for(let v=0,h=this.children.length;v<h;v++){const b=this.children[v].getNodesByProperty(r,o);b.length>0&&(a=a.concat(b))}return a}traverse(r){r(this);const o=this.children;for(let a=0,v=o.length;a<v;a++)o[a].traverse(r)}traverseParent(r){this.parent!==null&&r(this.parent)!==!1&&this.parent.traverseParent(r)}emit(r,...o){super.emit(r,...o),this.traverseParent(a=>(a.emit(r,...o),(o==null?void 0:o.isEventBubbling)!==!1&&void 0))}}class RenderOrderNode extends Node{constructor(){super(),this.renderOrder=30}setRenderOrder(r){this.renderOrder=r}getRenderOrder(){return this.renderOrder}top(){var r;if(!this.parent)return;let o=Math.max(...(r=this.parent)===null||r===void 0?void 0:r.children.map(({renderOrder:a})=>a));o!==this.renderOrder&&o++,this.setRenderOrder(o)}bottom(){var r;if(!this.parent)return;let o=Math.min(...(r=this.parent)===null||r===void 0?void 0:r.children.map(({renderOrder:a})=>a));o--,this.setRenderOrder(o)}restoreDefaultRenderOrder(){this.renderOrder=30}}class Layer extends RenderOrderNode{constructor(r){super(),this.isLayer=!0,this.getLayerMap=()=>this.getDatabase()._mxDatabase.mapNameToLayer,this.getEntityMap=()=>this.getDatabase()._mxDatabase.mapIdToEntity,this.getRootLayerName=()=>this.getNames()[0]||"0";const o=typeof r=="string"?r:Date.now()+Math.random().toString(36).substr(2,9);Object.defineProperty(this,"name",{get:()=>o,set(){throw new Error("不能修改Layer.name值, 因为它是Layer 实例的唯一标识")},configurable:!1});let a=this.renderOrder;Object.defineProperty(this,"renderOrder",{get:()=>a,set(v){this.getLayer().group.renderOrder=v,a=v,MxFun.updateDisplay()}})}get visible(){const r=this.getDatabase().getLayer(this.name);return!r||r.getVisible()}set visible(r){this.getDatabase().showLayer(this.name,r),MxFun.updateDisplay()}setVisible(r){this.visible=r}getDatabase(){return this._database||(this._database=MxFun.getCurrentDatabase()),this._database}getLayer(){return this.getDatabase().getLayer(this.name)||this.getDatabase().addLayer(this.name),this.getDatabase().getLayer(this.name)}getCurrentName(){return this.getDatabase()._mxDatabase.curLayer.toString()}callLayerContextFun(r){return Si(this,null,function*(){const o=this.getCurrentName();this.getDatabase().setCurrentLayer(this.name);const a=yield r();return this.getDatabase().setCurrentLayer(o),a})}getNames(){return Array.from(this.getLayerMap().keys())}getAllEntity(){return Array.from(this.getEntityMap().values()).filter(({userObject:r})=>r.layer===this.name).map(({userObject:r})=>r)}add(...r){var o;const a=this.getLayer();return a.group.renderOrder!==this.renderOrder&&(a.group.renderOrder=this.renderOrder,this.children=this.getAllEntity()),this.parent||(this.parent=MxFun.getCurrentDraw(),(o=this.parent)===null||o===void 0||o.add(this)),super.add(...r),this.callLayerContextFun(()=>{r.forEach(v=>{v&&this.getDatabase().addEntity(v)})}),this}remove(...r){super.remove(...r);let o=this.getRootLayerName();return this.callLayerContextFun(()=>{r.forEach(a=>{a&&(a.setLayer(o),a.setNeedUpdateDisplay())})}),this}}class MxDbDatabase{constructor(r){this._mxDatabase=r}addLayer(r){return this._mxDatabase.addLayer(r)}showLayer(r,o){this._mxDatabase.showLayer(r,o)}setCurrentLayer(r){return this._mxDatabase.setCurrentLayer(r)}getLayer(r){return this._mxDatabase.getLayer(r)}addEntity(r){return this._mxDatabase.addMxEntity(r)}getGroup(r){return this._mxDatabase.getGroupDictionary().getAt(r)}addGroup(r){return this._mxDatabase.getGroupDictionary().add(r)}getEntityInGroup(r){return this._mxDatabase.getGroupDictionary().getEntityInGroup(r)}deleteGroup(r){return this._mxDatabase.getGroupDictionary().delete(r)}}class MxTempMarkDraw{constructor(r){this.imp=r}clear(){this.imp.clear()}drawLine(r,o,a=16777215,v=1){this.imp.drawLine(r,o,a,v)}drawCircle(r,o,a){this.imp.drawCircle(r,o,a)}drawEntity(r){this.imp.drawEntity(r)}drawCircleMark(r,o,a){this.imp.drawCircleMark(r,o,a)}}function setGeometrPostion(w,r){for(let o=0;o<w.vertices.length;o++)w.vertices[o].x+=r.x,w.vertices[o].y+=r.y,w.vertices[o].z+=r.z}function repairGeometryFaceVertexUvs(w){w.computeBoundingBox();const r=w.boundingBox.min,o=w.boundingBox.max,a=new THREE.Vector2(0-r.x,0-r.y),v=new THREE.Vector2(o.x-r.x,o.y-r.y);w.faceVertexUvs[0]=[];const h=w.faces;for(let b=0;b<h.length;b++){const D=h[b],U=w.vertices[D.a],V=w.vertices[D.b],I=w.vertices[D.c];w.faceVertexUvs[0].push([new THREE.Vector2((U.x+a.x)/v.x,(U.y+a.y)/v.y),new THREE.Vector2((V.x+a.x)/v.x,(V.y+a.y)/v.y),new THREE.Vector2((I.x+a.x)/v.x,(I.y+a.y)/v.y)])}return w.uvsNeedUpdate=!0,w}function insertPointsWithEqualSpacing(w){const r=[];if(w.length<2)return w;let o=Number.MAX_VALUE;for(let a=0;a<w.length-1;a++){const v=w[a].distanceTo(w[a+1]);v<o&&(o=v)}for(let a=0;a<w.length-1;a++){const v=w[a],h=w[a+1];r.push(v);const b=v.distanceTo(h);if(b>o){const D=Math.floor(b/o),U=h.clone().sub(v).normalize();for(let V=1;V<D;V++){const I=v.clone().add(U.clone().multiplyScalar(V*o));r.push(I)}}}return r.push(w[w.length-1]),r}function getToGenerateRoundedCorners(w,r,o=!0){const a=new THREE.CurvePath;if(w.length<2)throw new Error("Points should have at least 2 items");if(!r||r.length===0)return w;!o&&w[0].equals(w[w.length-1])&&w.pop(),o||w.push(w[0]);for(let h=0;h<w.length-1;h++){const b=r[h]||0;if(h===0&&!o){const M=w[0].clone().sub(w[1]);M.normalize();const N=w[1].clone();N.add(M.clone().multiplyScalar(b));const F=new THREE.LineCurve3(w[0],N);a.curves.push(F);continue}const D=!o||w[h-1]?w[h-1].clone().sub(w[h]):w[w.length-1].clone().sub(w[0]);D.normalize();const U=!o||w[h+1]?w[h+1].clone().sub(w[h]):w[1].clone().sub(w[0]);U.normalize();const V=w[h].clone().add(D.clone().multiplyScalar(b)),I=w[h].clone(),g=w[h].clone().add(U.clone().multiplyScalar(b)),A=new THREE.QuadraticBezierCurve3(V,I,g);if(h===w.length-2){const M=w[h].clone().add(U.clone().multiplyScalar(b)),N=w[h+1].clone();o?N.add(U.clone().multiplyScalar(-b)):N.add(U.clone());const F=new THREE.LineCurve3(M,N);a.curves.push(A,F)}else a.curves.push(A);h===0&&w.push(w[0])}let v=a.getPoints();return v=insertPointsWithEqualSpacing(v)}function computeRectPoints(w,r){return[w,w.clone().set(r.x,w.y,r.z),r,r.clone().set(w.x,r.y,w.z)]}function calculateArcOrigin(w,r,o){const a=w.x,v=r.x,h=o.x,b=w.y,D=r.y,U=o.y,V=a-v,I=b-D,g=a-h,A=b-U,M=(a*a-v*v+(b*b-D*D))/2,N=(a*a-h*h+(b*b-U*U))/2,F=I*g-V*A,T=-(A*M-I*N)/F,_=-(V*N-g*M)/F;return new THREE.Vector3(T,_,0)}function calculateRadiusArc(w,r){const o=w.x,a=w.y,v=r.x,h=r.y;return Math.sqrt((o-v)*(o-v)+(a-h)*(a-h))}function calculateArcAngle(w,r,o){const a=w.x,v=r.x;let h,b,D;return h=(w.y-r.y)/o,(b=(a-v)/o)>=.99999&&(b=.99999),b<=-.99999&&(b=-.99999),D=(D=Math.acos(b))/Math.PI*180,h<-.05&&(D=360-D),{sin:h,cos:b,angle:D}}function judgementArcRenderDirection(w,r,o){return(w<r?r-w:r-w+360)>(w<o?o-w:o-w+360)}function createThreePointArc(w,r,o,a=!1,v=!1,h=new THREE.Color("#ff0000")){const b=calculateArcOrigin(w,r,o),D=b.x,U=b.y,V=calculateRadiusArc(w,b),I=calculateArcAngle(w,b,V),g=calculateArcAngle(r,b,V),A=calculateArcAngle(o,b,V);let M,N,F=I.angle,T=g.angle,_=A.angle,Y=judgementArcRenderDirection(F,T,_);v&&(Y=!0),a?(N=new THREE.ArcCurve(D,U,V,THREE.MathUtils.degToRad(F),THREE.MathUtils.degToRad(T),!Y),M=Y?T>F?THREE.MathUtils.radToDeg(N.aEndAngle-N.aStartAngle):360-Math.abs(THREE.MathUtils.radToDeg(N.aEndAngle-N.aStartAngle)):F>T?Math.abs(THREE.MathUtils.radToDeg(N.aEndAngle-N.aStartAngle)):360-THREE.MathUtils.radToDeg(N.aEndAngle-N.aStartAngle)):(N=new THREE.ArcCurve(D,U,V,THREE.MathUtils.degToRad(F),THREE.MathUtils.degToRad(_),Y),M=Y?_>F?360-THREE.MathUtils.radToDeg(N.aEndAngle-N.aStartAngle):Math.abs(THREE.MathUtils.radToDeg(N.aEndAngle-N.aStartAngle)):F>_?360+THREE.MathUtils.radToDeg(N.aEndAngle-N.aStartAngle):THREE.MathUtils.radToDeg(N.aEndAngle-N.aStartAngle));const k=M*Math.PI*V/180,S=new THREE.BufferGeometry().setFromPoints(N.getPoints(50)),G=new THREE.LineBasicMaterial({color:h});return{arc:new THREE.Line(S,G),radius:V,angle:M,arcLength:k}}function computeRegularPolygonVertices(w=new THREE.Vector3,r=new THREE.Vector3,o=3){const a=[];o=Math.max(3,o),a.push(r);const v=2*Math.PI/o;for(let h=1;h<o;h++){const b=Math.cos(v*h),D=Math.sin(v*h),U=w.clone(),V=r.clone(),I=V.x-U.x,g=V.y-U.y,A=new THREE.Vector3(I*b-g*D+U.x,I*D+g*b+U.y);a.push(A)}return a}function computeBounding(w){if(w.length==0){let r=new THREE.Vector3;return{centerPoint:r,minPoint:r,maxPoint:r}}{let r=new THREE.Vector3(w[0].x,w[0].y,w[0].z||0),o=new THREE.Vector3(w[0].x,w[0].y,w[0].z||0),a=w.length;for(let v=1;v<a;v++){let h=w[v];r.x>h.x&&(r.x=h.x),r.y>h.y&&(r.y=h.y),o.x<h.x&&(o.x=h.x),o.y<h.y&&(o.y=h.y)}return{centerPoint:new THREE.Vector3(r.x+.5*(o.x-r.x),r.y+.5*(o.y-r.y),0),minPoint:r,maxPoint:o}}}function MxThreeJSMixin(w){return w.createImage=function(r,o,a,v,h){if(!h)return new Promise((b,D)=>{w.createImage.call(this,r,o,a,v,U=>b(U))});new THREE.TextureLoader().load(v,function(b){let D=new THREE.PlaneGeometry(o,a),U=new THREE.MeshLambertMaterial({map:b,transparent:!0,side:THREE.DoubleSide});U.map&&(U.map.needsUpdate=!0),setGeometrPostion(D,r);let V=new THREE.Mesh(D,U);V.material.depthTest=!1,h&&h(V)},void 0,function(b){console.log(b),h&&h(null)})},w.loadSVG=function(r,o,a,v){return a?(store.state.MxFun.loadSVG(r,o,a,v),new Promise(h=>{h(null)})):new Promise(h=>{store.state.MxFun.loadSVG(r,o,b=>{h(b)},v)})},w.clacTextSize=(r,o)=>store.state.MxFun.getMxThreeJS().clacTextSize(r,o),w.clacTextSpriteSize=(r,o,a)=>store.state.MxFun.getMxThreeJS().clacTextSpriteSize(r,o,a),w.creatTextSprite=(r,o,a,v,h)=>r.length===0?null:(h instanceof Object?h.getHex&&(h=h.getHex()):typeof h=="string"&&(h=parseInt(h)),store.state.MxFun.getMxThreeJS().creatTextSprite(r,o,a,v,h)),w}class MxThreeJS$1{createLine(r,o,a){const v=new THREE.Geometry,h=new THREE.LineBasicMaterial({color:a});return v.vertices.push(r,o),new THREE.Line(v,h)}createCircle(r,o,a){const v=new THREE.CircleGeometry(o,64,3,2*Math.PI),h=new THREE.LineBasicMaterial({color:a});v.vertices.shift();const b=new THREE.LineLoop(v,h),{x:D,y:U,z:V}=r;return b.position.set(D,U,V),b}createPoint(r,o,a=3){const v=new THREE.Geometry;v.vertices.push(r);const h=new THREE.PointsMaterial({color:o,size:a});return new THREE.Points(v,h)}createTriangle(r,o,a=1){if(r.length<3)return null;const v=r.length,h=new THREE.Geometry;for(let D=0;D+2<v;D+=3){h.vertices.push(r[D]),h.vertices.push(r[D+1]),h.vertices.push(r[D+2]);const U=new THREE.Face3(D,D+1,D+2);h.faces.push(U)}h.computeFaceNormals(),h.computeVertexNormals();const b=new THREE.MeshBasicMaterial({color:o,transparent:!0,depthTest:!1,side:THREE.DoubleSide,opacity:a});return new THREE.Mesh(h,b)}createLines(r,o){const a=new THREE.Geometry;a.vertices=r;const v=new THREE.LineBasicMaterial({color:o});return new THREE.Line(a,v)}createDashedLines(r,o,a,v){const h=new THREE.Geometry;h.vertices=r;const b=new THREE.Line(h,new THREE.LineDashedMaterial({color:o,dashSize:a,gapSize:v}));return b.computeLineDistances(),b}}const MxThreeJS=MxThreeJSMixin(new MxThreeJS$1);class MxDrawObject extends Node{constructor(r){super(),this.rootLayer=new Layer(r.m_mxDatabase.curLayer),this.add(this.rootLayer),this._mxdrawObj=r}getMxObjectImplement(){return this._mxdrawObj}getScene(){return this._mxdrawObj.getScene()}setMultipleSelect(r){this._mxdrawObj.isMultipleSelect=r}getCamera(){return this._mxdrawObj.getCamera()}getRenderer(){return this._mxdrawObj.renderer}setMouseRightRotate(r=!0){return this._mxdrawObj.setMouseRightRotate(r)}getFullDisplayRange(){return this._mxdrawObj.getFullDisplayRange()}getCanvas(){return this._mxdrawObj.getCanvas()}updateDisplay(r=!1){return this._mxdrawObj.updateDisplay(r)}createCanvasImageData(r,o){return this._mxdrawObj.createCanvasImageData(r,o)}setViewColor(r){return this._mxdrawObj.setViewColor(r)}getViewColor(){return this._mxdrawObj.getViewColor()}setSize(r,o){return this._mxdrawObj.setSize(r,o)}getIntersectObjects(r){return this._mxdrawObj.getIntersectObjects(r)}addObject(r,o=!0){return this._mxdrawObj.addObject(r,o)}addViewObject(r){return this._mxdrawObj.addViewObject(r)}getViewWidth(){return this._mxdrawObj.getViewWidth()}getViewHeight(){return this._mxdrawObj.getViewHeight()}removeObject(r,o=!0){return this._mxdrawObj.removeObject(r,o)}zoomInitialStates(){return this._mxdrawObj.zoomInitialStates()}zoomScale(r){return this._mxdrawObj.zoomScale(r)}zoomW(r,o,a,v,h){return this._mxdrawObj.zoomW(r,o,a,v,h)}saveZoom(){return this._mxdrawObj.saveZoom()}recoverZoom(){return this._mxdrawObj.recoverZoom()}zoomCenter(r,o){return this._mxdrawObj.zoomCenter(r,o)}initZoomW(r,o){return this._mxdrawObj.initZoomW(r,o)}addEvent(r,o){return this._mxdrawObj.addEvent(r,o)}on(r,o){return super.on(r,o),this._mxdrawObj.addEvent(r,o)}off(r,o){return super.off(r,o),this.removeEventFuction(r,o)}removeEventFuction(r,o){return this._mxdrawObj.removeEventFuction(r,o)}setIniset(r){return this._mxdrawObj.setIniset(r)}getViewDocCoord(){return this._mxdrawObj.getViewDocCoord()}screenCoord2World(r,o,a){return this._mxdrawObj.screenCoord2World(r,o,a)}worldCoord2Screen(r,o,a){return this._mxdrawObj.worldCoord2Screen(r,o,a)}screenCoord2Doc(r,o){return this._mxdrawObj.screenCoord2Doc(r,o,0)}worldCoordLong2Doc(r){return this._mxdrawObj.worldCoordLong2Doc(r)}docCoordLong2World(r){return this._mxdrawObj.docCoordLong2World(r)}docCoord2World(r,o,a){return this._mxdrawObj.docCoord2World(r,o,a)}docCoord2World2(r){return this._mxdrawObj.docCoord2World(r.x,r.y,r.z)}worldCoord2Doc(r,o,a){return this._mxdrawObj.worldCoord2Doc(r,o,a)}worldCoord2Doc2(r){return this._mxdrawObj.worldCoord2Doc(r.x,r.y,r.z)}docCoord2Screen(r,o){return this._mxdrawObj.docCoord2Screen(r,o,0)}screenCoordLong2Doc(r){return this._mxdrawObj.screenCoordLong2Doc(r)}docCoordLong2Screen(r){return this._mxdrawObj.docCoordLong2Screen(r)}screenCoordLong2World(r){return this._mxdrawObj.screenCoordLong2World(r)}worldCoordLong2Screen(r){return this._mxdrawObj.worldCoordLong2Screen(r)}initRendererParam(r){return this._mxdrawObj.initRendererParam(r)}addMxEntity(r){return this.rootLayer.add(r),r.objectId()}getMxCurrentSelect(){let r=this._mxdrawObj.getMxAllSelect();return r.length==0&&(r=this._mxdrawObj.getPrvCommandSelect()),r}getMxCADCurrentSelect(){let r=this._mxdrawObj.getMxCADAllSelect();return r.length==0&&(r=this._mxdrawObj.getPrvCommandMxCADSelect()),r}getSelectPoints(){return this._mxdrawObj.getSelectPoints()}addMxCurrentSelect(r,o=!0,a=!0){return this._mxdrawObj.addMxCurrentSelect(r,o,a)}addMxCADCurrentSelect(r,o=!0,a=!0){return this._mxdrawObj.addMxCADCurrentSelect(r,o,a)}fireSelectChange(r){this._mxdrawObj.fireSelectChange(r)}clearMxCurrentSelect(){return this._mxdrawObj.clearMxCurrentSelect()}getMxEntity(r){return this._mxdrawObj.getMxEntityUserObject(r)}findMxEntityAtPoint(r,o,a){return this._mxdrawObj.findMxEntityAtPoint(r,o,a)}getAllMxEntity(){return this._mxdrawObj.getAllMxEntity()}setViewMovementMethod(r){return this._mxdrawObj.setMouseMiddlePan(r)}setMouseMiddlePan(r){return this._mxdrawObj.setMouseMiddlePan(r)}resetThreeJSControls(){return this._mxdrawObj.resetThreeJSControls()}enableZoom(r){return this._mxdrawObj.enableZoom(r)}enablePan(r){return this._mxdrawObj.enablePan(r)}eraseMxEntity(r){return this._mxdrawObj.eraseMxEntity(r)}removeViewObject(r){this._mxdrawObj.removeViewObject(r)}saveMxEntityToJson(r){return JSON.stringify(this._mxdrawObj.saveMxEntityToJson(r))}saveMxEntityToObject(r){return this._mxdrawObj.saveMxEntityToJson(r)}loadMxEntityFromJson(r,o=null){return Si(this,null,function*(){if(o){let a=o.length;for(let v=0;v<a;v++)yield MxThreeJS.loadSVG(o[v])}return this.getAllMxEntity().forEach(a=>{for(let v in a)Reflect.deleteProperty(a,v)}),typeof r=="string"?this._mxdrawObj.loadMxEntityFromJson(JSON.parse(r)):this._mxdrawObj.loadMxEntityFromJson(r)})}eraseAllMxEntity(){return this._mxdrawObj.eraseAllMxEntity()}makeCurrent(){this._mxdrawObj.makeCurrent()}getViewCenterDocCoord(){return this._mxdrawObj.getViewCenterDocCoord()}updateCanvasSize(){this._mxdrawObj.updateCanvasSize()}newFile(r,o,a,v){return this._mxdrawObj.newFile(r,o,a,v)}stopAllLoading(){this._mxdrawObj.stopAllLoading()}getOrbitControls(){return this._mxdrawObj.getOrbitControls()}enableViewControls(r){return this._mxdrawObj.enableViewControls(r)}getMxDatabase(){return new MxDbDatabase(this._mxdrawObj.getMxDatabase())}getTempMarkDraw(){return new MxTempMarkDraw(this._mxdrawObj.getTempMarkDraw())}setZoomSpeed(r){return this._mxdrawObj.setZoomSpeed(r)}resetRenderer(){return this._mxdrawObj.resetRenderer()}setRequestHeader(r){return this._mxdrawObj.setRequestHeader(r)}closeWebSocket(){return this._mxdrawObj.closeWebSocket()}cadCoord2Doc(r,o,a){return this._mxdrawObj.cadCoord2Doc(r,o,a)}cadCoord2Doc2(r){return this._mxdrawObj.cadCoord2Doc2(r)}toSmallcoord(r){return this._mxdrawObj.toSmallcoord(r)}toSmallcoord2(r,o,a=0){return this._mxdrawObj.toSmallcoord2(r,o,a)}docCoord2Cad(r,o,a){return this._mxdrawObj.docCoord2Cad(r,o,a)}docCoord2Cad2(r){return this._mxdrawObj.docCoord2Cad2(r)}viewCoord2Cad(r,o,a){return this._mxdrawObj.viewCoord2Cad(r,o,a)}cadCoord2View(r,o,a){return this._mxdrawObj.cadCoord2View(r,o,a)}cadCoordLong2View(r){return this._mxdrawObj.cadCoordLong2View(r)}viewCoordLong2Cad(r){return this._mxdrawObj.viewCoordLong2Cad(r)}docCoordLong2Cad(r){return this._mxdrawObj.docCoordLong2Cad(r)}cadCoordLong2Doc(r){return this._mxdrawObj.cadCoordLong2Doc(r)}setViewAngle(r){return this._mxdrawObj.setViewAngle(r)}getViewAngle(){return this._mxdrawObj.getViewAngle()}getSysVar(r){return this._mxdrawObj.sysVariable().getSysVar()}setSysVar(r,o){return this._mxdrawObj.sysVariable().setSysVar(r,o)}isMxCAD(){return this._mxdrawObj.isCppMxCAD()}getAllLayoutName(){return this._mxdrawObj.getAllLayoutName()}getDtabaseJsonString(){return this._mxdrawObj.getDtabaseJsonString()}gotoLayout(r){return this._mxdrawObj.gotoLayout(r)}initMxCpp(r){return this._mxdrawObj.initMxCpp(r)}isWebgl2(){return this._mxdrawObj.isWebgl2()}getId(){return this._mxdrawObj.getId()}addControlsEvent(r,o,a=!1){return this._mxdrawObj.addControlsEvent(r,o,a)}clearAllObject(){return this.rootLayer.clear(),this._mxdrawObj.clearAllObject()}setPointMultipleSelect(r=!0){return this._mxdrawObj.setPointMultipleSelect(r)}isWhiteViewColor(){return this._mxdrawObj.isWhiteViewColor()}automaticInversionColor(r){return this._mxdrawObj.automaticInversionColor(r)}renderLoop(r=!0){return this._mxdrawObj.renderLoop(r)}}const initEvents=w=>{let r=[];["click","mousedown","mouseup"].forEach(o=>{w.addEventListener(o,()=>{r.forEach(a=>{a.emit(o)})})}),w.addEventListener("mousemove",()=>{const o=MxFun.getCurrentDraw().findMxEntityAtPoint(MxFun.getCurrentMousePostion(),!1);o.forEach(a=>{a.emit("mousemove")}),o.length===0&&(r.length>0&&r.forEach(a=>{a.emit("mouseout")}),r=[]),r.length===0&&(r=o).forEach(a=>{a.emit("mouseover"),a.emit("hover")})})};function createMxObject({canvasId:w=createReandomId(),cadFile:r="",callback:o,isNewFile:a=!1,useWebsocket:v=!1,isAutoResize:h=!0,mapBox:b,isMxCAD:D=!1,userIdentitySign:U="emptyUserIdentity",isCPPMxCAD:V=!1}){if(this.initUiDataObject(mxUiData$1),!v&&a&&(a=!1),b)if(V){const I=b.canvas;let g=!0;store.state.MxFun.createMxObject(I,"",A=>{let M=new MxDrawObject(A);A.setMouseRightRotate(!1),A.setIniset({EnableOsnapFunction:!0}),o&&o(M,{canvas:I,canvasParent:void 0})},g,!1,!1,b,V)}else{const I=b.canvas;store.state.MxFun.createMxObject(I,r,g=>{let A=new MxDrawObject(g);g.setIniset({EnableOsnapFunction:!0}),o&&o(A,{canvas:I,canvasParent:void 0})},void 0,a,v,b)}else if(V){const I=createCanvas(w),g=createCanvasParent(I);g.parentNode&&g.parentNode.nodeType!=11||document.body.appendChild(g);let A=!0;store.state.MxFun.createMxObject(w,"",M=>{let N=new MxDrawObject(M);M.setMouseRightRotate(!1),M.setIniset({EnableOsnapFunction:!0}),M.addEvent("onResize",()=>(g.tabindex=3,{width:g.clientWidth,height:g.clientHeight})),h&&useCanvasResizeListener(N,I),o&&o(N,{canvas:I,canvasParent:g})},A,!1,!1,void 0,V)}else{const I=createCanvas(w),g=createCanvasParent(I);let A;g.parentNode&&g.parentNode.nodeType!=11||document.body.appendChild(g),D&&(A=!0,v=!0),store.state.MxFun.createMxObject(w,r,M=>{let N=new MxDrawObject(M);D&&(U.length==0&&(U="invalidUserIdentity"),M.initRunMode(2),M.initUserLoginData(U,"")),M.setMouseRightRotate(!1),M.setIniset({EnableOsnapFunction:!0}),M.addEvent("onResize",()=>(g.tabindex=3,{width:g.clientWidth,height:g.clientHeight})),h&&useCanvasResizeListener(N,I),initEvents(I),o&&o(N,{canvas:I,canvasParent:g})},A,a,v,void 0)}}let mxUiData=mxUiData$1,mxFunSyncInitialization;class MxFunClass{constructor(){this.createMxObject=createMxObject,this.getMxFunTHREE=()=>store.state.MxFun.getTHREE()}setMxServer(r="ws://localhost:5090"){store.state.MxFun.setMxServer(r)}setloadImageFuction(r){store.state.MxFun.setloadImageFuction(r)}onInitSync(r){mxFunSyncInitialization=r}callSyncInitialization(){return mxFunSyncInitialization!=null?mxFunSyncInitialization():new Promise(r=>{r(!0)})}screenCoord2Doc(r,o){return store.state.MxFun.screenCoord2Doc(r,o,0)}docCoord2Screen(r,o){return store.state.MxFun.docCoord2Screen(r,o,0)}getCurrentDraw(){const r=store.state.MxFun.getCurrentDraw();return r.tmp||(r.tmp=new MxDrawObject(r)),r.tmp}addToCurrentSpace(r){return MxFun.getCurrentDraw().addMxEntity(r)}initUiDataObject(r){return mxUiData=r,store.state.MxFun.initUiDataObject(r)}getUIData(){return mxUiData}getCurrentDatabase(){return MxFun.getCurrentDraw().getMxDatabase()}testMX(r){return 11}loadImageMaterial(r,o){return o?(store.state.MxFun.loadImageMaterial(r,o),new Promise((a,v)=>{a(null)})):new Promise((a,v)=>{store.state.MxFun.loadImageMaterial(r,h=>{a(h||null)})})}selectEnt(r,o=null){return new Promise((a,v)=>{const h=new MrxDbgUiPrPoint;h.setMessage(r),h.go(b=>{if(b!=0)return void a(0);const D=h.value();let U=MxFun.getCurrentDraw().findMxEntityAtPoint(D),V=0;for(;U.length!=0;){let I=U.length;for(let g=0;g<I;g++){let A=U[g];if(!o||!o.type||o.type==A.getTypeName()){V=A.objectId();break}}break}a(V)})})}listenForCommandLineInput(r){mxUiData.getCmdLine().mountUpDisplayFun(r)}setCommandLineInputData(r,o){mxUiData.getCmdLine().setCmdText(r),mxUiData.onKeydown(o)}listenForCoordTip(r){mxUiData.mountSetCoordFun(r)}listenForUpdateCursor(r){mxUiData.mountUpdateCursorFun(r)}getMxFunThreeTool(){return store.state.MxFun.getMxThreeJS()}ceneratecursor(r=128,o=10,a=!0,v){return store.state.MxFun.ceneratecursor(r,o,a,v)}getCurrentMousePostion(){let r=store.state.MxFun.getCurrentMousePostion();return new THREE.Vector3(r.x,r.y,0)}onUseCreateMxDbEntity(r){store.events.on("use:create:MxDbEntity",r)}}const _MxFun=new MxFunClass,MxFun=new Proxy({},{get:(w,r)=>typeof _MxFun[r]=="function"?_MxFun[r].bind(_MxFun):store.state.MxFun[r]});var MxCloneType,MxCommandFlag,MxDefaultRenderOrder,InputToucheType;(function(w){w[w.kClone=1]="kClone",w[w.kDragClone=2]="kDragClone",w[w.kMxFileClone=3]="kMxFileClone",w[w.kSaveDwgClone=4]="kSaveDwgClone"})(MxCloneType||(MxCloneType={})),function(w){w[w.MCRX_CMD_MODAL=0]="MCRX_CMD_MODAL",w[w.MCRX_CMD_TRANSPARENT=1]="MCRX_CMD_TRANSPARENT",w[w.MCRX_CMD_NO_UNDO_MARKER=2]="MCRX_CMD_NO_UNDO_MARKER",w[w.MCRX_CMD_NOPRV=4]="MCRX_CMD_NOPRV"}(MxCommandFlag||(MxCommandFlag={})),function(w){w[w.kCADMeshRenderOrder=10]="kCADMeshRenderOrder",w[w.kCADCurveRenderOrder=20]="kCADCurveRenderOrder",w[w.kMxEntityRenderOrder=30]="kMxEntityRenderOrder",w[w.kGripRenderOrder=110]="kGripRenderOrder",w[w.kDynJigRenderOrder=120]="kDynJigRenderOrder"}(MxDefaultRenderOrder||(MxDefaultRenderOrder={})),function(w){w[w.kGetBegan=1]="kGetBegan",w[w.kGetEnd=2]="kGetEnd"}(InputToucheType||(InputToucheType={}));var MxType=Object.freeze({__proto__:null,get MxCloneType(){return MxCloneType},get MxCommandFlag(){return MxCommandFlag},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(r,o,a){this.initImp();let v=new this.mxassembly.McGePoint3d;return r&&(v.x=r),o&&(v.y=o),a&&(v.z=a),v}NewMcGePoint3dArray(r){this.initImp();let o=new this.mxassembly.McGePoint3dArray;return r&&r.forEach(a=>{let v=this.NewMcGePoint3d();v.x=a.x,v.y=a.y,v.z=a.z,o.append(v)}),o}}const Mxassembly=new MxassemblyClass;class McGeToolClass{constructor(){this.mxgeTool=null}initImp(){this.mxgeTool||store.state.Mxassembly&&(this.mxgeTool=new store.state.Mxassembly.McGeTool)}calcArea(r){if(this.initImp(),!store.state.Mxassembly)return 0;if(r instanceof Array){let o=Mxassembly.NewMcGePoint3dArray(r);return this.mxgeTool.calcArea(o)}return this.mxgeTool.calcArea(r)}pointInPolyline(r,o){this.initImp();let a=o;o instanceof Array&&(a=Mxassembly.NewMcGePoint3dArray(o));let v=Mxassembly.NewMcGePoint3d(r.x,r.y,r.z);return this.mxgeTool.pointInPolyline(v,a)}}const McGeTool=new McGeToolClass;class MrxDbgUtilsClass{constructor(){this.imp=null}initImp(){if(!this.imp&&store.state.MxFun){let r=store.state.MxFun;this.imp=new r.getMrxDbgUtilsClass}}findEntAtPoint(r,o=null,a,v=!0,h){return this.initImp(),a||(a=MxFun.getCurrentDraw()),this.imp.findEntAtPoint(a.getMxObjectImplement(),r,o,v,h)}selectEnt(r,o){return this.initImp(),this.imp.selectEnt(r)}getCorner(r,o,a=!1,v,h=!1){return this.initImp(),this.imp.getCorner(r,o,a,v,h)}}const MrxDbgUtils=new MrxDbgUtilsClass,MxPaintBrushProps={},MxPaintBrush={getProps:()=>MxPaintBrushProps,setProps:w=>Object.assign(MxPaintBrushProps,w),use:w=>Object.assign(w,MxPaintBrushProps)};var DataType;(function(w){w[w.Default=0]="Default",w[w.Color=1]="Color",w[w.Vector2=2]="Vector2",w[w.Vector3=3]="Vector3",w[w.Vector4=4]="Vector4",w[w.Matrix3=5]="Matrix3",w[w.Matrix4=6]="Matrix4"})(DataType||(DataType={}));const MXDBDATATYPE="datatype";function getDwgKeyVal(w,r){let o,a="";return lodash.isObject(r)?(o=r.default,a=r.key):typeof r=="string"&&(a=r),[a,w[a]===void 0?o:w[a]]}class MxDbEntity extends RenderOrderNode{constructor(){super(),this.color=16777215,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.use_smallcoord_display=!1,this.addEvent=this.on,this.removeEvent=this.off,this.callEvent=this.emit;const r=this.constructor;r.isPaintBrushDraw&&(MxPaintBrush.use(this),store.events.emit("use:create:MxDbEntity",this),r.isPaintBrushDraw=!1)}static register(){const r=this;r.isRegister||(r.cmd&&r.draw&&MxFun.addCommand(r.cmd,o=>r.use.call(r,void 0,o)),new r().rxInit(),r.isRegister=!0)}static use(r,o){return Si(this,null,function*(){return new Promise((a,v)=>{const h=this;if(!h.isRegister&&h.register(),h.isPaintBrushDraw=!0,!h.cmd&&h.draw)return v();const b=D=>{a(D),r&&r(D),store.events.off("use:create:MxDbEntity",b)};store.events.on("use:create:MxDbEntity",b),h.draw(o)})})}initGuid(r){this.sGuid.length>0?console.log("mx: init guid error"):this.sGuid=r}toSmallcoord2(r,o,a,v=0){return this.use_smallcoord_display?r.toSmallcoord2(o,a,v):new THREE.Vector3(o,a,v)}toSmallcoord(r,o){return this.use_smallcoord_display?r.toSmallcoord(o):o}isUseSmallcoordDisplay(){return this.use_smallcoord_display}setUseSmallcoordDisplay(r){this.use_smallcoord_display=r}dwgInHelp(r,o,a){let v=this;const h=r.type===MxType.MxCloneType.kMxFileClone||r.type===MxType.MxCloneType.kSaveDwgClone,b=U=>{if(!U)return;const{value:V,[MXDBDATATYPE]:I}=U;switch(I){case DataType.Color:return new THREE.Color(...V);case DataType.Vector2:return new THREE.Vector2(...V);case DataType.Vector3:return new THREE.Vector3(...V);case DataType.Vector4:return new THREE.Vector4(...V);case DataType.Matrix3:return new THREE.Matrix3().fromArray(V);case DataType.Matrix4:return new THREE.Matrix4().fromArray(V)}return a&&a.getCacheVal?a.getCacheVal(U):void 0};function D(U){return U instanceof THREE.Color||U instanceof THREE.Vector2||U instanceof THREE.Vector3||U instanceof THREE.Vector4||U instanceof THREE.Matrix3||U instanceof THREE.Matrix4?U.clone():a&&a.getVal?a.getVal(U):void 0}return o.forEach(U=>{const[V,I]=getDwgKeyVal(r,U);v[V]=lodash.cloneDeepWith(I,h?b:D)}),!0}dwgOutHelp(r,o){const a=b=>b instanceof THREE.Color?{[MXDBDATATYPE]:DataType.Color,value:b.toArray()}:b instanceof THREE.Vector2?{[MXDBDATATYPE]:DataType.Vector2,value:b.toArray()}:b instanceof THREE.Vector3?{[MXDBDATATYPE]:DataType.Vector3,value:b.toArray()}:b instanceof THREE.Vector4?{[MXDBDATATYPE]:DataType.Vector4,value:b.toArray()}:b instanceof THREE.Matrix3?{[MXDBDATATYPE]:DataType.Matrix3,value:b.toArray()}:b instanceof THREE.Matrix4?{[MXDBDATATYPE]:DataType.Matrix4,value:b.toArray()}:void 0;let v=this;const h=r.type===MxType.MxCloneType.kMxFileClone||r.type===MxType.MxCloneType.kSaveDwgClone;return o.forEach(b=>{const[D,U]=getDwgKeyVal(v,b);r[D]=h?lodash.cloneDeepWith(U,a):U}),r}create(r){return new this.constructor(r)}transformBy(r){}transformScale(r,o){let a=new THREE.Matrix4().makeTranslation(r.x,r.y,r.z).multiply(new THREE.Matrix4().makeScale(o,o,o)).multiply(new THREE.Matrix4().makeTranslation(-r.x,-r.y,-r.z));this.transformBy(a)}transformRotate(r,o){let a=new THREE.Matrix4().makeTranslation(r.x,r.y,r.z).multiply(new THREE.Matrix4().makeRotationZ(o)).multiply(new THREE.Matrix4().makeTranslation(-r.x,-r.y,-r.z));this.transformBy(a)}transformMove(r){let o=new THREE.Matrix4().makeTranslation(r.x,r.y,r.z);this.transformBy(o)}getGeomExtents(){return null}getClosestPointTo(r,o=0){return null}getImp(){return this.MxDbEntityImp}setNeedUpdateDisplay(r){let o=this.getImp();return!!o&&(r?o.upDisplay():o.setDirtyDisplay(!0),!0)}getMxObject(){let r=this.getImp();return r?r.getMxObject():null}onViewChange(){return!1}objectId(){let r=this.getImp();return r?r.objectId():0}erase(){let r=this.getImp();return!!r&&r.erase()}setLayer(r){let o=this.getImp();o&&o.nodifySetLayer(),this.layer=r}getLayer(){return this.layer}setColor(r){return this.color=r,this}getColor(){return this.color||16777215}clone(r){let o=this.create(),a={type:r||MxType.MxCloneType.kClone};return this.dwgOut(a),o.dwgIn(a),o.sGuid="",o}onDwgIn(r){this.color=r.color,this.renderOrder=r.renderOrder,this.opacity=r.opacity,this.visible=r.visible,r.userData?this.userData=JSON.parse(JSON.stringify(r.userData)):this.userData={},this.dLineWidth=r.lineWidth,this.lineWidthByPixels=r.lineWidthByPixels,this.dDashArray=r.dashArray,this.dDashRatio=r.dashRatio,this.layer=r.layer,r.guid&&(this.sGuid=r.guid)}onDwgOut(r){r.color=this.color,r.renderOrder=this.renderOrder,r.opacity=this.opacity,r.visible=this.visible,r.lineWidth=this.dLineWidth,r.lineWidthByPixels=this.lineWidthByPixels,r.dashArray=this.dDashArray,r.dashRatio=this.dDashRatio,r.layer=this.layer,r.guid=this.sGuid,Object.keys(this.userData).length>0&&(r.userData=this.userData)}rxInit(){MxFun.initMxDbEntityType(this)}setRenderOrder(r){this.renderOrder=r}getRenderOrder(){return this.renderOrder}setLineWidthByPixels(r){return this.lineWidthByPixels=r,this}getLineWidthByPixels(){return this.lineWidthByPixels}setLineWidth(r){return this.dLineWidth=r,this}getLineWidth(){return this.dLineWidth}getGetLength(){return 0}setDashLen(r){let o=this.getGetLength();if(o<1e-6||r<1e-6)return this;let a=Math.floor(o/r);return a<1e-6&&(this.dDashRatio=0),this.dDashArray=1/a,this}setDashRatio(r){return this.dDashRatio=r,this}setDashArray(r){return this.dDashArray=r,this}setDash(r,o){return this.dDashArray=r,this.dDashRatio=o,this.dLineWidth==0&&(this.dLineWidth=6,this.lineWidthByPixels=!0),this}getDash(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}}setDashLineDisplay(r){return r?(this.dDashArray<1e-5&&(this.dDashArray=.03),this.dDashRatio<1e-5&&(this.dDashRatio=.1),this.dLineWidth==0&&(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}setGuid(r){return this.sGuid=r}onEndGripEidt(){this.callEvent("onEndGripEidt")}onStartGripEidt(){return this.callEvent("onStartGripEidt")}toJsonString(r=MxType.MxCloneType.kMxFileClone){let o={type:r};return this.dwgOut(o),o.TypeName=this.getTypeName(),JSON.stringify(o)}fromJsonString(r){let o=JSON.parse(r);return(o.type==MxType.MxCloneType.kMxFileClone||o.type==MxType.MxCloneType.kClone)&&this.dwgIn(o)}}function drawMxDbImage(){const w=new MrxDbgUiPrPoint;w.setMessage(`
|
|
指定插入点:`);let r=MxFun.getCurrentDraw();w.go(o=>{if(o!=0)return;let a=MxFun.screenCoordLong2Doc(300),v=MxFun.screenCoordLong2Doc(200);const h=w.value();let b=MxFun.screenCoord2Doc(10,10);h.z=b.z;let D=new MxDbImage;D.setRenderOrder(MxType.MxDefaultRenderOrder.kCADMeshRenderOrder-1),D.setPoint1(h);let U=new THREE.Vector3(h.x+a,h.y+v,h.z);D.setPoint2(U);let V=prompt("请填写图片网络地址","https://cdn.pixabay.com/photo/2022/11/15/12/23/winter-7593872_960_720.jpg");V&&(D.setImagePath(V),r.addMxEntity(D),D.addEvent("onStartGripEidt",()=>(D.visible=!1,D.setNeedUpdateDisplay(),{renderOrder:MxType.MxDefaultRenderOrder.kCADMeshRenderOrder-1})),D.addEvent("onEndGripEidt",()=>{D.visible=!0,D.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(r){this.angle=r}worldDraw(r){let o=new THREE.Vector3(this.pt1.x,this.pt2.y),a=new THREE.Vector3(this.pt2.x,this.pt1.y);if(Math.abs(this.angle)>1e-5){let v=new THREE.Vector3(.5*(this.pt1.x-this.pt2.x)+this.pt2.x,.5*(this.pt1.y-this.pt2.y)+this.pt2.y),h=new THREE.Matrix4;h.makeRotationZ(this.angle);let b=new THREE.Matrix4().makeTranslation(v.x,v.y,v.z).multiply(h).multiply(new THREE.Matrix4().makeTranslation(-v.x,-v.y,-v.z));r.setMatrix(b)}if(r.getType()==1){if(r.drawSelectLine(this.pt1,o),r.drawSelectLine(o,this.pt2),r.drawSelectLine(this.pt2,a),r.drawSelectLine(a,this.pt1),this.material){let v=Math.abs(this.pt1.x-this.pt2.x),h=Math.abs(this.pt1.y-this.pt2.y),b=new THREE.PlaneGeometry(v,h),D=Math.min(this.pt1.x,this.pt2.x),U=Math.min(this.pt1.y,this.pt2.y);for(let I=0;I<b.vertices.length;I++)b.vertices[I].x+=D+.5*v,b.vertices[I].y+=U+.5*h,b.vertices[I].z=0;let V=new THREE.Mesh(b,this.material);V.material.depthTest=!1,r.drawEntity(V)}else if(this.imagePath.length>0&&this.isLoadMaterialFromPath){let v=this,h=r.getMxObject();const b=D=>{this.isLoadMaterialFromPath=!1,D&&(v.setMaterial(D),v.setNeedUpdateDisplay(),h.updateDisplay())};MxFun.loadImageMaterial(this.imagePath,D=>{b(D)})}}else if(this.material){let v=Math.abs(this.pt1.x-this.pt2.x),h=Math.abs(this.pt1.y-this.pt2.y),b=new THREE.PlaneGeometry(v,h),D=Math.min(this.pt1.x,this.pt2.x),U=Math.min(this.pt1.y,this.pt2.y);for(let I=0;I<b.vertices.length;I++)b.vertices[I].x+=D+.5*v,b.vertices[I].y+=U+.5*h,b.vertices[I].z=0;let V=new THREE.Mesh(b,this.material);V.material.depthTest=!1,r.drawEntity(V)}else r.drawLine(this.pt1,o),r.drawLine(o,this.pt2),r.drawLine(this.pt2,a),r.drawLine(a,this.pt1);r.setMatrix(null)}setImagePath(r){this.imagePath=r,this.isLoadMaterialFromPath=!0,this.material=null}getImagePath(){return this.imagePath}setMaterial(r){this.material=r}loadMaterial(r){r&&(this.imagePath=r),this.isLoadMaterialFromPath=!1,this.material=null;let o=this;MxFun.loadImageMaterial(this.imagePath,a=>{this.isLoadMaterialFromPath=!1,o.setMaterial(a)})}setPoint1(r){this.pt1=r}getPoint1(){return this.pt1}setPoint2(r){this.pt2=r}getPoint2(){return this.pt2}getGripPoints(){let r=[];r.push(this.pt1),r.push(this.pt2);let o=new THREE.Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y));return r.push(o),r}moveGripPointsAt(r,o){return r==0?this.pt1.add(o):r==1?this.pt2.add(o):r==2&&(this.pt1.add(o),this.pt2.add(o)),!0}dwgIn(r){return this.onDwgIn(r),this.pt1.copy(r.pt1),this.pt2.copy(r.pt2),this.imagePath=r.imagePath.substr(0),this.isLoadMaterialFromPath=!0,r.angle&&(this.angle=r.angle),r.material&&(this.material=r.material),!0}dwgOut(r){return this.onDwgOut(r),r.pt1=this.pt1,r.pt2=this.pt2,r.imagePath=this.imagePath,r.angle=this.angle,r.type==MxType.MxCloneType.kDragClone&&(r.material=this.material),r}create(){return new MxDbImage}}var McGiWorldDrawType;MxDbImage.cmd="Mx_DrawImage",MxDbImage.draw=drawMxDbImage,addRegisterMxDbEntity(MxDbImage),function(w){w[w.kWorldDraw=1]="kWorldDraw",w[w.kDynDragDraw=2]="kDynDragDraw",w[w.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}}function drawMxDbSVG(){return Si(this,null,function*(){const w=new MrxDbgUiPrPoint;w.setMessage(`
|
|
指定一点:`);let r=yield w.go();if(!r)return;let o=new MxDbSVG,a=prompt("请输入svg图片网络或本地地址","https://img.alicdn.com/imgextra/i2/O1CN01FF1t1g1Q3PDWpSm4b_!!6000000001920-55-tps-508-135.svg");if(!a)return;o.setSvgPath(a),o.setSvgPostion(r),o.svgReverse=!0,o.svgMargin.x=.2,o.setSvgAlignmentRatio(new THREE.Vector2(.5,-1)),o.setRenderOrder(100),o.setSvgSize(new THREE.Vector2(50,0));let v=new MxDbSVGText;v.txt="A1",v.txtPos=new THREE.Vector3(0,-30,0),v.txtHeight=30,o.addText(v),o.fixedSize=!0,o.color=65297,MxFun.addToCurrentSpace(o)})}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(r){if(this.svgChildColor=r,!this.useSvgColor&&this.svg){let o=new THREE.Color(this.getColor()),a=0,v=this;this.svg.traverse(function(h){h.material&&(a<v.svgChildColor.length?h.material.color=new THREE.Color(v.svgChildColor[a]):h.material.color=o,a++)}),this.setNeedUpdateDisplay(!0)}}getSvgChildColor(){return this.svgChildColor}calcVewSize(r){let o=this.svgSize.x,a=this.svgSize.y;return a<=0&&(a=this.svgBoxSize?this.svgBoxSize.y/this.svgBoxSize.x*o:o),this.fixedSize&&(o=r.screenCoordLong2Doc(o),a=r.screenCoordLong2Doc(a)),[o,a]}calcSvgDrawRect(r){if(!r)return;this.calcSvgPosition(r);let[o,a]=this.calcVewSize(r),v=new THREE.Matrix4;v.makeScale(this.svgMirror?-1:1,this.svgReverse?-1:1,1);let h=new THREE.Matrix4;h.makeRotationZ(this.svgRotate);let b=new THREE.Matrix4,D=new THREE.Vector3(this.svgPos.x-o*this.svgAlignmentRatio.x,this.svgPos.y-a*this.svgAlignmentRatio.y,0);b.makeTranslation(D.x,D.y,D.z),h.multiply(v),h.premultiply(b);let U=new THREE.Vector3(0,0,0),V=new THREE.Vector3(o,0,0),I=new THREE.Vector3(o,a,0),g=new THREE.Vector3(0,a,0);return U.applyMatrix4(h),V.applyMatrix4(h),I.applyMatrix4(h),g.applyMatrix4(h),{pt1:U,pt2:I,pt3:V,pt4:g,cenpt:I.clone().add(U.clone().sub(I).multiplyScalar(.5)),sizew:o,sizeh:a}}calcImageDrawRect(r){if(!r)return;this.calcSvgPosition(r);let[o,a]=this.calcVewSize(r),v=new THREE.Matrix4;v.makeScale(this.svgMirror?-1:1,this.svgReverse?-1:1,1);let h=new THREE.Matrix4,b=new THREE.Matrix4,D=new THREE.Vector3(this.svgPos.x-o*this.svgAlignmentRatio.x,this.svgPos.y-a*this.svgAlignmentRatio.y,0);b.makeTranslation(D.x,D.y,D.z),h.multiply(v),h.premultiply(b);let U=new THREE.Vector3(0,0,0),V=new THREE.Vector3(o,0,0),I=new THREE.Vector3(o,a,0),g=new THREE.Vector3(0,a,0);return U.applyMatrix4(h),V.applyMatrix4(h),I.applyMatrix4(h),g.applyMatrix4(h),{pt1:U,pt2:I,pt3:V,pt4:g,cenpt:I.clone().add(U.clone().sub(I).multiplyScalar(.5)),sizew:o,sizeh:a}}worldDraw(r){let o,a=r.getMxObject();if(this.imagePath.length>0){if(o=this.calcImageDrawRect(a),Math.abs(this.svgRotate)>1e-5){let g=new THREE.Vector3(.5*(o.pt1.x-o.pt2.x)+o.pt2.x,.5*(o.pt1.y-o.pt2.y)+o.pt2.y),A=new THREE.Matrix4;A.makeRotationZ(this.svgRotate);let M=new THREE.Matrix4().makeTranslation(g.x,g.y,g.z).multiply(A).multiply(new THREE.Matrix4().makeTranslation(-g.x,-g.y,-g.z));r.setMatrix(M)}}else o=this.calcSvgDrawRect(a);let v=o.pt1,h=o.pt2,b=o.pt3,D=o.pt4,U=o.cenpt,V=o.sizew,I=this;if(r.getType()!=McGiWorldDrawType$1.kSelectDraw&&this.aryText.forEach((g,A)=>{if(g.txt.length>0){let F,T=new THREE.Vector3(g.txtPos.x,g.txtPos.y,0);this.fixedSize&&(g.txtPos.x>0?T.x=this.svgPos.x+a.screenCoordLong2Doc(g.txtPos.x):T.x=this.svgPos.x-a.screenCoordLong2Doc(g.txtPos.x),g.txtPos.y>0?T.y=this.svgPos.y+a.screenCoordLong2Doc(g.txtPos.y):T.y=this.svgPos.y-a.screenCoordLong2Doc(g.txtPos.y)),g.color&&(F=r.getColor(),r.setColor(g.color));let _=g.txtHeight;I.fixedSize&&(_=a.screenCoordLong2Doc(g.txtHeight)),r.setXData({type:"text",txt:g.txt,index:A});let Y=r.drawText(g.txt,_,0,T,void 0,k=>g.fontStyle.length>0?`${g.fontStyle} ${k}px Arial`:`normal ${k}px Arial`);if(r.getType()==McGiWorldDrawType$1.kWorldDraw&&(g._txtObject=Y),g.underline&&g._txtObject){const k=new THREE.Box3;k.expandByObject(g._txtObject);let S=new THREE.Vector3(k.min.x,k.min.y+.1*_,0),G=new THREE.Vector3(k.max.x,k.min.y+.1*_,0);var M=new THREE.Geometry;let C=new THREE.LineBasicMaterial({color:r.getColor(),transparent:!0,depthTest:!1});M.vertices.push(S,G);var N=new THREE.Line(M,C);r.drawEntity(N),r.getType()==McGiWorldDrawType$1.kWorldDraw&&(g._underLine=N)}if(g._txtAspectRatio=-1,F&&r.setColor(F),g.drawConnectingLine){let k=U.clone().sub(T);if(k.length()>_+V){k.normalize();let S=U.clone().sub(k.clone().multiplyScalar(V)),G=T.clone().add(k.clone().multiplyScalar(_));M=new THREE.Geometry;let C=new THREE.LineBasicMaterial({color:r.getColor(),transparent:!0,depthTest:!1});M.vertices.push(S,G),N=new THREE.Line(M,C),r.setXData({type:"line"}),r.drawEntity(N),r.getType()==McGiWorldDrawType$1.kWorldDraw&&(g._connectingLine=N)}}}}),r.getType()==1){if(this.svg)r.setXData({type:"svg"}),r.drawEntity(this.svg);else if(this.svgPath.length>0&&this.isLoadFromPath){let g=this,A=r.getMxObject();MxThreeJS.loadSVG(this.svgPath,void 0,M=>{if(M){let N=M;if(N.boxSize)g.svgBoxSize=N.boxSize.clone();else{let k=new THREE.Box3().setFromObject(M);g.svgBoxSize||(g.svgBoxSize=new THREE.Vector3),g.svgBoxSize.x=k.max.x-k.min.x,g.svgBoxSize.y=k.max.y-k.min.y}let[F,T]=g.calcVewSize(a);g.svgBoxSize&&(M.scale.x=F/g.svgBoxSize.x,M.scale.y=T/g.svgBoxSize.y),M.scale.z=M.scale.x,g.svgReverse&&(M.scale.y*=-1),g.svgMirror&&(M.scale.x*=-1),M.rotateZ(g.svgRotate),g.isSvgDirtyLocation=!0;let _=new THREE.Color(r.getColor()),Y=0;M.traverse(function(k){k.material&&(k.material=k.material.clone(),k.material.transparent=!0,k.material.depthTest=!1,g.useSvgColor||(Y<g.svgChildColor.length?k.material.color=new THREE.Color(g.svgChildColor[Y]):k.material.color=_),Y++)}),g.svg=M,g.setNeedUpdateDisplay(),A.updateDisplay()}else console.log("mx LoadSVG:"+g.svgPath+" failed");g.isLoadFromPath=!1})}else if(this.material){let g=Math.abs(v.x-h.x),A=Math.abs(v.y-h.y),M=new THREE.PlaneGeometry(g,A),N=Math.min(v.x,h.x),F=Math.min(v.y,h.y);for(let _=0;_<M.vertices.length;_++)M.vertices[_].x+=N+.5*g,M.vertices[_].y+=F+.5*A,M.vertices[_].z=0;let T=new THREE.Mesh(M,this.material);T.material.depthTest=!1,r.drawEntity(T)}else if(this.isLoadMaterialFromPath&&this.imagePath.length>0){let g=this,A=r.getMxObject();MxFun.loadImageMaterial(this.imagePath,M=>{this.isLoadMaterialFromPath=!1,M&&(g.material=M,g.setNeedUpdateDisplay(),A.updateDisplay())})}this.fixedSize||(r.drawSelectLine(v,h),r.drawSelectLine(b,D),r.drawSelectLine(v,b),r.drawSelectLine(b,h),r.drawSelectLine(h,D),r.drawSelectLine(D,v))}else r.drawLine(v,b),r.drawLine(b,h),r.drawLine(h,D),r.drawLine(D,v);this.imagePath.length>0&&r.setMatrix(null)}setSvgPath(r,o=!1){return Si(this,null,function*(){this.svgPath=r,this.svg=null,this.isLoadFromPath=!0,this.svgBoxSize=null,o&&(yield MxThreeJS.loadSVG(r))})}getSvgPath(){return this.svgPath}setSvgPostion(r){this.svgPos=r.clone(),this.isSvgDirtyLocation=!0}setImagePath(r,o){this.imagePath=r,o?(this.material=o,this.isLoadMaterialFromPath=!1):(this.material=null,this.isLoadMaterialFromPath=!0)}getImagePath(){return this.imagePath}getSvgPostion(){return this.svgPos}setSvgSize(r){this.svgSize=r,this.isSvgDirtyLocation=!0}getSvgSize(){return this.svgSize}setSvgAlignmentRatio(r){this.svgAlignmentRatio=r,this.isSvgDirtyLocation=!0}getSvgAlignmentRatio(){return this.svgAlignmentRatio}getText(r){return r<this.aryText.length?this.aryText[r]:null}addText(r){this.aryText.push(r)}getGripPoints(){let r=[];r.push(this.svgPos);let o=0;for(;o<this.aryText.length;o++){let a=this.aryText[o];if(a.move){let v=new THREE.Vector3(a.txtPos.x,a.txtPos.y,0);if(this.fixedSize){let h=MxFun.getCurrentDraw();a.txtPos.x>0?v.x=this.svgPos.x+h.screenCoordLong2Doc(a.txtPos.x):v.x=this.svgPos.x-h.screenCoordLong2Doc(a.txtPos.x),a.txtPos.y>0?v.y=this.svgPos.y+h.screenCoordLong2Doc(a.txtPos.y):v.y=this.svgPos.y-h.screenCoordLong2Doc(a.txtPos.y)}r.push(v)}}return r}moveGripPointsAt(r,o){if(r==0)this.svgPos.add(o),this.fixedSize||this.aryText.forEach(a=>{a.txtPos.add(o)});else if(r-1>=0&&r-1<this.aryText.length){let a=this.aryText[r-1];if(a.move)if(this.fixedSize){let v=MxFun.getCurrentDraw();a.txtPos.x+=v.docCoordLong2Screen(o.x),a.txtPos.y+=v.docCoordLong2Screen(o.y)}else a.txtPos.add(o)}return this.isSvgDirtyLocation=!0,!0}calcSvgPosition(r){if(!this.svg||!this.isSvgDirtyLocation)return;this.isSvgDirtyLocation=!1;let[o,a]=this.calcVewSize(r);this.svg.position.x=this.svgPos.x-o*this.svgAlignmentRatio.x-this.svgMargin.x*o,this.svg.position.y=this.svgPos.y-a*this.svgAlignmentRatio.y-this.svgMargin.y*a}dwgIn(r){this.onDwgIn(r),this.fixedSize=r.fixedSize,this.fixedSize?this.svg=null:r.type==MxType.MxCloneType.kClone&&r.svg&&(this.svg=r.svg.clone()),this.svgPos.copy(r.svgPos),this.svgPath=r.svgPath.substr(0),this.svgSize.copy(r.svgSize),this.svgAlignmentRatio.copy(r.svgAlignmentRatio),this.isSvgDirtyLocation=!0,this.svg||(this.isLoadFromPath=!0),this.svgBoxSize=null;let o=r.txts;return this.aryText=[],o.forEach(a=>{let v=new MxDbSVGText;v.txt=a.txt,v.txtHeight=a.txtHeight,v.txtPos.copy(a.txtPos),v.move=a.move,v.drawConnectingLine=a.drawConnectingLine,this.aryText.push(v)}),this.svgRotate=r.svgRotate,this.useSvgColor=r.useSvgColor,this.svgReverse=r.svgReverse,this.svgMirror=r.svgMirror,this.svgMargin=r.svgMargin,r.svgChildColor?this.svgChildColor=r.svgChildColor:this.svgChildColor=[],this.imagePath=r.imagePath.substr(0),this.isLoadMaterialFromPath=!0,r.material&&(this.material=r.material),!0}dwgOut(r){this.onDwgOut(r);let o,a=this.getMxObject();return r.type==MxType.MxCloneType.kClone&&(r.svg=this.svg),r.svgPath=this.svgPath,r.svgPos=this.svgPos,r.svgSize=this.svgSize,r.svgAlignmentRatio=this.svgAlignmentRatio,r.txts=[],r.type==MxType.MxCloneType.kSaveDwgClone&&a&&(o=this.calcSvgDrawRect(a)),this.aryText.forEach(v=>{let h={txtPos:v.txtPos,txt:v.txt,txtHeight:v.txtHeight,color:v.color,_txtAspectRatio:v._txtAspectRatio,move:v.move,drawConnectingLine:v.drawConnectingLine};r.type==MxType.MxCloneType.kSaveDwgClone&&(v._connectingLine&&(h.connectingLine=v._connectingLine.geometry.vertice),v._underLine&&(h._underLine=v._underLine.geometry.vertice)),r.txts.push(h)}),r.fixedSize=this.fixedSize,r.svgRotate=this.svgRotate,r.useSvgColor=this.useSvgColor,r.svgReverse=this.svgReverse,r.svgMirror=this.svgMirror,r.svgMargin=this.svgMargin,r.svgChildColor=this.svgChildColor,r.type==MxType.MxCloneType.kSaveDwgClone&&(r.svgRect=o),r.imagePath=this.imagePath,r.type==MxType.MxCloneType.kDragClone&&(r.material=this.material),r}create(){return new MxDbSVG}transformBy(r){this.svgPos.applyMatrix4(r),this.isSvgDirtyLocation=!0,this.fixedSize||this.aryText.forEach(o=>{o.txtPos.applyMatrix4(r)})}getTypeName(){return"MxDbSVG"}setColor(r){if(super.setColor(r),this.svg){let o=new THREE.Color(this.color);this.svg.traverse(function(a){a.material&&(a.material.color=o)})}return this}setSvg(r){this.svg=r,this.isLoadFromPath=!1,this.svgBoxSize=null}calcSvgBoxSize(r){if(!this.svgBoxSize)if(r.boxSize)this.svgBoxSize=r.boxSize.clone();else{let o=new THREE.Box3().setFromObject(r);this.svgBoxSize||(this.svgBoxSize=new THREE.Vector3),this.svgBoxSize.x=o.max.x-o.min.x,this.svgBoxSize.y=o.max.y-o.min.y}}reComputeSVG(){if(!this.svg)return;let r=this.getMxObject();if(!r)return;this.calcSvgBoxSize(this.svg);let[o,a]=this.calcVewSize(r);this.svgBoxSize&&(this.svg.scale.x=o/this.svgBoxSize.x,this.svg.scale.y=a/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(r)}onViewChange(){if(!this.fixedSize)return!1;if(this.imagePath.length>0)return this.setNeedUpdateDisplay(!1),!0;let r=this.getMxObject();if(r==null)return!1;if(this.svg){this.calcSvgBoxSize(this.svg);let[b,D]=this.calcVewSize(r);this.svgBoxSize&&(this.svg.scale.x=b/this.svgBoxSize.x,this.svg.scale.y=D/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(r)}let o=this.calcSvgDrawRect(r),a=o.cenpt,v=o.sizew,h=this;return this.aryText.forEach(b=>{if(b._txtObject&&r){let U=r.screenCoordLong2Doc(b.txtHeight);if(U>1e-5){b._txtAspectRatio<=0&&(b._txtAspectRatio=b._txtObject.scale.x/b._txtObject.scale.y),b._txtObject.scale.set(b._txtAspectRatio*U*1.5,1.5*U,1),b.txtPos.x>0?b._txtObject.position.x=h.svgPos.x+r.screenCoordLong2Doc(b.txtPos.x):b._txtObject.position.x=h.svgPos.x-r.screenCoordLong2Doc(b.txtPos.x),b.txtPos.y>0?b._txtObject.position.y=h.svgPos.y+r.screenCoordLong2Doc(b.txtPos.y):b._txtObject.position.y=h.svgPos.y-r.screenCoordLong2Doc(b.txtPos.y);let V=b._txtObject.position;if(b._txtObject.updateMatrix(),b._underLine){const I=new THREE.Box3;let g=b._txtObject.parent;b._txtObject.parent=null,I.expandByObject(b._txtObject),b._txtObject.parent=g;let A=new THREE.Vector3(I.min.x,I.min.y+.1*U,0),M=new THREE.Vector3(I.max.x,I.min.y+.1*U,0);(D=new THREE.Geometry).vertices.push(A,M),b._underLine.geometry=D}if(b._connectingLine){let I=a.clone().sub(V);I.normalize();let g=a.clone().sub(I.clone().multiplyScalar(v)),A=V.clone().add(I.clone().multiplyScalar(U));var D;(D=new THREE.Geometry).vertices.push(g,A),b._connectingLine.geometry=D}}}}),!0}}function drawMxDbPolyline(){const w=new MrxDbgUiPrPoint;w.setMessage(`
|
|
指定第一点:`);let r,o=new MxDbPolyline;w.go(a=>{if(a!=0)return;let v=w.value();r||(r=v.clone());let h=v;const b=new McEdGetPointWorldDrawObject;b.setDraw((U,V)=>{V.setColor(16711680),V.drawLine(h,U),V.drawCustomEntity(o)}),w.setUserDraw(b),w.setMessage(`
|
|
指定下一点:`);let D=0;o.addVertexAt(v),w.goWhile(U=>{if(U==0)h=w.value(),o.addVertexAt(h),++D>=2?(w.setMessage(`
|
|
指定下一点:`),w.setKeyWords("[闭合(C)/放弃(U)]")):D>0?(w.setMessage(`
|
|
指定下一点:`),w.setKeyWords("[放弃(U)]")):(w.setMessage(`
|
|
指定第一点:`),w.setKeyWords(""));else if(U==1){if(w.isKeyWordPicked("C"))return{exit:!0};w.isKeyWordPicked("U")&&console.log("Mx_Line undo....")}},()=>{MxFun.getCurrentDraw().addMxEntity(o)})})}MxDbSVG.cmd="Mx_ModelFixedSvg",MxDbSVG.draw=drawMxDbSVG,addRegisterMxDbEntity(MxDbSVG);class MxDbPolyline extends MxDbEntity{constructor(){super(...arguments),this.points=[]}getTypeName(){return"MxDbPolyline"}worldDraw(r){this.points.length<2||r.drawLines(this.points)}getGripPoints(){return this.points}moveGripPointsAt(r,o){return!(r>=this.points.length||(this.points[r].add(o),0))}create(){return new MxDbPolyline}dwgIn(r){this.onDwgIn(r);let o=r.points;return this.points=[],o.forEach(a=>{this.points.push(new THREE.Vector3(a.x,a.y,a.z))}),!0}dwgOut(r){return this.onDwgOut(r),r.points=this.points,r}addVertexAt(r){this.points.push(r)}numVerts(){return this.points.length}getPointAt(r){return r<this.points.length?this.points[r]:null}setPointAt(r,o){return r<this.points.length&&(this.points[r]=o,!0)}}function drawMxDb2LineAngularDimension(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new MxDb2LineAngularDimension,a=new McEdGetPointWorldDrawObject;return w.setMessage(`
|
|
指定第一点:`),w.go(v=>{v===0&&(w.setMessage(`
|
|
指定第二个角度点:`),o.point1=w.value(),a.setDraw((h,b)=>{o.point2=h,a.drawLine(o.point1,h)}),w.setUserDraw(a),w.go(h=>{w.setMessage(`
|
|
指定最后一个点:`),h===0&&(o.point2=w.value(),a.setDraw((b,D)=>{o.point3=b,a.drawCustomEntity(o)}),w.go(b=>{b===0&&r.addMxEntity(o)}))}))}),o}MxDbPolyline.cmd="Mx_Lines",MxDbPolyline.draw=drawMxDbPolyline,addRegisterMxDbEntity(MxDbPolyline);const propertyDbKeys$6=["colors","point1","point2","point3"];class MxDb2LineAngularDimension extends MxDbEntity{constructor(r){if(super(),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.point3=new THREE.Vector3,this.colors=[],r){const{points:o,colors:a}=r;o&&this.setPoints(o),a&&this.setColor(a)}}calculateLineAngle(r,o,a){const v=2*Math.PI/360;return{startAngle:180*Math.atan2(o.y-r.y,o.x-r.x)/Math.PI*v,endAngle:180*Math.atan2(a.y-r.y,a.x-r.x)/Math.PI*v}}setPoints(r){const[o,a,v]=r;return o&&(this.point1=o),a&&(this.point2=a),v&&(this.point3=v),this}setColor(r){return lodash.isArray(r)?this.colors=r:this.color=r,this}worldDraw(r){if(r.getType()==McGiWorldDrawType$1.kWorldDraw||r.getType()==McGiWorldDrawType$1.kDynDragDraw){const[o,a,v,h]=this.colors||[],b=this.getColor(),D=r.getMxObject();r.setOpacity(this.opacity),r.setColor(o||b),r.drawLine(this.point1,this.point2),r.setColor(a||b),r.drawLine(this.point2,this.point3);const{startAngle:U,endAngle:V}=this.calculateLineAngle(this.point2,this.point1,this.point3),I=this.point2.distanceTo(this.point1),g=this.point2.distanceTo(this.point3),A=Math.min(I,g)/4;let M=THREE.MathUtils.radToDeg(U-V);M<0&&(M+=360);let N=D.screenCoordLong2Doc(50);const F=new THREE.ArcCurve(this.point2.x,this.point2.y,A,U,V,!0),T=new THREE.Geometry().setFromPoints(F.getPoints(50));r.setColor(v||b),r.drawGeometryLines(T);const _=F.getPoint(.5);let Y=new THREE.Vector3(_.x,_.y,0);const k=Y.sub(this.point2),S=k.length()+.5*N;k.normalize().multiplyScalar(S),Y=this.point2.clone().add(k),r.setColor(h||b),r.drawText(M.toFixed(3)+"°",.5*N,0,Y)}else r.drawLine(this.point1,this.point2),r.drawLine(this.point3,this.point2)}getGripPoints(){return[this.point1,this.point2,this.point3]}moveGripPointsAt(r,o){return r===0?this.point1.add(o):r===1?this.point2.add(o):r===2&&this.point3.add(o),!0}dwgIn(r){return this.onDwgIn(r),this.dwgInHelp(r,propertyDbKeys$6),!0}dwgOut(r){return this.onDwgOut(r),this.dwgOutHelp(r,propertyDbKeys$6),r}create(){return new MxDb2LineAngularDimension}transformBy(r){this.point1.applyMatrix4(r),this.point2.applyMatrix4(r)}getTypeName(){return"MxDb2LineAngularDimension"}}MxDb2LineAngularDimension.cmd="Mx_AngleSurveying",MxDb2LineAngularDimension.draw=drawMxDb2LineAngularDimension,addRegisterMxDbEntity(MxDb2LineAngularDimension);class MxFilters{constructor(){this.uniformObj={},this.filtersStr="",this.filtersTypes="",this.VSHADER_SOURCE=`
|
|
varying vec2 v_Uv;
|
|
void main () {
|
|
v_Uv = uv;
|
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
}
|
|
`,this.FSHADER_SOURCE=`
|
|
varying vec2 v_Uv;
|
|
uniform sampler2D e_Texture;
|
|
uniform mat4 colorMatrix;
|
|
${this.filtersStr}
|
|
void main () {
|
|
vec4 color = texture2D( e_Texture, v_Uv );
|
|
color = color * colorMatrix;
|
|
${this.filtersTypes}
|
|
gl_FragColor = color;
|
|
}`,this._matrix=new THREE.Matrix4}channel({r=1,g:o=1,b:a=1}){return this._matrix=new THREE.Matrix4().set(r,0,0,0,0,o,0,0,0,0,a,0,0,0,0,1).multiply(this._matrix),this}brightness(r){return this._matrix=new THREE.Matrix4().set(r,0,0,0,0,r,0,0,0,0,r,0,0,0,0,1).multiply(this._matrix),this}saturate(r){const o=.2126*(1-r),a=.7152*(1-r),v=.0722*(1-r);return this._matrix=new THREE.Matrix4().set(o+r,a,v,0,o,a+r,v,0,o,a,v+r,0,0,0,0,1).multiply(this._matrix),this}contrast(r){const o=.5*(1-r);return this._matrix=new THREE.Matrix4().set(r,0,0,0,0,r,0,0,0,0,r,0,o,o,o,1).multiply(this._matrix),this}opacity(r){return this._matrix=new THREE.Matrix4().set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,r).multiply(this._matrix),this}invert(r){const o=1-2*r;return this._matrix=new THREE.Matrix4().set(o,0,0,0,0,o,0,0,0,0,o,0,r,r,r,1).multiply(this._matrix),this}grayscale(r=1){const o=.2126*r,a=.7152*r,v=.0722*r;return this._matrix=new THREE.Matrix4().set(o+1-r,a,v,0,o,a+1-r,v,0,o,a,v+1-r,0,0,0,0,1).multiply(this._matrix),this}sepia(r=1){return this._matrix=new THREE.Matrix4().set(1-.607*r,.769*r,.189*r,0,.349*r,1-.314*r,.168*r,0,.272*r,.534*r,1-.869*r,0,0,0,0,1).multiply(this._matrix),this}hueRotate(r){const o=r/180*Math.PI,a=Math.cos(o),v=Math.sin(o),h=.2126,b=.7152,D=.0722;return this._matrix=new THREE.Matrix4().set(h+.7874*a+v*-h,b+a*-b+v*-b,D+a*-D+.9278*v,0,h+a*-h+.143*v,b+a*(1-b)+.14*v,D+a*-D+-.283*v,0,h+a*-h+-.7874*v,b+a*-b+v*b,D+.9278*a+v*D,0,0,0,0,1).multiply(this._matrix),this}convolution(r,o=1/9,a=521){return this.uniformObj=Object.assign(Object.assign({},this.uniformObj),{cKernel:{value:r.toArray()},stStep:{value:o},scaleFactor:{value:a}}),this.filtersTypes.indexOf("convolutionTextureColor")<0&&(this.filtersStr+=`
|
|
uniform float cKernel[9];
|
|
uniform float stStep;
|
|
uniform float scaleFactor;
|
|
vec4 convolutionTextureColor(vec4 color) {
|
|
vec2 offsets[9];
|
|
offsets[0] = vec2(-1.0,-1.0);
|
|
offsets[1] = vec2(0.0,-1.0);
|
|
offsets[2] = vec2(1.0,-1.0);
|
|
offsets[3] = vec2(-1.0,0.0);
|
|
offsets[4] = vec2(0.0,0.0);
|
|
offsets[5] = vec2(1.0,0.0);
|
|
offsets[6] = vec2(-1.0,1.0);
|
|
offsets[7] = vec2(0.0,1.0);
|
|
offsets[8] = vec2(1.0,1.0);
|
|
|
|
vec4 sum = color;
|
|
for(int i = 0; i < 9; i++) {
|
|
sum = sum + cKernel[i] * scaleFactor * texture2D(e_Texture, v_Uv + offsets[i] / stStep);
|
|
};
|
|
return sum;
|
|
}`,this.filtersTypes+=`color = convolutionTextureColor(color);
|
|
`),this}reset(){return this.uniformObj={},this.filtersStr="",this.filtersTypes="",this._matrix=new THREE.Matrix4,this}_getFilterShaderData(r){return{uniforms:Object.assign({e_Texture:{value:r},colorMatrix:{value:this._matrix}},this.uniformObj),vertexShader:this.VSHADER_SOURCE,fragmentShader:this.FSHADER_SOURCE}}_getFilterColor(r="#000000",o=1){r=new THREE.Color(r);let{r:a,g:v,b:h}=r;const b=this._matrix.toArray();b[12],b[13],b[14],b[15];const D=b[0]*a+b[1]*a+b[2]*a+b[3]*o,U=b[4]*v+b[5]*v+b[6]*v+b[7]*o,V=b[8]*h+b[9]*h+b[10]*h+b[11]*o;return r.setRGB(D,U,V),r}toJSON(){return JSON.stringify({matrix:this._matrix.toArray(),uniformObj:this.uniformObj,filtersStr:this.filtersStr,filtersTypes:this.filtersTypes})}static fromJSON(r){const{matrix:o,uniformObj:a,filtersStr:v,filtersTypes:h}=JSON.parse(r),b=new MxFilters;return b._matrix=new THREE.Matrix4().fromArray(o),b.uniformObj=a,b.filtersStr=v,b.filtersTypes=h,b}}class MxDbShape extends MxDbEntity{constructor(){super(...arguments),this.isLoadMaterialFromPath=!0,this.stroke="#fff",this.strokeLineWidth=2,this.isStrokeDashLine=!1,this.isFill=!1,this._fillImageSrc=null,this.curveSegments=50,this.closed=!0,this.filter=null,this._cornerRadius=[],this._propertyDbKeys=["isFill","stroke","strokeLineWidth","isStrokeDashLine","closed","cornerRadius","fillImageSrc","fillImageParam","curveSegments"]}setStroke(r){return this.stroke=r,this}setStrokeLineWidth(r){return this.strokeLineWidth=r,this}setIsStrokeDashLine(r){return this.isStrokeDashLine=r,this}setIsFill(r){return this.isFill=r,this}get fillImageSrc(){return this._fillImageSrc}set fillImageSrc(r){this._fillImageSrc=r,this.isLoadMaterialFromPath=!0,this.material=null,this.fillImageSrc&&(this.isFill=!0),r!==!1&&r!==null||(this.setNeedUpdateDisplay(),MxFun.updateDisplay())}setFillImageSrc(r){return this.fillImageSrc=r,this}setFillImageParam(r){this.fillImageParam=r===void 0?r:Object.assign(this.fillImageParam,r)}setCurveSegments(r){return this.curveSegments=r,this}setClosed(r){return this.closed=r,this}getFilter(){return this.filter}setFilter(r){this.filter=r,this.isLoadMaterialFromPath=!0,this.material=null}get cornerRadius(){return this._cornerRadius}set cornerRadius(r){this.setCornerRadius(r)}setCornerRadius(r,o=!0){this._cornerRadius=r instanceof Array?r.map(a=>o?MxFun.screenCoordLong2Doc(a):a):o?MxFun.screenCoordLong2Doc(r):r}getTypeName(){return"MxDbShape"}getShapePoints(r){const{curveSegments:o}=this;return this.points=r.getPoints(o).map(a=>a instanceof THREE.Vector2?new THREE.Vector3(a.x,a.y,0):a),this.points}createPaths(r){return this._paths=new THREE.CurvePath,Array.isArray(r)?r.forEach(o=>this._paths.add(o)):this._paths.add(r),this._paths}_draw(r,o){let{isFill:a,closed:v,opacity:h,dLineWidth:b,lineWidthByPixels:D}=this;r.setOpacity(h),r.setLineWidthByPixels(D),r.setLineWidth(b);const U=r.getColor();r.setColor(this.filter?this.filter._getFilterColor(this.color,this.opacity):this.color);const V=this.getCornerRadiusPoints(v||a?this.getClosedPoints(o):o);a?!this.fillImageSrc&&r.drawSolid(V):r.drawLines(V),this._fillImg(r,V),r.setColor(U)}getCornerRadiusPoints(r){const{cornerRadius:o}=this;if(!o)return r;const a=typeof o=="number"?r.map(()=>o):o;return a.length>0?getToGenerateRoundedCorners(r,a):r}_drawStoreLine(r,o,a){const{isFill:v,stroke:h,strokeLineWidth:b}=this,D=r.getLineWidth(),U=r.getColor(),V=r.isDashLineDisplay();h&&v&&(r.setDashLineDisplay(this.isStrokeDashLine),r.setColor(h),r.setLineWidth(b),a?a(r):r.drawLines(this.getCornerRadiusPoints(this.getClosedPoints(o))),r.setColor(U),r.setLineWidth(D),r.setDashLineDisplay(V))}getClosedPoints(r){return[...r,r[0]]}getTotalLength(){if(this.points){let r=0;return this.points.reduce((o,a)=>(r+=o.distanceTo(a),a)),r}if(this._paths)return this._paths.getLength()+(this.closedLine?this.closedLine.getLength():0)}getGetLength(){return this._paths.getLength()}getArea(){return this.points?McGeTool.calcArea(this.closed?this.getClosedPoints(this.points):this.points):0}worldDraw(r){const o=this.createPaths(new THREE.Curve),a=this.getShapePoints(o);this._draw(r,a),this._drawStoreLine(r,a)}_fillImg(r,o){const a={transparent:!0,depthTest:!1,opacity:this.opacity,visible:this.visible};if(!this.isFill||!this.fillImageSrc)return;if(!this.material){let U=this;return void MxFun.loadImageMaterial(this.fillImageSrc,V=>{U.isLoadMaterialFromPath=!1,V&&(U.material=V,U.setNeedUpdateDisplay(),MxFun.updateDisplay())})}const v=o.map(({x:U,y:V})=>new THREE.Vector2(U,V));let h=this.material,b=new THREE.ShapeGeometry(new THREE.Shape(v));if(b=repairGeometryFaceVertexUvs(b),this.filter){const U=h.map,V=this.filter._getFilterShaderData(U);h=new THREE.ShaderMaterial(Object.assign(Object.assign({},V),a))}if(h.depthTest=!1,h.transparent=!0,h.opacity=this.opacity,h.visible=this.visible,this.fillImageParam){const U=this.fillImageParam;for(let V in this.fillImageParam)this.material.map[V]=U[V]}let D=new THREE.Mesh(b,h);r.drawEntity(D)}getGripPoints(){return[]}moveGripPointsAt(r,o){return!0}dwgIn(r){return this.onDwgIn(r),this.dwgInHelp(r,this._propertyDbKeys),this.isLoadMaterialFromPath=!0,this.material=null,r.type===MxType.MxCloneType.kMxFileClone?r.filter&&(this.filter=MxFilters.fromJSON(r.filter)):r.filter&&(this.filter=r.filter),!0}dwgOut(r){var o;return this.onDwgOut(r),this.dwgOutHelp(r,this._propertyDbKeys),r.type===MxType.MxCloneType.kMxFileClone?this.filter&&(r.filter=(o=this.filter)===null||o===void 0?void 0:o.toJSON()):r.filter=this.filter,r}transformBy(r){this.points&&this.points.forEach(o=>{o.applyMatrix4(r)})}}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(r){return this.center=r,this}setXRadius(r){return this.xRadius=r,this}setYRadius(r){return this.yRadius=r,this}setStartAngle(r){return this.startAngle=r,this}setEndAngle(r){return this.endAngle=r,this}setClockwise(r){return this.clockwise=r,this}setRotation(r){return this.rotation=r,this}setIsClosedToCenter(r){return this.isClosedToCenter=r,this}worldDraw(r){this.drawEllipseShape(r)}drawEllipseShape(r){let{startAngle:o,endAngle:a,clockwise:v}=this;const h=this.createEllipseCurve(),b=this.createPaths(h);let D=this.getShapePoints(b);return this._draw(r,D),this._drawStoreLine(r,D),{centralAngle:v?a>o?THREE.MathUtils.radToDeg(h.aEndAngle-h.aStartAngle):360-Math.abs(THREE.MathUtils.radToDeg(h.aEndAngle-h.aStartAngle)):o>a?Math.abs(THREE.MathUtils.radToDeg(h.aEndAngle-h.aStartAngle)):360-THREE.MathUtils.radToDeg(h.aEndAngle-h.aStartAngle),curve:h,points:D}}createEllipseCurve(r=this.center.x,o=this.center.y,a=this.xRadius,v=this.yRadius,h=this.startAngle,b=this.endAngle,D=this.clockwise,U=this.rotation){return new THREE.EllipseCurve(r,o,a,v,h,b,D,U)}getCornerRadiusPoints(r){return r}getClosedPoints(r){try{let o=(this._paths||new THREE.CatmullRomCurve3(r,!1,"catmullrom",0)).getLength();this.closedLine=this.getClosedLine(r);const a=this.closedLine.getLength();let v=this.curveSegments/o,h=2.5*(o>this.curveSegments?a*v:1);if(h>20*this.curveSegments&&(h=20*this.curveSegments),h<=0)return r;const b=this.closedLine.getPoints(h);return[...r,...b]}catch(o){return[...r,r[0]]}}getClosedLine(r){const{isClosedToCenter:o,center:a}=this;let v=o?[r[r.length-1],a,r[0]]:[r[r.length-1],r[0]];return new THREE.CatmullRomCurve3(v,!1,"catmullrom",.01)}getGripPoints(){return[this.center]}moveGripPointsAt(r,o){return r===0&&this.center.add(o),!0}}addRegisterMxDbEntity(MxDbEllipseShape);class MxDbCircleShape extends MxDbEllipseShape{getTypeName(){return"MxDbCircleShape"}get radius(){return this.xRadius}set radius(r){this.xRadius=r,this.yRadius=r}setRadius(r){return this.radius=r,this}setXRadius(r){return this.setRadius(r),this}setYRadius(r){return this.setRadius(r),this}}function drawMx3PointArc(){const w=new MrxDbgUiPrPoint,r=new McEdGetPointWorldDrawObject,o=new Mx3PointArc;w.setUserDraw(r),w.setMessage(`
|
|
确定圆弧开始点:`),w.go(a=>{a===MrxDbgUiPrBaseReturn$1.kOk&&(o.point1=w.value(),r.setDraw(v=>{r.drawLine(o.point1,v)})),w.setMessage(`
|
|
确定圆弧结束点:`),w.go(v=>{v===MrxDbgUiPrBaseReturn$1.kOk&&(o.point2=w.value(),r.setDraw(h=>{o.point3=h,r.drawCustomEntity(o)})),w.setMessage(`
|
|
确定圆弧上任意一点:`),w.go(h=>{if(h===MrxDbgUiPrBaseReturn$1.kOk){MxFun.getCurrentDraw().addMxEntity(o);const{radius:b,angle:D,arcLength:U}=createThreePointArc(o.point1,o.point2,o.point3,!0);console.log("半径:",b),console.log("圆弧弧长:",U,o.getTotalLength())}})})})}addRegisterMxDbEntity(MxDbCircleShape);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.closed=!1,this.centralAngle=0,this._propertyDbKeys=[...this._propertyDbKeys,"point1","point2","point3","autoClockwise"]}getTypeName(){return"Mx3PointArc"}create(){return new Mx3PointArc}worldDraw(r){this.updateDataInfo();const{centralAngle:o}=this.drawEllipseShape(r);this.centralAngle=o}getGripPoints(){return[this.point1,this.point2,this.point3,this.center]}compute3PointAngle(r=this.point1,o=this.point2,a=this.point3){const v=calculateArcAngle(r,this.center,this.radius),h=calculateArcAngle(o,this.center,this.radius),b=calculateArcAngle(a,this.center,this.radius);return[v.angle,h.angle,b.angle]}upDateCenter(r=this.point1,o=this.point2,a=this.point3){return this.center=calculateArcOrigin(r,o,a),this.center}upDateRadius(r=this.point1){return this.radius=calculateRadiusArc(r,this.center),this.radius}upDataClockwise(r,o,a){const{autoClockwise:v}=this;v&&(this.clockwise=judgementArcRenderDirection(o,r,a))}updateDataInfo(){this.upDateCenter(this.point1,this.point2,this.point3),this.upDateRadius(this.point1);const[r,o,a]=this.compute3PointAngle();this.startAngle=THREE.MathUtils.degToRad(r),this.endAngle=THREE.MathUtils.degToRad(o),this.upDataClockwise(r,o,a)}getArcMidPoint(){const r=MxFun.getMxFunTHREE();this.updateDataInfo();let{startAngle:o,endAngle:a,center:v,radius:h,clockwise:b}=this;b?o<a&&(o+=2*Math.PI):o>a&&(a+=2*Math.PI);const D=(o+a)/2,U=v.x+h*Math.cos(D),V=v.y+h*Math.sin(D);return new r.Vector3(U,V,0)}moveGripPointsAt(r,o){return r===0?this.point1.add(o):r===1?this.point2.add(o):r===2?this.point3.add(o):r===3&&(this.point1.add(o),this.point2.add(o),this.point3.add(o)),this.upDateCenter(),!0}}Mx3PointArc.cmd="Mx_3PointArc",Mx3PointArc.draw=drawMx3PointArc,Mx3PointArc.isRegister=!1,addRegisterMxDbEntity(Mx3PointArc);const drawMx2PointArc=()=>Si(void 0,null,function*(){const w=new MrxDbgUiPrPoint,r=new Mx2PointArc,o=yield w.go();if(!o)return;r.startPoint=o,w.setUserDraw((v,h)=>{r.endPoint=v,h.drawCustomEntity(r)});const a=yield w.go();a&&(r.endPoint=a,MxFun.getCurrentDraw().addMxEntity(r))});class Mx2PointArc extends Mx3PointArc{getTypeName(){return"Mx2PointArc"}create(){return new Mx2PointArc}get startPoint(){return this.point1}set startPoint(r){this.point1=r,this.point3.x,this.point1.x,this.point3.y,this.point2.y}get endPoint(){return this.point2}set endPoint(r){this.point2=r,this.point3=this.getArcMidPoint()}}function drawMxDbCoord(){const w=new MrxDbgUiPrPoint;w.setMessage(`
|
|
指定坐标点:`),w.go(r=>{if(r!=0)return;const o=w.value();let a=new MxDbCoord;a.point1=o,a.point2=o.clone(),w.setBasePt(o),w.setUseBasePt(!0),w.setUserDraw((v,h)=>{a.point2=v,h.drawCustomEntity(a)}),w.setMessage(`
|
|
指定标注点:`),w.go(v=>{v==0?(a.point2=w.value(),MxFun.addToCurrentSpace(a)):console.log(v)})})}Mx2PointArc.cmd="Mx_2PointArc",Mx2PointArc.draw=drawMx2PointArc,Mx2PointArc.isRegister=!1,addRegisterMxDbEntity(Mx2PointArc);class MxDbCoord extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3}worldDraw(r){let o=r.getMxObject();r.drawLine(this.point1,this.point2);let a=this.point2.clone();var v=o.screenCoordLong2Doc(20),h=6*v;a.x=a.x+h,r.drawLine(this.point2,a);var b=new THREE.Vector3,D=new THREE.Vector3;let U=o.docCoord2Cad(this.point1.x,this.point1.y,this.point1.z),V=U.x.toFixed(3),I=U.y.toFixed(3);b.x=this.point2.x+.3*v+.5*h,b.y=this.point2.y+.1*v+.5*v,r.drawText(V,v,0,b),D.x=this.point2.x+.3*v+.5*h,D.y=this.point2.y-.1*v-.5*v,r.drawText(I,v,0,D)}getGripPoints(){let r=[];return r.push(this.point1),r.push(this.point2),r}moveGripPointsAt(r,o){return r==0?this.point1.add(o):r==1&&this.point2.add(o),!0}dwgIn(r){return this.onDwgIn(r),this.point1.copy(r.point1),this.point2.copy(r.point2),!0}dwgOut(r){return this.onDwgOut(r),r.point1=this.point1,r.point2=this.point2,r}create(){return new MxDbCoord}transformBy(r){this.point1.applyMatrix4(r),this.point2.applyMatrix4(r)}getTypeName(){return"MxDbCoord"}}function drawMxDbLine(){return Si(this,null,function*(){const w=new MrxDbgUiPrPoint;w.setMessage(`
|
|
指定第一点:`);let r=yield w.go();if(r==null)return;w.setBasePt(r.clone()),w.setUseBasePt(!0),w.setMessage(`
|
|
指定第二点:`);let o=yield w.go();if(o==null)return;let a=new MxDbLine;a.pt1=r,a.pt2=o,MxFun.addToCurrentSpace(a)})}MxDbCoord.cmd="Mx_Coord",MxDbCoord.draw=drawMxDbCoord,addRegisterMxDbEntity(MxDbCoord);class MxDbLine extends MxDbEntity{constructor(){super(...arguments),this.pt1=new THREE.Vector3,this.pt2=new THREE.Vector3}getTypeName(){return"MxDbLine"}worldDraw(r){r.drawLine(this.pt1,this.pt2)}setPoint1(r){this.pt1=r}getPoint1(){return this.pt1}setPoint2(r){this.pt2=r}getPoint2(){return this.pt2}getGripPoints(){let r=[];r.push(this.pt1),r.push(this.pt2);let o=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 r.push(o),r}moveGripPointsAt(r,o){return r==0?this.pt1.add(o):r==1?this.pt2.add(o):r==2&&(this.pt1.add(o),this.pt2.add(o)),!0}dwgIn(r){return this.onDwgIn(r),this.pt1.copy(r.pt1),this.pt2.copy(r.pt2),!0}dwgOut(r){return this.onDwgOut(r),r.pt1=this.pt1,r.pt2=this.pt2,r}create(){return new MxDbLine}getGeomExtents(){return new THREE.Box3(this.pt1,this.pt2)}getGetLength(){return this.pt1.distanceTo(this.pt2)}}function drawMxDbRect(){return Si(this,null,function*(){const w=new MrxDbgUiPrPoint;w.setMessage(`
|
|
指定第一点:`);let r=yield w.go();if(!r)return;let o=new MxDbRect;o.pt1=r;const a=new McEdGetPointWorldDrawObject;a.setDraw(v=>{o.pt2=v,a.drawCustomEntity(o)}),w.setBasePt(r),w.setUseBasePt(!0),w.setUserDraw(a),w.setMessage(`
|
|
指定第二点:`),(yield w.go())&&(o.pt2=w.value(),MxFun.getCurrentDraw().addMxEntity(o))})}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(r){let o=computeRectPoints(this.pt1,this.pt2);if(this.cornerRadius.length>0&&(o=getToGenerateRoundedCorners(o,this.cornerRadius)),r.getType()!=McGiWorldDrawType$1.kWorldDraw)return o.push(o[0]),void r.drawLines(o);const a={transparent:!0,depthTest:!1,opacity:this.opacity,visible:this.visible};if(this.isSolidColorFill){let v;o=o.map(({x:D,y:U})=>new THREE.Vector2(D,U)),v=new THREE.ShapeGeometry(new THREE.Shape(o));let h=new THREE.MeshBasicMaterial(Object.assign({color:this.filter?this.filter._getFilterColor(this.color,this.opacity):new THREE.Color(this.color)},a)),b=new THREE.Mesh(v,h);r.drawEntity(b)}else if(this.fillImageSrc){if(this.material){o=o.map(({x:D,y:U})=>new THREE.Vector2(D,U));let v=this.material,h=new THREE.ShapeGeometry(new THREE.Shape(o));if(h=repairGeometryFaceVertexUvs(h),this.filter){const D=v.map;this.fillImageParam&&(this.fillImageParam.center&&(D.center=this.fillImageParam.center),this.fillImageParam.offset&&(D.offset=this.fillImageParam.offset),this.fillImageParam.repeat&&(D.repeat=this.fillImageParam.repeat),this.fillImageParam.rotation&&(D.rotation=this.fillImageParam.rotation));const U=this.filter._getFilterShaderData(D);v=new THREE.ShaderMaterial(Object.assign(Object.assign({},U),a))}v.depthTest=!1,v.transparent=!0,v.opacity=this.opacity,v.visible=this.visible;let b=new THREE.Mesh(h,v);r.drawEntity(b)}else if(this.fillImageSrc.length>0&&this.isLoadMaterialFromPath){let v=this;MxFun.loadImageMaterial(this.fillImageSrc,h=>{this.isLoadMaterialFromPath=!1,h&&(v.material=h,v.setNeedUpdateDisplay(),MxFun.updateDisplay())})}}else r.drawLines([...o,o[0]])}getGripPoints(){let r=[];r.push(this.pt1);const o=new THREE.Line3(this.pt1,this.pt2);let a=new THREE.Vector3;return o.getCenter(a),r.push(a),r.push(this.pt2),r}moveGripPointsAt(r,o){return r==0?this.pt1.add(o):r==1?(this.pt1.add(o),this.pt2.add(o)):r==2&&this.pt2.add(o),!0}dwgIn(r){return this.onDwgIn(r),this.pt1.copy(r.pt1),this.pt2.copy(r.pt2),this.isSolidColorFill=r.isSolidColorFill,this.fillImageSrc=r.fillImageSrc,this.fillImageParam=r.fillImageParam,this.cornerRadius=r.cornerRadius,this.filter=r.filter,this.isLoadMaterialFromPath=!0,this.material=null,!0}dwgOut(r){return this.onDwgOut(r),r.pt1=this.pt1,r.pt2=this.pt2,r.isSolidColorFill=this.isSolidColorFill,r.fillImageSrc=this.fillImageSrc,r.fillImageParam=this.fillImageParam,r.cornerRadius=this.cornerRadius,r.filter=this.filter,r}create(){return new MxDbRect}transformBy(r){this.pt1.applyMatrix4(r),this.pt2.applyMatrix4(r)}setRadius(r,o=!0){this.cornerRadius=r instanceof Array?r.map(a=>o?MxFun.screenCoordLong2Doc(a):a):r>0?o?[MxFun.screenCoordLong2Doc(r),MxFun.screenCoordLong2Doc(r),MxFun.screenCoordLong2Doc(r),MxFun.screenCoordLong2Doc(r)]:[r,r,r,r]:[]}getTypeName(){return"MxDbRect"}getFilter(){return this.filter}setFilter(r){this.filter=r,this.isLoadMaterialFromPath=!0,this.material=null}setFillImagePath(r){this.fillImageSrc=r,this.isLoadMaterialFromPath=!0,this.material=null,this.fillImageSrc&&(this.isSolidColorFill=!1)}getFillImagePath(){return this.fillImageSrc}}function drawMxDbAlignedDimension(){let w=new MxDbAlignedDimension;const r=new MrxDbgUiPrPoint;return r.setMessage(`
|
|
指定第一点:`),r.go(o=>{if(o!=0)return;const a=r.value();w.setPoint1(a),w.setColor(65314);const v=new McEdGetPointWorldDrawObject;v.setDraw(h=>{w.setPoint2(h),v.drawCustomEntity(w)}),r.setBasePt(a),r.setUseBasePt(!0),r.setUserDraw(v),r.setMessage(`
|
|
指定第二点:`),r.setInputToucheType(MxType.InputToucheType.kGetEnd),r.go(h=>{if(h!=0)return void console.log(h);const b=r.value();w.setPoint2(b),MxFun.getCurrentDraw().addMxEntity(w)})}),w}MxDbRect.cmd="Mx_DrawRect",MxDbRect.draw=drawMxDbRect,addRegisterMxDbEntity(MxDbRect);const propertyDbKeys$5=["point1","point2","fontColor"];class MxDbAlignedDimension extends MxDbEntity{constructor(r){if(super(),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,r){const{points:o,fontColor:a}=r;o&&this.setPoints(o),a&&(this.fontColor=a)}}setPoints(r){const[o,a]=r;o&&(this.point1=o),a&&(this.point2=a)}getTypeName(){return"MxDbAlignedDimension"}getDirection(r,o,a){const v=new THREE.Vector3(r.x,r.y,0),h=new THREE.Vector3(1,0,0),b=r.angleTo(h);let D=-1;(b<7*Math.PI/18||b>10*Math.PI/18)&&o.x>a.x&&(D=1);const U=new THREE.Matrix4;return U.makeRotationZ(Math.PI/2*D),v.applyMatrix4(U),v}getDimText(){return new THREE.Vector3(this.point1.x-this.point2.x,this.point1.y-this.point2.y,0).length().toFixed(3)}worldDraw(r){if(r.setOpacity(this.opacity),r.getType()==McGiWorldDrawType$1.kWorldDraw||r.getType()==McGiWorldDrawType$1.kDynDragDraw){let S=function(G,C){Array.isArray(G)?G.forEach(B=>{S(B,C)}):G.opacity=C};const o=this.point1,a=this.point2;let v,h,b,D,U,V,I;const g=new THREE.Vector3(o.x-a.x,o.y-a.y,0),A=this.getDirection(g,o,a),M=new THREE.Matrix4;M.makeScale(.01,.01,.01);const N=new THREE.Vector3(A.x,A.y,0);N.applyMatrix4(M);const F=new THREE.Vector3(o.x+N.x,o.y+N.y,0),T=new THREE.Vector3(a.x+N.x,a.y+N.y,0),_=this.getColor();V=MxThreeJS.createPoint(o,_),I=MxThreeJS.createPoint(a,_);const Y=new THREE.Vector3(A.x,A.y,0),k=new THREE.Vector3(A.x,A.y,0);M.identity(),M.makeScale(.2,.2,0),Y.applyMatrix4(M),M.identity(),M.makeScale(.02,.02,0),k.applyMatrix4(M),r.drawLine(F.x+2*k.x,F.y+2*k.y,T.x+2*k.x,T.y+2*k.y),v=MxThreeJS.createLine(new THREE.Vector3(F.x+3*k.x,F.y+3*k.y,0),new THREE.Vector3(o.x+.5*k.x,o.y+.5*k.y,0),_),h=MxThreeJS.createLine(new THREE.Vector3(T.x+3*k.x,T.y+3*k.y,0),new THREE.Vector3(a.x+.5*k.x,a.y+.5*k.y,0),_);{const G=new THREE.Vector3(1,0,0);let C=g.angleTo(G);const B=new THREE.Vector3(A.x,A.y,0);B.normalize();const R=o.distanceTo(a);g.y<0?C=C<Math.PI/2?2*Math.PI-C:Math.PI-C:C>Math.PI/2&&(C=Math.PI+C);const u=r.getMxObject();u&&(C-=u.getViewAngle());const c=this.getDimText();(b=MxThreeJS.creatTextSprite(c,new THREE.Vector3(T.x+g.x/2+B.x*R/15,T.y+g.y/2+B.y*R/15,0),.07*R,C,this.fontColor||_))!=null&&(b.material.opacity=this.opacity,r.drawEntity(b))}{M.identity(),M.makeScale(.08,.08,.08);const G=new THREE.Matrix4;G.makeRotationZ(17*Math.PI/18);let C=new THREE.Vector3(g.x,g.y,0);C.applyMatrix4(M),C.applyMatrix4(G),G.identity(),G.makeRotationZ(17*-Math.PI/18);let B=new THREE.Vector3(g.x,g.y,0);B.applyMatrix4(M),B.applyMatrix4(G);const R=new Array;R.push(new THREE.Vector3(F.x+2*k.x,F.y+2*k.y,0),new THREE.Vector3(F.x+2*k.x+C.x,F.y+C.y+2*k.y,0),new THREE.Vector3(F.x+2*k.x+B.x,F.y+B.y+2*k.y,0)),D=MxThreeJS.createTriangle(R,_),G.identity(),G.makeRotationZ(Math.PI/18),(C=new THREE.Vector3(g.x,g.y,0)).applyMatrix4(M),C.applyMatrix4(G),G.identity(),G.makeRotationZ(-Math.PI/18),(B=new THREE.Vector3(g.x,g.y,0)).applyMatrix4(M),B.applyMatrix4(G);const u=new Array;u.push(new THREE.Vector3(T.x+2*k.x,T.y+2*k.y,0),new THREE.Vector3(T.x+C.x+2*k.x,T.y+C.y+2*k.y,0),new THREE.Vector3(T.x+B.x+2*k.x,T.y+B.y+2*k.y,0)),U=MxThreeJS.createTriangle(u,_)}r.drawEntity(v),r.drawEntity(h),D&&(S(D.material,this.opacity),r.drawEntity(D)),U&&(S(U.material,this.opacity),r.drawEntity(U)),r.drawEntity(V),r.drawEntity(I)}else r.drawLine(this.point1,this.point2)}setPoint1(r){this.point1=r}setPoint2(r){this.point2=r}setColor(r){return lodash.isArray(r)?([this.color=this.color,this.fontColor=this.fontColor||this.color]=r,console.log("this.fontColor : ",this.fontColor)):this.color=r,this}getGripPoints(){let r=[];return r.push(this.point1),r.push(this.point2),r}moveGripPointsAt(r,o){return r==0?this.point1.add(o):(r=1)&&this.point2.add(o),!0}dwgIn(r){return this.onDwgIn(r),this.dwgInHelp(r,propertyDbKeys$5),!0}dwgOut(r){return this.onDwgOut(r),this.dwgOutHelp(r,propertyDbKeys$5),r}create(){return new MxDbAlignedDimension}}MxDbAlignedDimension.cmd="Mx_DimensionMeasurement",MxDbAlignedDimension.draw=drawMxDbAlignedDimension,addRegisterMxDbEntity(MxDbAlignedDimension);class MxDbHatch extends MxDbEntity{constructor(){super(...arguments),this.points=[]}worldDraw(r){r.getType()===McGiWorldDrawType$1.kWorldDraw?r.drawSolid(this.points):r.drawLines([...this.points,this.points[0]])}getTypeName(){return"MxDbHatch"}moveGripPointsAt(r,o){return r===0?this.points.forEach(a=>{a.add(o)}):this.points[r-1]&&this.points[r-1].add(o),!0}setPoints(r){this.points=r.map(o=>o.clone())}getGripPoints(){if(this.points.length>0){const{centerPoint:r}=computeBounding(this.points);return[r,...this.points]}return[]}dwgIn(r){this.onDwgIn(r);const o=r.points;return this.points=o.map(({x:a,y:v,z:h})=>new THREE.Vector3(a,v,h)),!0}dwgOut(r){return this.onDwgOut(r),r.points=this.points,r}}function drawMxDbArea(){const w=new MrxDbgUiPrPoint;w.setMessage(`
|
|
指定第一点:`),w.go(r=>{if(r!=0)return;const o=w.value();let a=new MxDbArea;a.addPoint(o);const v=new McEdGetPointWorldDrawObject;v.setDraw((h,b)=>{let D=a.clone();D.addPoint(h),v.drawCustomEntity(D)}),w.setUserDraw(v),w.setMessage(`
|
|
指定下一点:`),w.goWhile(h=>{if(h==0){const b=w.value();a.addPoint(b)}},h=>{a.isFill=!0,a.fillOpacity=.7,a.fillColor=6697540,MxFun.getCurrentDraw().addMxEntity(a)})})}addRegisterMxDbEntity(MxDbHatch);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(r){if(this.points.length<3)return void(this.points.length==2&&r.drawLine(this.points[0],this.points[1]));let o=this.points[0],a=o.clone(),v=o.clone(),h=this.points.length;for(let I=1;I<h;I++){let g=this.points[I];a.x>g.x&&(a.x=g.x),a.y>g.y&&(a.y=g.y),v.x<g.x&&(v.x=g.x),v.y<g.y&&(v.y=g.y),r.drawLine(o,g),o=g}r.drawLine(o,this.points[0]);let b=new THREE.Vector3(a.x+.5*(v.x-a.x),a.y+.5*(v.y-a.y));const D=r.getColor();let U=MxFun.screenCoordLong2Doc(20),V=MxThreeJS.creatTextSprite(this.getDimText(),b,U,0,D);if(V!=null&&r.drawEntity(V),r.getType()==McGiWorldDrawType$1.kWorldDraw&&this.isFill){r.setColor(this.fillColor),r.setOpacity(this.fillOpacity),r.setRenderOrder(r.getRenderOrder()-1);const I=new MxDbHatch;I.points=this.points,I.worldDraw(r)}}getGripPoints(){return this.points}moveGripPointsAt(r,o){return!(r>=this.points.length||(this.points[r].add(o),0))}dwgIn(r){this.onDwgIn(r);let o=r.points;return this.points=[],o.forEach(a=>{this.points.push(new THREE.Vector3(a.x,a.y,a.z))}),this.dwgInHelp(r,["isFill","fillColor","fillOpacity"]),!0}dwgOut(r){return this.onDwgOut(r),r.points=this.points,this.dwgOutHelp(r,["isFill","fillColor","fillOpacity"]),r}addPoint(r){this.points.push(r.clone())}getPoints(){return this.points}clearPoint(){this.points=[]}}function drawMxDbLeadTag(){return Si(this,null,function*(){let r=yield new MrxDbgUiPrPoint().go();if(!r)return;let o=prompt("请输入文字批注","批注");if(!o)return;const a=new MxDbLeadTag;a.point=r,a.text=o,MxFun.addToCurrentSpace(a)})}MxDbArea.cmd="Mx_Area",MxDbArea.draw=drawMxDbArea,addRegisterMxDbEntity(MxDbArea);class MxDbLeadTag extends MxDbEntity{constructor(){super(...arguments),this.point=new THREE.Vector3,this.leadLen=88,this.text="",this.textHeight=24}getTypeName(){return"MxDbLeadTag"}createDots(r,o){const{x:a,y:v,z:h}=r,b=new THREE.Shape;b.arc(a,v,o.screenCoordLong2Doc(6),0,2*Math.PI,!0);const D=new THREE.Path;D.arc(a,v,o.screenCoordLong2Doc(3),0,2*Math.PI,!0),b.holes.push(D);const U=new THREE.ShapeGeometry(b),V=new THREE.MeshPhongMaterial({color:"#ff0000",transparent:!0}),I=new THREE.Shape;I.arc(a,v,o.screenCoordLong2Doc(3),0,2*Math.PI,!0);const g=new THREE.ShapeGeometry(I),A=new THREE.MeshPhongMaterial({color:"#e2da8f",transparent:!0}),M=new THREE.Mesh(U,V),N=new THREE.Mesh(g,A);return M.add(N),M}worldDraw(r){let o=r.getMxObject();const a=this.createDots(this.point,o);if(r.drawEntity(a),a.geometry.computeBoundingBox(),r.drawSelectLine(a.geometry.boundingBox.max,a.geometry.boundingBox.min),r.getType()===2)return;let v=r.getMxObject().screenCoordLong2Doc(this.leadLen),h=new THREE.Vector3(this.point.x+2*v,this.point.y+v,0);const b=h.x-v,D=new THREE.Vector3(b,h.y,h.z);r.setLineWidth(4),r.setColor(16770565),r.drawLines([this.point,D,h]);const U=r.getMxObject().screenCoordLong2Doc(this.textHeight),V=h.clone().setX(h.x);r.setColor(16744448);const I=MxThreeJS.creatTextSprite(this.text,V,U,0,r.getColor());if(I){const g=new THREE.Box3,A=new THREE.Vector3;g.expandByObject(I),g.getSize(A),I.position.setX(I.position.x+A.x/2);const M=r.getMxObject().screenCoordLong2Doc(5),N=g.min.clone().setX(g.min.x+A.x/2).setY(g.min.y-M),F=g.max.clone().setX(g.max.x+A.x/2).setY(g.min.y+M);F.setY(g.max.y+M);const T=new THREE.Vector3(N.x,F.y),_=new THREE.Vector3(F.x,N.y);r.setColor(16777215),r.setLineWidth(0),r.drawLine(N,T),r.drawLine(F,_),r.drawLine(N,_),r.drawLine(T,F);const Y=M/2,k=[],S=[];k.push(new THREE.Vector3(T.x+Y,T.y-M,T.z),new THREE.Vector3(T.x+Y,T.y-Y,T.z),new THREE.Vector3(T.x+M,T.y-Y,T.z)),S.push(new THREE.Vector3(_.x-Y,_.y+M,_.z),new THREE.Vector3(_.x-Y,_.y+Y,_.z),new THREE.Vector3(_.x-M,_.y+Y,_.z)),r.drawLines(k),r.drawLines(S),r.setOpacity(.5),r.setColor(6697540),r.setRenderOrder(-100),r.drawSolid([N,T,F,_]),r.setRenderOrder(100),r.drawEntity(I)}}getGripPoints(){return[this.point]}onViewChange(){return this.setNeedUpdateDisplay(),!0}moveGripPointsAt(r,o){return r===0&&this.point.add(o),!0}dwgIn(r){return this.onDwgIn(r),this.dwgInHelp(r,["point","text","textHeight","leadLen"]),!0}dwgOut(r){return this.onDwgOut(r),this.dwgOutHelp(r,["point","text","textHeight","leadLen"]),r}}function drawMxDbAnyLine(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new McEdGetPointWorldDrawObject,a=new MxDbAnyLine;w.setUserDraw(o),w.setMessage(`
|
|
点击开始画线:`),w.go(v=>{v===MrxDbgUiPrBaseReturn$1.kOk&&(a.points.push(w.value()),o.setDraw(h=>{a.points.push(h.clone()),o.drawCustomEntity(a)})),w.setMessage(`
|
|
再次点击结束画线:`),w.go(h=>{h===MrxDbgUiPrBaseReturn$1.kOk&&r.addMxEntity(a)})})}MxDbLeadTag.cmd="Mx_LeadTag",MxDbLeadTag.draw=drawMxDbLeadTag,addRegisterMxDbEntity(MxDbLeadTag);const propertyDbKeys$4=["points"];class MxDbAnyLine extends MxDbEntity{constructor(){super(...arguments),this.points=[]}getTypeName(){return"MxDbAnyLine"}create(){return new MxDbAnyLine}worldDraw(r){let o=r.getMxObject();const a=new THREE.Box3().setFromPoints(this.points);let v=new THREE.Vector3;if(a.getCenter(v),r.drawLines(this.points),r.getType()===McGiWorldDrawType$1.kSelectDraw){const h=new THREE.Vector3;a.getSize(h),h.addScalar(o.screenCoordLong2Doc(20));const b=h.x/2,D=h.y/2,U={x:v.x-b,y:v.y-D},V={x:v.x+b,y:v.y-D},I={x:v.x+b,y:v.y+D},g={x:v.x-b,y:v.y+D};r.drawLine(V.x,V.y,I.x,I.y),r.drawLine(U.x,U.y,V.x,V.y),r.drawLine(I.x,I.y,g.x,g.y),r.drawLine(g.x,g.y,U.x,U.y)}}setPoints(r){return this.points=r,this}getCenter(){const r=new THREE.Geometry;r.vertices=this.points;const o=new THREE.Vector3;return r.computeBoundingBox(),r.boundingBox.getCenter(o),o}getGripPoints(){return[this.getCenter()]}moveGripPointsAt(r,o){return r===0&&this.points.forEach(a=>{a.add(o)}),!0}dwgIn(r){return this.onDwgIn(r),this.dwgInHelp(r,propertyDbKeys$4),!0}dwgOut(r){return this.onDwgOut(r),this.dwgOutHelp(r,propertyDbKeys$4),r}}function drawMxDbCloudLine(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new McEdGetPointWorldDrawObject;w.setMessage(`
|
|
点击开启绘制云线:`),w.go(()=>{const a=MxFun.screenCoordLong2Doc(16);let v=w.value();const h=new MxDbCloudLine;h.setRadius(a),h.addPoint(v),o.setDraw(b=>{v.distanceTo(b)>a&&(v=b.clone(),h.addPoint(b,!0)),o.drawCustomEntity(h)}),w.setUserDraw(o),w.setMessage(`
|
|
再次点击结束绘制云线:`),w.go(()=>{r.addMxEntity(h)})})}MxDbAnyLine.cmd="Mx_AnyLine",MxDbAnyLine.draw=drawMxDbAnyLine,addRegisterMxDbEntity(MxDbAnyLine);const propertyDbKeys$3=["points","radius"];class MxDbCloudLine extends MxDbEntity{constructor(){super(),this.points=[],this.radius=16,this.cachePoint=null,this.use_smallcoord_display=!0}getTypeName(){return"MxDbCloudLine"}create(){return new MxDbCloudLine}setRadius(r){this.radius=r}getRadius(){return this.radius}getCachePoint(){return this.cachePoint}clacNewArcDiameterPoint(r){if(this.points.length==0)return r;let o=this.points[this.points.length-1];const a=2*this.radius,v=o.distanceTo(r);if(v<a)return null;const h=a*(r.x-o.x)/v+o.x,b=a*(r.y-o.y)/v+o.y;return new THREE.Vector3(h,b,o.z)}createCloudArcCurvePoints(r,o,a){const v=new THREE.Vector3((r.x+o.x)/2,(r.y+o.y)/2,0);a||(a=v.distanceTo(r));const{startAngle:h,endAngle:b}=function(D,U,V){const I=2*Math.PI/360;return{startAngle:180*Math.atan2(U.y-D.y,U.x-D.x)/Math.PI*I,endAngle:180*Math.atan2(V.y-D.y,V.x-D.x)/Math.PI*I}}(v,r,o);return new THREE.ArcCurve(v.x,v.y,a,h,b,!0).getPoints(10)}addPoint(r,o){let a=this.clacNewArcDiameterPoint(r);a&&(this.points.push(a),this.cachePoint=null,o&&(this.cachePoint=this.reCalculateDrawGeometryPoint()))}addLine(r,o){this.addPoint(r);const a=2*this.radius;let v=this.points[this.points.length-1],h=v.distanceTo(o);const b=Math.round(h/a);for(let D=0;D<b;D++){h=v.distanceTo(o);const U=a*(o.x-v.x)/h+v.x,V=a*(o.y-v.y)/h+v.y;let I=new THREE.Vector3(U,V,o.z);this.addPoint(I),v=I}return this.addPoint(o),this.points[this.points.length-1]}reCalculateDrawGeometryPoint(){if(this.points.length<2)return null;let r=this.points[0],o=this.points.length,a=[];for(let v=1;v<o;v++){let h=this.points[v];this.createCloudArcCurvePoints(r,h).forEach(b=>{a.push(new THREE.Vector3(b.x,b.y,0))}),r=h}return a}worldDraw(r){if(this.cachePoint||(this.cachePoint=this.reCalculateDrawGeometryPoint()),!this.cachePoint)return;let o=r.getMxObject();if(r.getType()===McGiWorldDrawType$1.kSelectDraw){let a=new THREE.Geometry;this.cachePoint.forEach(A=>{a.vertices.push(new THREE.Vector3(A.x,A.y,0))}),a.computeBoundingBox();const v=new THREE.Vector3;a.boundingBox.getSize(v);let h=new THREE.Vector3;a.boundingBox.getCenter(h);const b=v.x/2,D=v.y/2,U={x:h.x-b,y:h.y-D},V={x:h.x+b,y:h.y-D},I={x:h.x+b,y:h.y+D},g={x:h.x-b,y:h.y+D};r.drawLine(this.toSmallcoord2(o,U.x,U.y),this.toSmallcoord2(o,V.x,V.y)),r.drawLine(this.toSmallcoord2(o,V.x,V.y),this.toSmallcoord2(o,I.x,I.y)),r.drawLine(this.toSmallcoord2(o,I.x,I.y),this.toSmallcoord2(o,g.x,g.y)),r.drawLine(this.toSmallcoord2(o,g.x,g.y),this.toSmallcoord2(o,U.x,U.y))}else{let a=[];this.cachePoint.forEach(v=>{a.push(this.toSmallcoord(o,v))}),r.drawLines(a)}}getCenter(){const r=new THREE.Geometry;r.vertices=this.points;let o=new THREE.Vector3;return r.computeBoundingBox(),r.boundingBox.getCenter(o),o}getGripPoints(){return[this.getCenter()]}moveGripPointsAt(r,o){return this.points.forEach(a=>{a.add(o)}),this.cachePoint=null,!0}dwgIn(r){return this.onDwgIn(r),this.dwgInHelp(r,propertyDbKeys$3),this.cachePoint=null,!0}dwgOut(r){return this.onDwgOut(r),this.dwgOutHelp(r,propertyDbKeys$3),r.type===MxType.MxCloneType.kSaveDwgClone&&this.dwgOutHelp(r,["cachePoint"]),r}}function drawMxDbRegularPolygon(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new McEdGetPointWorldDrawObject,a=new MxDbRegularPolygon;w.setMessage(`
|
|
点击开始绘制多边形:`),w.go(()=>{let v=prompt("请输入多边形的边数","8");v&&(a.sidesNumber=Number(v),a.centerPoint=w.value(),w.setUserDraw(o),o.setDraw(h=>{a.otherPoint=h,o.drawCustomEntity(a)}),w.setMessage(`
|
|
再次点击结束绘制多边形:`),w.go(()=>{r.addMxEntity(a)}))})}MxDbCloudLine.isRegister=!1,MxDbCloudLine.cmd="Mx_CloudLine",MxDbCloudLine.draw=drawMxDbCloudLine,addRegisterMxDbEntity(MxDbCloudLine);class MxDbRegularPolygon extends MxDbShape{getTypeName(){return"MxDbRegularPolygon"}constructor(){super(),this.centerPoint=new THREE.Vector3,this.otherPoint=new THREE.Vector3,this.sidesNumber=5,this._propertyDbKeys=[...this._propertyDbKeys,"centerPoint","otherPoint","sidesNumber"]}worldDraw(r){const o=computeRegularPolygonVertices(this.centerPoint,this.otherPoint,this.sidesNumber);this.closed=!1,o.push(o[0]),this._draw(r,o),this._drawStoreLine(r,o)}getGripPoints(){return[this.centerPoint,this.otherPoint]}moveGripPointsAt(r,o){return r===0?(this.centerPoint.add(o),this.otherPoint.add(o)):r===1&&this.otherPoint.add(o),!0}}function drawMxDbLeadComment(){const w=new MrxDbgUiPrPoint;w.setMessage(`
|
|
指定第一点:`),w.go(r=>{if(r!=0)return;const o=w.value();let a=new MxDbLeadComment;a.point1=o.clone(),a.textHeight=MxFun.screenCoordLong2Doc(50);let v=prompt("请输入文字批注","批注");if(!v)return;a.text=v,a.textWidth=MxFun.screenCoordLong2Doc(10*v.length),a.fixedSize=!0,a.fixedSize&&(a.textHeight=50,a.textWidth=50*v.length);const h=new McEdGetPointWorldDrawObject;h.setDraw((b,D)=>{a.point2=b,D.drawCustomEntity(a)}),w.setBasePt(o),w.setUseBasePt(!0),w.setUserDraw(h),w.setMessage(`
|
|
指定第二点:`),w.go(b=>{if(b!=0)return void console.log(b);const D=w.value();a.point2=D,MxFun.addToCurrentSpace(a)})})}MxDbRegularPolygon.cmd="Mx_RegularPolygon",MxDbRegularPolygon.draw=drawMxDbRegularPolygon,addRegisterMxDbEntity(MxDbRegularPolygon);class MxDbLeadComment extends MxDbEntity{constructor(){super(),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.text="",this.textHeight=20,this.textWidth=0,this.fixedSize=!1,this.use_smallcoord_display=!0}getTypeName(){return"MxDbLeadComment"}create(){return new MxDbLeadComment}worldDraw(r){let o=r.getMxObject(),a=this.toSmallcoord(o,this.point1),v=this.toSmallcoord(o,this.point2);if(r.drawLine(a,v),this.text.length>0){const h=new THREE.Vector3;let b=this.textHeight,D=this.textWidth;this.fixedSize&&(b=o.screenCoordLong2Doc(b),D=o.screenCoordLong2Doc(D));let U=MxThreeJS.clacTextSpriteSize(this.text,b,D);h.x=v.x+.5*U.textwidth,h.y=v.y+.5*U.allTextHeight,r.drawText(this.text,b,0,h,D);const V=new THREE.Vector3;V.x=v.x+U.textwidth,V.y=v.y,r.drawLine(V,v)}}getGripPoints(){let r=[];return r.push(this.point1),r.push(this.point2),r}moveGripPointsAt(r,o){return r==0?this.point1.add(o):r==1&&this.point2.add(o),!0}dwgIn(r){return this.onDwgIn(r),this.point1.copy(r.point1),this.point2.copy(r.point2),this.text=r.text.substr(0),this.textHeight=r.textHeight,r.textWidth&&(this.textWidth=r.textWidth),this.fixedSize=r.fixedSize,!0}dwgOut(r){return this.onDwgOut(r),r.point1=this.point1,r.point2=this.point2,r.textHeight=this.textHeight,r.text=this.text,r.textWidth=this.textWidth,r.fixedSize=this.fixedSize,r}onViewChange(){return!!this.fixedSize&&(this.setNeedUpdateDisplay(!1),!0)}}function drawMxDbRectBoxLeadComment(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new McEdGetPointWorldDrawObject,a=new MxDbRectBoxLeadComment;a.setLineWidth(3),a.setLineWidthByPixels(!0),w.setMessage(`
|
|
云线框起始点:`),w.go(v=>{a.radius=MxFun.screenCoordLong2Doc(8),v==MrxDbgUiPrBaseReturn$1.kOk&&(a.point1=w.value(),o.setDraw(h=>{a.point2=h,o.drawCustomEntity(a)}),w.setUserDraw(o),w.setMessage(`
|
|
云线框结束点:`),w.go(h=>{if(h!=MrxDbgUiPrBaseReturn$1.kOk)return;a.point2=w.value(),o.setDraw(D=>{a.point3=D,o.drawCustomEntity(a)});let b=prompt("请输入文字批注","批注");b||(b="默认批注文字"),a.text=b,a.textWidth=MxFun.screenCoordLong2Doc(10*b.length),a.textHeight=MxFun.screenCoordLong2Doc(5*b.length),a.fixedSize=!0,a.fixedSize&&(a.textHeight=20,a.textWidth=20*b.length),w.setMessage(`
|
|
审图标注点:`),w.go(D=>{D==MrxDbgUiPrBaseReturn$1.kOk&&(a.point3=w.value(),r.addMxEntity(a))})}))})}MxDbLeadComment.cmd="Mx_Comment",MxDbLeadComment.draw=drawMxDbLeadComment,addRegisterMxDbEntity(MxDbLeadComment);class MxDbRectBoxLeadComment extends MxDbEntity{constructor(){super(),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,this.use_smallcoord_display=!0}getTypeName(){return"MxDbRectBoxLeadComment"}create(){return new MxDbRectBoxLeadComment}getCloudLine(){let r=new MxDbCloudLine;r.setRadius(this.radius);let o=this.point1.clone(),a=this.point2.clone();if(o.x>a.x){let U=o.x;o.x=a.x,a.x=U}if(o.y>a.y){let U=o.y;o.y=a.y,a.y=U}let v=new THREE.Vector3(o.x,a.y,o.z);v=r.addLine(o,v),a=new THREE.Vector3(a.x,v.y,a.z),a=r.addLine(v,a);let h=new THREE.Vector3(a.x,o.y,o.z);h=r.addLine(a,h);let b=o=r.addLine(h,o),D=o.distanceTo(this.point3);return D>v.distanceTo(this.point3)&&(b=v,D=v.distanceTo(this.point3)),D>a.distanceTo(this.point3)&&(b=a,D=a.distanceTo(this.point3)),D>h.distanceTo(this.point3)&&(b=h,D=h.distanceTo(this.point3)),{cloudLine:r,pt1:o,pt2:v,pt3:a,pt4:h,leadPt:b}}worldDraw(r){let o=this.getCloudLine(),a=o.cloudLine;if(a.setUseSmallcoordDisplay(this.use_smallcoord_display),a.worldDraw(r),this.text.length>0){let v=o.leadPt,h=new MxDbLeadComment;h.setUseSmallcoordDisplay(this.use_smallcoord_display),h.point1=v,h.point2=this.point3,h.text=this.text,h.textHeight=this.textHeight,h.textWidth=this.textWidth,h.fixedSize=this.fixedSize,h.worldDraw(r)}}getGripPoints(){let r=[];return r.push(this.point1),r.push(this.point2),r.push(this.point3),r}moveGripPointsAt(r,o){return r==0?this.point1.add(o):r==1?this.point2.add(o):r==2&&this.point3.add(o),!0}dwgIn(r){return this.onDwgIn(r),this.point1.copy(r.point1),this.point2.copy(r.point2),this.point3.copy(r.point3),this.text=r.text.substr(0),this.textHeight=r.textHeight,this.radius=r.radius,r.textWidth&&(this.textWidth=r.textWidth),this.fixedSize=r.fixedSize,!0}dwgOut(r){if(this.onDwgOut(r),r.point1=this.point1,r.point2=this.point2,r.point3=this.point3,r.textHeight=this.textHeight,r.text=this.text,r.radius=this.radius,r.textWidth=this.textWidth,r.fixedSize=this.fixedSize,r.type===MxType.MxCloneType.kSaveDwgClone){let o=this.getCloudLine(),a=o.cloudLine.reCalculateDrawGeometryPoint();r.cachePoint=a||[],r.leadPt=o.leadPt}return r}onViewChange(){return!!this.fixedSize&&(this.setNeedUpdateDisplay(!1),!0)}}function drawMxDbEllipse(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new McEdGetPointWorldDrawObject,a=new MxDbEllipse;w.setMessage(`
|
|
点击开始绘制椭圆:`),w.go(()=>{a.point1=w.value(),o.setDraw(v=>{a.point2=v,o.drawCustomEntity(a)}),w.setUserDraw(o),w.setMessage(`
|
|
再次点击结束绘制椭圆:`),w.go(()=>{r.addMxEntity(a)})})}MxDbRectBoxLeadComment.cmd="Mx_CheckDraw",MxDbRectBoxLeadComment.draw=drawMxDbRectBoxLeadComment,addRegisterMxDbEntity(MxDbRectBoxLeadComment);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(r){return this.point1=r,this}setPoint2(r){return this.point2=r,this}worldDraw(r){const{point1:o,point2:a}=this,v=o.clone().set(a.x,o.y,a.z),h=a.clone().set(o.x,a.y,o.z);this.xRadius=o.distanceTo(v)/2,this.yRadius=o.distanceTo(h)/2;const b=o.x>a.x,D=o.y>a.y,U=b?o.x-this.xRadius:o.x+this.xRadius,V=D?o.y-this.yRadius:o.y+this.yRadius;this.center=new THREE.Vector3(U,V,0),this.drawEllipseShape(r),r.getType()===McGiWorldDrawType$1.kSelectDraw&&r.drawLines([o,new THREE.Vector3(o.x,a.y),a,new THREE.Vector3(a.x,o.y),o])}getGripPoints(){let r=new THREE.Vector3(.5*(this.point2.x+this.point1.x),.5*(this.point2.y+this.point1.y),0);return[this.point1,this.point2,r]}moveGripPointsAt(r,o){return r===0?this.point1.add(o):r===1?this.point2.add(o):r===2&&(this.point1.add(o),this.point2.add(o)),!0}}function drawMxDbText(){return Si(this,null,function*(){const w=new MrxDbgUiPrPoint;w.setMessage(`
|
|
点取文字插入点:`);let r=yield w.go();if(r==null)return;let o=prompt("请输入文字");if(!o)return;let a=new MxDbText;a.position=r,a.height=MxFun.screenCoordLong2Doc(50),a.text=o,MxFun.addToCurrentSpace(a)})}let _SpriteText;function getSpriteTextColor(w){return w?w instanceof THREE.Color?w.getStyle():typeof w=="number"?new THREE.Color(w).getStyle():w:"#fff"}function toCSSFont(w,r,o,a,v){let h=document.createElement("span");return h.style.font="1px serif",h.style.fontFamily=w,h.style.fontSize=`${r}px`,h.style.fontStyle=o,h.style.fontVariant=a,h.style.fontWeight=v,h.style.font}function getSpriteTextClass(){if(!_SpriteText){class w extends THREE.Sprite{constructor(o){super(new THREE.SpriteMaterial);const{text:a,textHeight:v,color:h,backgroundColor:b,padding:D,borderWidth:U,borderRadius:V,borderColor:I,strokeWidth:g,strokeColor:A,fontFace:M,fontSize:N,fontWeight:F,textAlign:T,textShadowBlur:_,textShadowColor:Y,textShadowOffsetX:k,textShadowOffsetY:S,angle:G,scale:C,underline:B,fontStyle:R,fontVariant:u}=o||{};this._text=`${a}`,this._textHeight=v||10,this._color=h,this._backgroundColor=b,this._padding=D||0,this._borderWidth=U||0,this._borderRadius=V||0,this._borderColor=I||"white",this._strokeWidth=g||0,this._strokeColor=A||"white",this._fontFace=M||"Arial",this._fontSize=N||90,this._fontWeight=(F==null?void 0:F.toString())||"normal",this._textAlign=T||"start",this._fontStyle=R||"normal",this._fontVariant=u||"normal",this._textShadowBlur=_||0,this._textShadowColor=Y,this._textShadowOffsetX=k||0,this._textShadowOffsetY=S||0,this._angle=G||0,this._textScale=C||1,this._underline=B||!1,this._canvas=document.createElement("canvas"),this._genCanvas()}get text(){return this._text}set text(o){this._text=o,this._genCanvas()}get textHeight(){return this._textHeight}set textHeight(o){this._textHeight=o,this._genCanvas()}get color(){return this._color}set color(o){this._color=o,this._genCanvas()}get backgroundColor(){return this._backgroundColor}set backgroundColor(o){this._backgroundColor=o,this._genCanvas()}get padding(){return this._padding}set padding(o){this._padding=o,this._genCanvas()}get borderWidth(){return this._borderWidth}set borderWidth(o){this._borderWidth=o,this._genCanvas()}get borderRadius(){return this._borderRadius}set borderRadius(o){this._borderRadius=o,this._genCanvas()}get borderColor(){return this._borderColor}set borderColor(o){this._borderColor=o,this._genCanvas()}get fontFace(){return this._fontFace}set fontFace(o){this._fontFace=o,this._genCanvas()}get fontSize(){return this._fontSize}set fontSize(o){this._fontSize=o,this._genCanvas()}get fontWeight(){return this._fontWeight}set fontWeight(o){this._fontWeight=o,this._genCanvas()}get strokeWidth(){return this._strokeWidth}set strokeWidth(o){this._strokeWidth=o,this._genCanvas()}get strokeColor(){return this._strokeColor}set strokeColor(o){this._strokeColor=o,this._genCanvas()}get textAlign(){return this._textAlign}set textAlign(o){this._textAlign=o,this._genCanvas()}get textShadowBlur(){return this._textShadowBlur}set textShadowBlur(o){this._textShadowBlur=o,this._genCanvas()}get textShadowColor(){return this._textShadowColor}set textShadowColor(o){this._textShadowColor=o,this._genCanvas()}get textShadowOffsetX(){return this._textShadowOffsetX}set textShadowOffsetX(o){this._textShadowOffsetX=o,this._genCanvas()}get textShadowOffsetY(){return this._textShadowOffsetY}set textShadowOffsetY(o){this._textShadowOffsetY=o,this._genCanvas()}get angle(){return this._angle}set angle(o){this._angle=o,this._genCanvas()}get textScale(){return this._textScale}set textScale(o){this._textScale=o,this._genCanvas()}get underline(){return this._underline}set underline(o){this._underline=o,this._genCanvas()}get fontStyle(){return this._fontStyle}set fontStyle(o){this._fontStyle=o,this._genCanvas()}get fontVariant(){return this._fontVariant}set fontVariant(o){this._fontVariant=o,this._genCanvas()}_genCanvas(){const o=this._canvas,a=o.getContext("2d"),v=Array.isArray(this.borderWidth)?this.borderWidth:[this.borderWidth,this.borderWidth],h=v.map(S=>S*this.fontSize*.1),b=(Array.isArray(this.borderRadius)?this.borderRadius:[this.borderRadius,this.borderRadius,this.borderRadius,this.borderRadius]).map(S=>S*this.fontSize*.1),D=Array.isArray(this.padding)?this.padding:[this.padding,this.padding],U=D.map(S=>S*this.fontSize*.1),V=this.text.split(`
|
|
`),I=this.font;a.font=I;const g=Math.max(...V.map(S=>a.measureText(S).width)),A=4*this.strokeWidth+(this.underline?this.fontSize/15*4:this.fontSize/15),M=(this.fontSize+A)*V.length;if(o.width=g+2*h[0]+2*U[0],o.height=M+2*h[1]+2*U[1],this.borderWidth){if(a.strokeStyle=getSpriteTextColor(this.borderColor),h[0]){const S=h[0]/2;a.lineWidth=h[0],a.beginPath(),a.moveTo(S,b[0]),a.lineTo(S,o.height-b[3]),a.moveTo(o.width-S,b[1]),a.lineTo(o.width-S,o.height-b[2]),a.stroke()}if(h[1]){const S=h[1]/2;a.lineWidth=h[1],a.beginPath(),a.moveTo(Math.max(h[0],b[0]),S),a.lineTo(o.width-Math.max(h[0],b[1]),S),a.moveTo(Math.max(h[0],b[3]),o.height-S),a.lineTo(o.width-Math.max(h[0],b[2]),o.height-S),a.stroke()}if(this.borderRadius){const S=Math.max(...h),G=S/2;a.lineWidth=S,a.beginPath(),[!!b[0]&&[b[0],G,G,b[0]],!!b[1]&&[o.width-b[1],o.width-G,G,b[1]],!!b[2]&&[o.width-b[2],o.width-G,o.height-G,o.height-b[2]],!!b[3]&&[b[3],G,o.height-G,o.height-b[3]]].filter(C=>C).forEach(C=>{const[B,R,u,c]=C;a.moveTo(B,u),a.quadraticCurveTo(R,u,R,c)}),a.stroke()}}this.backgroundColor&&(a.fillStyle=getSpriteTextColor(this.backgroundColor),this.borderRadius?(a.beginPath(),a.moveTo(h[0],b[0]),[[h[0],b[0],o.width-b[1],h[1],h[1],h[1]],[o.width-h[0],o.width-h[0],o.width-h[0],h[1],b[1],o.height-b[2]],[o.width-h[0],o.width-b[2],b[3],o.height-h[1],o.height-h[1],o.height-h[1]],[h[0],h[0],h[0],o.height-h[1],o.height-b[3],b[0]]].forEach(([S,G,C,B,R,u])=>{a.quadraticCurveTo(S,B,G,R),a.lineTo(C,u)}),a.closePath(),a.fill()):a.fillRect(h[0],h[1],o.width-2*h[0],o.height-2*h[1])),a.translate(h[0],h[1]),a.translate(U[0],U[1]),a.font=I,a.fillStyle=getSpriteTextColor(this.color),a.textBaseline="bottom",a.shadowBlur=this.textShadowBlur,a.shadowColor=new THREE.Color(this.textShadowColor).getStyle(),a.shadowOffsetX=this.textShadowOffsetX,a.shadowOffsetY=this.textShadowOffsetY;const N=this.strokeWidth>0;N&&(a.lineWidth=this.strokeWidth*this.fontSize/10,a.strokeStyle=getSpriteTextColor(this.strokeColor));const F=this.textAlign==="center",T=this.textAlign==="start"||this.textAlign==="left";V.forEach((S,G)=>Si(this,null,function*(){let C=F?2:1;const B=a.measureText(S).width,R=T?0:(g-B)/C,u=(G+1)*(this.fontSize+A);N&&a.strokeText(S,R,u),a.fillText(S,R,u),this.underline&&a.fillRect(R,o.height-this.fontSize/25,B,this.fontSize/25)})),this.material.map&&this.material.map.dispose();const _=this.material.map=new THREE.Texture(o);_.minFilter=THREE.LinearFilter,_.needsUpdate=!0;const Y=this.textHeight*V.length+2*v[1]+2*D[1],k=Y*o.width/o.height;this.scale.set(k,Y,this.scale.z),this.material.rotation=this.angle,this.scale.applyMatrix4(new THREE.Matrix4().makeScale(this.textScale,this.textScale,1))}clone(){return new this.constructor(this.text,this.textHeight,this.color).copy(THREE.Sprite.prototype.clone.call(this))}copy(o){return THREE.Sprite.prototype.copy.call(this,o),this.color=o.color,this.backgroundColor=o.backgroundColor,this.padding=o.padding,this.borderWidth=o.borderWidth,this.borderColor=o.borderColor,this.fontFace=o.fontFace,this.fontSize=o.fontSize,this.fontWeight=o.fontWeight,this.strokeWidth=o.strokeWidth,this.strokeColor=o.strokeColor,this.textAlign=o.textAlign,this.textShadowBlur=o.textShadowBlur,this.textShadowColor=o.textShadowColor,this.textShadowOffsetX=o.textShadowOffsetX,this.textShadowOffsetY=o.textShadowOffsetY,this.angle=o.angle,this.textScale=o.textScale,this}get font(){return toCSSFont(this.fontFace,this.fontSize,this.fontStyle,this.fontVariant,this.fontWeight)}checkFontFace(){try{const{fontFace:o}=this;return document.fonts.check(o)}catch(o){}return!0}loadFontFace(){return Si(this,null,function*(){try{const{fontFace:o}=this;yield document.fonts.load(o)}catch(o){}})}dispose(){var o;(o=this.material.map)===null||o===void 0||o.dispose(),this.material.dispose(),this.geometry.dispose(),this.dispatchEvent({type:"dispose"})}}_SpriteText=w}return _SpriteText}MxDbEllipse.cmd="Mx_Ellipse",MxDbEllipse.draw=drawMxDbEllipse,addRegisterMxDbEntity(MxDbEllipse);const propertyDbKeys$2=["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(r){return this.position=r,this}get text(){return this.spriteText?this.spriteText.text:this._text}set text(r){this.spriteText?this.spriteText.text=r:this._text=r}setText(r){return this.text=r,this}get height(){return this.spriteText?this.spriteText.textHeight:this._height}set height(r){this.spriteText?this.spriteText.textHeight=r:this._height=r}setHeight(r){return this.height=r,this}get backgroundColor(){return this.spriteText?this.spriteText.backgroundColor:this._backgroundColor}set backgroundColor(r){this.spriteText?this.spriteText.backgroundColor=r:this._backgroundColor=r}setBackgroundColor(r){return this.backgroundColor=r,this}get padding(){return this.spriteText?this.spriteText.padding:this._padding}set padding(r){this.spriteText?this.spriteText.padding=r:this._padding=r}setPadding(r){return this.padding=r,this}get borderWidth(){return this.spriteText?this.spriteText.borderWidth:this._borderWidth}set borderWidth(r){this.spriteText?this.spriteText.borderWidth=r:this._borderWidth=r}setBorderWidth(r){return this.borderWidth=r,this}get borderRadius(){return this.spriteText?this.spriteText.borderRadius:this._borderRadius}set borderRadius(r){this.spriteText?this.spriteText.borderRadius=r:this._borderRadius=r}setBorderRadius(r){return this.borderRadius=r,this}get borderColor(){return this.spriteText?this.spriteText.borderColor:this._borderColor}set borderColor(r){this.spriteText?this.spriteText.borderColor=r:this._borderColor=r}setBorderColor(r){return this.borderColor=r,this}get fontFace(){return this.spriteText?this.spriteText.fontFace:this._fontFace}set fontFace(r){this.spriteText?this.spriteText.fontFace=r:this._fontFace=r}setFontFace(r){return this.fontFace=r,this}get fontSize(){return this.spriteText?this.spriteText.fontSize:this._fontSize}set fontSize(r){this.spriteText?this.spriteText.fontSize=r:this._fontSize=r}setFontSize(r){return this.fontSize=r,this}get fontWeight(){return this.spriteText?this.spriteText.fontWeight:this._fontWeight}set fontWeight(r){this.spriteText?this.spriteText.fontWeight=r:this._fontWeight=r}setFontWeight(r){return this.fontWeight=r,this}get strokeWidth(){return this.spriteText?this.spriteText.strokeWidth:this._strokeWidth}set strokeWidth(r){this.spriteText?this.spriteText.strokeWidth=r:this._strokeWidth=r}setStrokeWidth(r){return this.strokeWidth=r,this}get strokeColor(){return this.spriteText?this.spriteText.strokeColor:this._strokeColor}set strokeColor(r){this.spriteText?this.spriteText.strokeColor=r:this._strokeColor=r}setStrokeColor(r){return this.strokeColor=r,this}get textAlign(){return this.spriteText?this.spriteText.textAlign:this._textAlign}set textAlign(r){this.spriteText?this.spriteText.textAlign=r:this._textAlign=r}setTextAlign(r){return this.textAlign=r,this}get textShadowBlur(){return this.spriteText?this.spriteText.textShadowBlur:this._textShadowBlur}set textShadowBlur(r){this.spriteText?this.spriteText.textShadowBlur=r:this._textShadowBlur=r}setTextShadowBlur(r){return this.textShadowBlur=r,this}get textShadowColor(){return this.spriteText?this.spriteText.textShadowColor:this._textShadowColor}set textShadowColor(r){this.spriteText?this.spriteText.textShadowColor=r:this._textShadowColor=r}setTextShadowColor(r){return this.textShadowColor=r,this}get textShadowOffsetX(){return this.spriteText?this.spriteText.textShadowOffsetX:this._textShadowOffsetX}set textShadowOffsetX(r){this.spriteText?this.spriteText.textShadowOffsetX=r:this._textShadowOffsetX=r}setTextShadowOffsetX(r){return this.textShadowOffsetX=r,this}get textShadowOffsetY(){return this.spriteText?this.spriteText.textShadowOffsetY:this._textShadowOffsetY}set textShadowOffsetY(r){this.spriteText?this.spriteText.textShadowOffsetY=r:this._textShadowOffsetY=r}setTextShadowOffsetY(r){return this.textShadowOffsetY=r,this}get angle(){return this.spriteText?this.spriteText.angle:this._angle}set angle(r){this.spriteText?this.spriteText.angle=r:this._angle=r}setAngle(r){return this.angle=r,this}get scale(){return this.spriteText?this.spriteText.textScale:this._scale}set scale(r){this.spriteText?this.spriteText.textScale=r:this._scale=r}setScale(r){return this.scale=r,this}get underline(){return this.spriteText?this.spriteText.underline:this._underline}set underline(r){this.spriteText?this.spriteText.underline=r:this._underline=r}setUnderline(r){this.underline=r}getTypeName(){return"MxDbText"}worldDraw(r){if(this.text.length>0){r.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:o,y:a,z:v}=this.position;this.spriteText.position.set(o,a,v),r.drawEntity(this.spriteText)}}createSpriteText(){const r=getSpriteTextClass(),{text:o,height:a,color:v,backgroundColor:h,padding:b,borderWidth:D,borderRadius:U,borderColor:V,strokeWidth:I,strokeColor:g,fontFace:A,fontSize:M,fontWeight:N,textAlign:F,textShadowBlur:T,textShadowColor:_,textShadowOffsetX:Y,textShadowOffsetY:k,angle:S,scale:G,underline:C}=this;this.spriteText=new r({text:o,textHeight:a,color:v,backgroundColor:h,padding:b,borderWidth:D,borderRadius:U,borderColor:V,strokeWidth:I,strokeColor:g,fontFace:A,fontSize:M,fontWeight:N,textAlign:F,textShadowBlur:T,textShadowColor:_,textShadowOffsetX:Y,textShadowOffsetY:k,angle:S,scale:G,underline:C})}getGripPoints(){return[this.position]}moveGripPointsAt(r,o){return r===0&&this.position.add(o),!0}create(){return new MxDbText}dwgIn(r){var o,a;return this.onDwgIn(r),this.dwgInHelp(r,propertyDbKeys$2),typeof r.path=="string"&&(r.path=JSON.parse(r.path)),((a=(o=r==null?void 0:r.path)===null||o===void 0?void 0:o.metadata)===null||a===void 0?void 0:a.generator)==="Curve.toJSON"&&(r.path=new THREE.Path().fromJSON(r.path)),r.type===MxType.MxCloneType.kMxFileClone||r.type===MxType.MxCloneType.kSaveDwgClone?this.createSpriteText():this.spriteText=r.spriteText,!0}dwgOut(r){return this.onDwgOut(r),this.dwgOutHelp(r,propertyDbKeys$2),r.type===MxType.MxCloneType.kMxFileClone||r.type===MxType.MxCloneType.kSaveDwgClone?r.spriteText=void 0:r.spriteText=this.spriteText,r}getGeomExtents(){return new THREE.Box3().expandByObject(this.spriteText)}erase(){return super.erase(),this.spriteText&&this.spriteText.dispose(),!0}}function createCurvePath(w=!1){const r=new THREE.CurvePath;return r.autoClose=w,r}function createQuadraticBezierCurve3(w){let r=0,o=[];for(let a=0;a<w.length;a++){const v=w[r],h=w[++r]||v,b=w[++r]||h;if(!v||!h||!b)break;o.push(new THREE.QuadraticBezierCurve3(v,h,b))}return o}function createCubicBezierCurve3(w){let r=0,o=[];for(let a=0;a<w.length;a++){const v=w[r],h=w[++r]||v,b=w[++r]||h,D=w[++r]||b;if(!(v&&h&&b&&D))break;o.push(new THREE.CubicBezierCurve3(v,h,b,D))}return o}function getCurveColorGradientData(w,r){let o=0,a=[],v=[];const h=Number((1/r.length).toFixed(2));let b=new THREE.Color(r[o]),D=new THREE.Color(r[o+1]);for(let U=0,V=w.length;U<V;U++){const I=w[U],g=U/w.length;g/o>=h&&(o++,D.set(new THREE.Color(r[o]||r[--o]))),a.push(I.x,I.y,I.z||0),b.lerpHSL(D,g),v.push(b.r,b.g,b.b)}return[a,v]}function getColorGradientData(w,r){let o=[],a=[];for(let v=0,h=w.length;v<h;v++){const b=w[v];o.push(b.x,b.y,b.z||0);const D=new THREE.Color(r[v]);a.push(D.r,D.g,D.b)}return[o,a]}MxDbText.cmd="Mx_Text",MxDbText.draw=drawMxDbText,addRegisterMxDbEntity(MxDbText);const propertyDbKeys$1=["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(r){return this.points=r,this}setColors(r){return this.colors=r,this}addColor(r){return this.colors.push(r),this}setLinecap(r){this.linecap=r}setClosed(r){this.closed=r}setCurveType(r){this.curveType=r}setTension(r){this.tension=r}setBezierType(r){this.bezierType=r}worldDraw(r){const o=r.getType();let a=this.getPoints();const{closed:v,curveType:h,tension:b,bezierType:D}=this,U=new THREE.BufferGeometry;let V=[],I=[];const g=D==="cubic",A=D==="quadratic";b!==0?this.curve=new THREE.CatmullRomCurve3(a,v,h,b):D?(this.curve=createCurvePath(v),g?this.curve.curves=createCubicBezierCurve3(a):A?this.curve.curves=createQuadraticBezierCurve3(a):this.curve=void 0):this.curve=void 0,this.curve&&(a=this.curve.getPoints(50));const{linecap:M,linejoin:N}=this;let F;if(this.colors&&this.colors.length>1){const _=v?[...this.colors,this.colors[0]]:this.colors;[V,I]=this.curve?getCurveColorGradientData(a,_):getColorGradientData(a,_),U.setAttribute("position",new THREE.Float32BufferAttribute(V,3)),U.setAttribute("color",new THREE.Float32BufferAttribute(I,3)),F=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,linecap:M,linejoin:N})}else U.setFromPoints(a),F=new THREE.LineBasicMaterial({color:this.color,linecap:M,linejoin:N});const T=v?new THREE.LineLoop(U,F):new THREE.Line(U,F);if(r.drawEntity(T),(o===McGiWorldDrawType$1.kSelectDraw||o===McGiWorldDrawType$1.kDynDragDraw)&&this.curve){let _=this.getPoints();const Y=r.getLineWidth();r.setLineWidth(1),r.drawLines(_),r.setLineWidth(Y)}}getGripPoints(){return this.getPoints()}getPoints(){return this.closed?[...this.points,this.points[0]]:this.points}moveGripPointsAt(r,o){return this.move(r,o),!0}move(r,o){return this.points[r].add(o),this}dwgIn(r){return this.dwgInHelp(r,propertyDbKeys$1),this.curve=r.curve,!0}dwgOut(r){return this.dwgOutHelp(r,propertyDbKeys$1),r.curve=this.curve,r}}function drawMxDbEllipseArc(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new McEdGetPointWorldDrawObject;let a=new MxDbEllipseArc;w.setUserDraw(o),w.go(()=>Si(this,null,function*(){a.center=w.value(),o.setDraw((v,h)=>{a.startPoint=v,a.yRadius=a.center.distanceTo(v),h.drawCustomEntity(a)}),a.startPoint=(yield w.go())||new THREE.Vector3,o.setDraw((v,h)=>{a.endPoint=v,h.drawCustomEntity(a)}),a.endPoint=(yield w.go())||new THREE.Vector3,r.addMxEntity(a)}))}addRegisterMxDbEntity(MxDbGradientLine);class MxDbEllipseArc extends MxDbEllipseShape{getTypeName(){return"MxDbEllipseArc"}constructor(){super(),this._propertyDbKeys=[...this._propertyDbKeys,"startPoint","endPoint"]}setStartPoint(r){return this.startPoint=r,this}setEndPoint(r){return this.endPoint=r,this}worldDraw(r){let{center:o,startPoint:a,endPoint:v}=this;a&&(this.xRadius=o.distanceTo(a),this.startAngle=THREE.MathUtils.degToRad(calculateArcAngle(a,o,this.xRadius).angle)),v&&(this.yRadius=o.distanceTo(v),this.endAngle=THREE.MathUtils.degToRad(calculateArcAngle(v,o,this.yRadius).angle)),this.drawEllipseShape(r)}getGripPoints(){return[this.center,this.startPoint,this.endPoint]}moveGripPointsAt(r,o){return r===0&&(this.center.add(o),this.startPoint.add(o),this.endPoint.add(o)),r===1&&this.startPoint.add(o),r===2&&this.endPoint.add(o),!0}}function drawMxDbCircleArc(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new McEdGetPointWorldDrawObject;let a=new MxDbCircleArc;a.stroke="#ff0000",w.setUserDraw(o),w.setMessage(`
|
|
确定圆弧中点:`),w.go(()=>Si(this,null,function*(){a.center=w.value(),o.setDraw(v=>{o.drawLine(a.center,v)}),w.setMessage(`
|
|
确定圆弧开始点:`),a.startPoint=(yield w.go())||new THREE.Vector3,o.setDraw(v=>{a.endPoint=v,o.drawCustomEntity(a)}),w.setMessage(`
|
|
确定圆弧结束点:`),a.endPoint=(yield w.go())||new THREE.Vector3,o.setDraw(()=>{}),r.addMxEntity(a)}))}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(r){return this.startPoint=r,this}setEndPoint(r){return this.endPoint=r,this}worldDraw(r){console.log(1111);let{startPoint:o,endPoint:a}=this;if(o&&(this.startAngle=this.computePointAngle(o)),a&&(this.endAngle=this.computePointAngle(a)),o&&a){const{points:v}=this.drawEllipseShape(r);this.startPoint=v[0]}}computePointAngle(r){return this.radius=this.center.distanceTo(r),THREE.MathUtils.degToRad(calculateArcAngle(r,this.center,this.radius).angle)}getGripPoints(){return[this.center,this.startPoint,this.endPoint]}moveGripPointsAt(r,o){return r===0?(this.center.add(o),this.startPoint.add(o),this.endPoint.add(o)):r===1?this.startPoint.add(o):r===2&&this.endPoint.add(o),!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(r){r.getType()===McGiWorldDrawType$1.kDynDragDraw?(r.drawCircle(this.center,this.innerRadius),r.drawCircle(this.center,this.outerRadius)):this.drawArcShape(r)}drawArcShape(r){const{center:o,startAngle:a,endAngle:v,clockwise:h}=this,{x:b,y:D}=o;this.isClosedToCenter=!1;const U=this.createEllipseCurve(b,D,this.innerRadius,this.innerRadius,a,v,h),V=this.createEllipseCurve(b,D,this.outerRadius,this.outerRadius,v,a,!h),I=this.createPaths([U,V]);let g=this.getShapePoints(I);this._draw(r,g),this._drawStoreLine(r,g)}getGripPoints(){return[this.center]}moveGripPointsAt(r,o){return r===0&&this.center.add(o),!0}}function drawMxDbArcShape(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new McEdGetPointWorldDrawObject;let a=new MxDbArcShapeDraw;w.setMessage(`
|
|
确定圆弧中点:`),w.setUserDraw(o),w.go(()=>Si(this,null,function*(){w.setMessage(`
|
|
确定圆弧开始点:`),a.center=w.value(),o.setDraw(v=>{a.interRadiusPoint=v,o.drawCircle(a.center,v.distanceTo(a.center))}),a.interRadiusPoint=(yield w.go())||new THREE.Vector3,o.setDraw(v=>{a.outerRadiusPoint=v,o.drawCustomEntity(a)}),a.outerRadiusPoint=(yield w.go())||new THREE.Vector3,r.addMxEntity(a)}))}class MxDbArcShapeDraw extends MxDbArcShape{getTypeName(){return"MxDbArcShapeDraw"}constructor(){super(),this.outerRadiusPoint=new THREE.Vector3,this.interRadiusPoint=new THREE.Vector3,this._propertyDbKeys=[...this._propertyDbKeys,"interRadiusPoint","outerRadiusPoint"]}worldDraw(r){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(r)}getGripPoints(){return[this.center,this.interRadiusPoint,this.outerRadiusPoint]}moveGripPointsAt(r,o){return r===0&&(this.center.add(o),this.interRadiusPoint.add(o),this.outerRadiusPoint.add(o)),r===1&&this.interRadiusPoint.add(o),r===2&&this.outerRadiusPoint.add(o),!0}}function drawMxDbRingShape(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new McEdGetPointWorldDrawObject;w.setUserDraw(o);const a=new McEdGetPointWorldDrawObject,v=new MxDbRingShapeDraw;w.setUserDraw(a),w.setMessage(`
|
|
确定圆弧开始点:`),w.go(h=>Si(this,null,function*(){console.log(123),v.center=w.value(),a.setDraw(b=>{a.drawCircle(v.center,v.center.distanceTo(b))}),v.innerPoint=(yield w.go())||new THREE.Vector3,a.setDraw(b=>{v.outerPoint=b,a.drawCustomEntity(v)}),v.outerPoint=(yield w.go())||new THREE.Vector3,r.addMxEntity(v)}))}MxDbArcShapeDraw.isRegister=!1,MxDbArcShapeDraw.cmd="Mx_MxDbArcShape",MxDbArcShapeDraw.draw=drawMxDbArcShape,addRegisterMxDbEntity(MxDbArcShapeDraw);class MxDbRingShape extends MxDbArcShape{getTypeName(){return"MxDbRingShape"}worldDraw(r){const{center:o,startAngle:a,endAngle:v,clockwise:h}=this,{x:b,y:D}=o;this.isClosedToCenter=!1;const U=this.createEllipseCurve(b,D,this.innerRadius,this.innerRadius,a,v,h),V=this.createEllipseCurve(b,D,this.outerRadius,this.outerRadius,a,v,!h),I=this.createPaths([U,V]);let g=this.getShapePoints(I);const A=this.createPaths(U);let M=this.getShapePoints(A);const N=this.createPaths(V);let F=this.getShapePoints(N);this.isFill?(this._draw(r,g),this._drawStoreLine(r,M),this._drawStoreLine(r,F)):(this._draw(r,M),this._drawStoreLine(r,M),this._draw(r,F),this._drawStoreLine(r,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(r,o){return r===0&&(this.center.add(o),this.innerPoint.add(o),this.outerPoint.add(o)),r===1&&this.innerPoint.add(o),r===2&&this.outerPoint.add(o),!0}worldDraw(r){this.innerPoint&&(this.innerRadius=this.center.distanceTo(this.innerPoint)),this.outerPoint&&(this.outerRadius=this.center.distanceTo(this.outerPoint)),super.worldDraw(r)}}function drawMxDbStarShape(){const w=new MrxDbgUiPrPoint,r=MxFun.getCurrentDraw(),o=new McEdGetPointWorldDrawObject;w.setUserDraw(o);const a=new McEdGetPointWorldDrawObject,v=new MxDbStarShapeDraw;w.setUserDraw(a),w.setMessage(`
|
|
确定圆弧开始点:`),w.go(h=>Si(this,null,function*(){v.center=w.value(),a.setDraw(b=>{v.innerPoint=b,a.drawCircle(v.center,v.center.distanceTo(b))}),v.innerPoint=(yield w.go())||new THREE.Vector3,a.setDraw(b=>{v.outerPoint=b,a.drawCustomEntity(v)}),v.outerPoint=(yield w.go())||new THREE.Vector3,r.addMxEntity(v)}))}addRegisterMxDbEntity(MxDbRingShape);class MxDbStarShape extends MxDbShape{getTypeName(){return"MxDbStarShape"}constructor(){super(),this.center=new THREE.Vector3,this.numPoints=10,this.innerRadius=10,this.outerRadius=10,this._propertyDbKeys=[...this._propertyDbKeys,"center","numPoints","innerRadius","outerRadius"]}worldDraw(r){const{x:o,y:a}=this.center,v=new THREE.Path;v.moveTo(o,a-this.outerRadius);for(let D=1;D<2*this.numPoints;D++){const U=D%2==0?this.outerRadius:this.innerRadius,V=U*Math.sin(D*Math.PI/this.numPoints)+o,I=-1*U*Math.cos(D*Math.PI/this.numPoints)+a;v.lineTo(V,I)}v.closePath();const h=this.createPaths(v),b=this.getShapePoints(h);this._draw(r,b),this._drawStoreLine(r,b)}getGripPoints(){return[this.center]}moveGripPointsAt(r,o){return r===0&&this.center.add(o),!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(r,o){return r===0&&(this.center.add(o),this.innerPoint.add(o),this.outerPoint.add(o)),r===1&&this.innerPoint.add(o),r===2&&this.outerPoint.add(o),!0}worldDraw(r){this.innerPoint&&(this.innerRadius=this.center.distanceTo(this.innerPoint)),this.outerPoint&&(this.outerRadius=this.center.distanceTo(this.outerPoint)),super.worldDraw(r)}}addRegisterMxDbEntity(MxDbStarShape);class MxDbRegularPolygonShape extends MxDbShape{getTypeName(){return"MxDbRegularPolygonShape"}constructor(){super(),this.center=new THREE.Vector3,this.sidesNumber=6,this.radius=70,this._propertyDbKeys=[...this._propertyDbKeys,"center","sidesNumber","radius"]}worldDraw(r){this._drawPolygonShape(r)}_drawPolygonShape(r){const o=this._getPoints(),a=new THREE.Path;a.moveTo(o[0].x,o[0].y);for(let b=0;b<o.length;b++)a.lineTo(o[b].x,o[b].y);a.closePath();const v=this.createPaths(a),h=this.getShapePoints(v);this._draw(r,h),this._drawStoreLine(r,h)}_getPoints(){const{sidesNumber:r,radius:o}=this,{x:a,y:v}=this.center,h=[];for(let b=0;b<r;b++)h.push({x:o*Math.sin(2*b*Math.PI/r)+a,y:-1*o*Math.cos(2*b*Math.PI/r)+v});return h}getGripPoints(){return[this.center]}moveGripPointsAt(r,o){return r===0&&this.center.add(o),!0}}function getScreenPixel(w,r){let o=MxFun.screenCoordLong2World(r?w:w-w/3);return o=MxFun.worldCoordLong2Doc(o)}function drawMxDbArrow(){const w=new McEdGetPointWorldDrawObject,r=new MxDbArrow,o=MxFun.getCurrentDraw(),a=new MrxDbgUiPrPoint;a.setUserDraw(w),r.setLineWidth(10),a.go(()=>{r.innerOffset=getScreenPixel(10),r.outerOffset=getScreenPixel(22),r.topOffset=getScreenPixel(36),r.startPoint=a.value(),w.setDraw(v=>{r.endPoint=v,w.drawCustomEntity(r)}),a.go(v=>Si(this,null,function*(){r.endPoint=a.value(),o.addMxEntity(r)}))})}addRegisterMxDbEntity(MxDbRegularPolygonShape);class MxDbArrow extends MxDbShape{constructor(){super(),this.isSharpCorner=!1,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(r){const o=this.getArrowVertex(this.startPoint,this.endPoint);o&&(this._draw(r,o),this._drawStoreLine(r,o))}getArrowVertex(r,o,a=this.isSharpCorner){let{innerOffset:v,topOffset:h,outerOffset:b}=this;const D=[];D[3]=o;const U=Math.sqrt((r.x-o.x)*(r.x-o.x)+(r.y-o.y)*(r.y-o.y));if(U===0)return;const V=-(o.x-r.x)/U,I=(o.y-r.y)/U,g=r.x+v,A=r.y+U-h,M=r.x+b,N=r.y+U-h,F=r.x-v,T=r.y+U-h,_=r.x-b,Y=r.y+U-h;return a?(D[0]=r,D[6]=D[0]):(D[0]=new THREE.Vector3(r.x-(F-r.x)*I,r.y-(F-r.x)*V),D[6]=new THREE.Vector3(r.x+(F-r.x)*I,r.y+(F-r.x)*V),D[7]=D[0]),D[1]=new THREE.Vector3(r.x+(g-r.x)*I-(A-r.y)*V,r.y+(g-r.x)*V+(A-r.y)*I),D[2]=new THREE.Vector3(r.x+(M-r.x)*I-(N-r.y)*V,r.y+(M-r.x)*V+(N-r.y)*I),D[4]=new THREE.Vector3(r.x+(_-r.x)*I-(Y-r.y)*V,r.y+(_-r.x)*V+(Y-r.y)*I),D[5]=new THREE.Vector3(r.x+(F-r.x)*I-(T-r.y)*V,r.y+(F-r.x)*V+(T-r.y)*I),D}getGripPoints(){const r=new THREE.Vector3;return new THREE.Line3(this.startPoint,this.endPoint).getCenter(r),[this.startPoint,r,this.endPoint]}moveGripPointsAt(r,o){return r===0&&this.startPoint.add(o),r===1&&(this.startPoint.add(o),this.endPoint.add(o)),r===2&&this.endPoint.add(o),!0}getCornerRadiusPoints(r){return r}}MxDbArrow.cmd="Mx_MxDbArrow",MxDbArrow.draw=drawMxDbArrow,addRegisterMxDbEntity(MxDbArrow);class MxDbLineShape extends MxDbShape{setPoints(r){return this.points=r,this}addPoint(r){return this.points.push(r),this}removePoint(r){return this.points.splice(r,1),this}constructor(){super(),this.points=[],this._propertyDbKeys=[...this._propertyDbKeys,"points"]}getTypeName(){return"MxDbLineShape"}worldDraw(r){this._draw(r,this.points),this._drawStoreLine(r,this.points)}getGripPoints(){return this.points}moveGripPointsAt(r,o){return this.points[r].add(o),!0}getGeomExtents(){return new THREE.Box3().setFromPoints(this.points)}getGetLength(){let r=0;for(let o=0;o++;o<this.points.length)this.points[o+1]&&(r+=this.points[o].distanceTo(this.points[o+1]));return r}}function drawMxDbSplineCurve(){return Si(this,null,function*(){const w=new MrxDbgUiPrPoint,r=new MxDbSplineCurve;w.setMessage(`
|
|
指定第一个点:`),w.goWhile(o=>Si(this,null,function*(){if(o===MrxDbgUiPrBaseReturn$1.kOk)r.points.push(w.value()),w.setUserDraw((a,v)=>{const h=r.clone();h.points.push(a),v.drawCustomEntity(h),r.points.length===0?w.setMessage(`
|
|
指定第一个点:`):(w.setMessage(`
|
|
指定下一个点:`),w.setKeyWords("[闭合(C)/ 放弃(U)]"))});else if(o===MrxDbgUiPrBaseReturn$1.kKeyWord){if(w.isKeyWordPicked("C"))return r.closed=!0,{exit:!0};w.isKeyWordPicked("U")&&r.points.pop()}}),()=>{MxFun.getCurrentDraw().addMxEntity(r)})})}addRegisterMxDbEntity(MxDbLineShape);const propertyDbKeys=["points","closed","tension","curveType"];class MxDbSplineCurve extends MxDbEntity{constructor(){super(...arguments),this.points=[],this.closed=!1,this.tension=.5,this.curveType="centripetal"}worldDraw(r){const o=new THREE.CatmullRomCurve3(this.points,this.closed,"catmullrom",this.tension).getPoints(15*this.points.length),a=new THREE.Geometry().setFromPoints(o),v=new THREE.LineBasicMaterial({color:this.color}),h=new THREE.Line(a,v);r.drawEntity(h)}getGripPoints(){return this.points}moveGripPointsAt(r,o){return this.points[r].add(o),!0}create(){return new MxDbSplineCurve}dwgIn(r){return this.onDwgIn(r),this.dwgInHelp(r,propertyDbKeys),!0}dwgOut(r){return this.onDwgOut(r),this.dwgOutHelp(r,propertyDbKeys),r}getTypeName(){return"MxDbSplineCurve"}}MxDbSplineCurve.draw=drawMxDbSplineCurve,MxDbSplineCurve.cmd="Mx_Spline",addRegisterMxDbEntity(MxDbSplineCurve);class MrxDbgUiPrDist extends MrxDbgUiPrBase{constructor(){var r;super(new((r=store.state.MxFun)===null||r===void 0?void 0:r.getMxJigCmdManager().getMrxDbgUiPrDistClass()))}value(){return this.imp.value()}basePt(){return this.imp.basePt()}setBasePt(r){return this.imp.setBasePt(r)}setUseBasePt(r){return this.imp.setUseBasePt(r)}go(r){let o=this;return r?(o.imp.go(a=>{o.status=a,r(a)}),new Promise((a,v)=>{a(null)})):new Promise((a,v)=>{o.imp.go(h=>{o.status=h,a(h!=0?null:o.imp.value())})})}}class MrxDbgUiPrInt extends MrxDbgUiPrBase{constructor(){var r;super(new((r=store.state.MxFun)===null||r===void 0?void 0:r.getMxJigCmdManager().getMrxDbgUiPrIntClass()))}value(){return this.imp.value()}go(r){let o=this;return r?(o.imp.go(a=>{o.status=a,r(a)}),new Promise((a,v)=>{a(null)})):new Promise((a,v)=>{o.imp.go(h=>{o.status=h,a(h!=0?null:o.imp.value())})})}}class MrxDbgUiPrString extends MrxDbgUiPrBase{constructor(){var r;super(new((r=store.state.MxFun)===null||r===void 0?void 0:r.getMxJigCmdManager().getMrxDbgUiPrStringClass()))}value(){return this.imp.value()}go(r){let o=this;return r?(o.imp.go(a=>{o.status=a,r(a)}),new Promise((a,v)=>{a(null)})):new Promise((a,v)=>{o.imp.go(h=>{o.status=h,a(h!=0?null:o.imp.value())})})}}class MrxDbgUiPrKeyWord extends MrxDbgUiPrBase{constructor(){var r;super(new((r=store.state.MxFun)===null||r===void 0?void 0:r.getMxJigCmdManager().getMrxDbgUiPrKeyWordClass()))}go(r){let o=this;return r?(o.imp.go(a=>{o.status=a,r(a)}),new Promise((a,v)=>{a(null)})):new Promise((a,v)=>{o.imp.go(h=>{o.status=h,a(h!=0?null:o.keyWordPicked())})})}}class MrxDbgUiPrAngle extends MrxDbgUiPrBase{constructor(){var r;super(new((r=store.state.MxFun)===null||r===void 0?void 0:r.getMxJigCmdManager().getMrxDbgUiPrAngleClass()))}value(){return this.imp.value()}basePt(){return this.imp.basePt()}setBasePt(r){return this.imp.setBasePt(r)}setUseBasePt(r){return this.imp.setUseBasePt(r)}go(r){let o=this;return r?(o.imp.go(a=>{o.status=a,r(a)}),new Promise((a,v)=>{a(null)})):new Promise((a,v)=>{o.imp.go(h=>{o.status=h,a(h!=0?null:o.imp.value())})})}}var elementResizeEventPolyfill_umd_min=createCommonjsModule(function(w,r){w.exports=function(o){var a={};function v(h){if(a[h])return a[h].exports;var b=a[h]={i:h,l:!1,exports:{}};return o[h].call(b.exports,b,b.exports,v),b.l=!0,b.exports}return v.m=o,v.c=a,v.d=function(h,b,D){v.o(h,b)||Object.defineProperty(h,b,{enumerable:!0,get:D})},v.r=function(h){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})},v.t=function(h,b){if(1&b&&(h=v(h)),8&b||4&b&&typeof h=="object"&&h&&h.__esModule)return h;var D=Object.create(null);if(v.r(D),Object.defineProperty(D,"default",{enumerable:!0,value:h}),2&b&&typeof h!="string")for(var U in h)v.d(D,U,function(V){return h[V]}.bind(null,U));return D},v.n=function(h){var b=h&&h.__esModule?function(){return h.default}:function(){return h};return v.d(b,"a",b),b},v.o=function(h,b){return Object.prototype.hasOwnProperty.call(h,b)},v.p="",v(v.s="fae3")}({"6dd8":function(o,a,v){(function(h){var b=function(){if(typeof Map!="undefined")return Map;function X(J,te){var ne=-1;return J.some(function(ue,be){return ue[0]===te&&(ne=be,!0)}),ne}return function(){function J(){this.__entries__=[]}return Object.defineProperty(J.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),J.prototype.get=function(te){var ne=X(this.__entries__,te),ue=this.__entries__[ne];return ue&&ue[1]},J.prototype.set=function(te,ne){var ue=X(this.__entries__,te);~ue?this.__entries__[ue][1]=ne:this.__entries__.push([te,ne])},J.prototype.delete=function(te){var ne=this.__entries__,ue=X(ne,te);~ue&&ne.splice(ue,1)},J.prototype.has=function(te){return!!~X(this.__entries__,te)},J.prototype.clear=function(){this.__entries__.splice(0)},J.prototype.forEach=function(te,ne){ne===void 0&&(ne=null);for(var ue=0,be=this.__entries__;ue<be.length;ue++){var je=be[ue];te.call(ne,je[1],je[0])}},J}()}(),D=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,U=h!==void 0&&h.Math===Math?h:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")(),V=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(U):function(X){return setTimeout(function(){return X(Date.now())},1e3/60)},I=2,g=20,A=["top","right","bottom","left","width","height","size","weight"],M=typeof MutationObserver!="undefined",N=function(){function X(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(J,te){var ne=!1,ue=!1,be=0;function je(){ne&&(ne=!1,J()),ue&&Be()}function ve(){V(je)}function Be(){var q=Date.now();if(ne){if(q-be<I)return;ue=!0}else ne=!0,ue=!1,setTimeout(ve,te);be=q}return Be}(this.refresh.bind(this),g)}return X.prototype.addObserver=function(J){~this.observers_.indexOf(J)||this.observers_.push(J),this.connected_||this.connect_()},X.prototype.removeObserver=function(J){var te=this.observers_,ne=te.indexOf(J);~ne&&te.splice(ne,1),!te.length&&this.connected_&&this.disconnect_()},X.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},X.prototype.updateObservers_=function(){var J=this.observers_.filter(function(te){return te.gatherActive(),te.hasActive()});return J.forEach(function(te){return te.broadcastActive()}),J.length>0},X.prototype.connect_=function(){D&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),M?(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)},X.prototype.disconnect_=function(){D&&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)},X.prototype.onTransitionEnd_=function(J){var te=J.propertyName,ne=te===void 0?"":te;A.some(function(ue){return!!~ne.indexOf(ue)})&&this.refresh()},X.getInstance=function(){return this.instance_||(this.instance_=new X),this.instance_},X.instance_=null,X}(),F=function(X,J){for(var te=0,ne=Object.keys(J);te<ne.length;te++){var ue=ne[te];Object.defineProperty(X,ue,{value:J[ue],enumerable:!1,writable:!1,configurable:!0})}return X},T=function(X){return X&&X.ownerDocument&&X.ownerDocument.defaultView||U},_=B(0,0,0,0);function Y(X){return parseFloat(X)||0}function k(X){for(var J=[],te=1;te<arguments.length;te++)J[te-1]=arguments[te];return J.reduce(function(ne,ue){return ne+Y(X["border-"+ue+"-width"])},0)}function S(X){var J=X.clientWidth,te=X.clientHeight;if(!J&&!te)return _;var ne=T(X).getComputedStyle(X),ue=function(oe){for(var le={},Pe=0,Ye=["top","right","bottom","left"];Pe<Ye.length;Pe++){var ze=Ye[Pe],se=oe["padding-"+ze];le[ze]=Y(se)}return le}(ne),be=ue.left+ue.right,je=ue.top+ue.bottom,ve=Y(ne.width),Be=Y(ne.height);if(ne.boxSizing==="border-box"&&(Math.round(ve+be)!==J&&(ve-=k(ne,"left","right")+be),Math.round(Be+je)!==te&&(Be-=k(ne,"top","bottom")+je)),!function(oe){return oe===T(oe).document.documentElement}(X)){var q=Math.round(ve+be)-J,ge=Math.round(Be+je)-te;Math.abs(q)!==1&&(ve-=q),Math.abs(ge)!==1&&(Be-=ge)}return B(ue.left,ue.top,ve,Be)}var G=typeof SVGGraphicsElement!="undefined"?function(X){return X instanceof T(X).SVGGraphicsElement}:function(X){return X instanceof T(X).SVGElement&&typeof X.getBBox=="function"};function C(X){return D?G(X)?function(J){var te=J.getBBox();return B(0,0,te.width,te.height)}(X):S(X):_}function B(X,J,te,ne){return{x:X,y:J,width:te,height:ne}}var R=function(){function X(J){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=B(0,0,0,0),this.target=J}return X.prototype.isActive=function(){var J=C(this.target);return this.contentRect_=J,J.width!==this.broadcastWidth||J.height!==this.broadcastHeight},X.prototype.broadcastRect=function(){var J=this.contentRect_;return this.broadcastWidth=J.width,this.broadcastHeight=J.height,J},X}(),u=function(){return function(X,J){var te=function(ne){var ue=ne.x,be=ne.y,je=ne.width,ve=ne.height,Be=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,q=Object.create(Be.prototype);return F(q,{x:ue,y:be,width:je,height:ve,top:be,right:ue+je,bottom:ve+be,left:ue}),q}(J);F(this,{target:X,contentRect:te})}}(),c=function(){function X(J,te,ne){if(this.activeObservations_=[],this.observations_=new b,typeof J!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=J,this.controller_=te,this.callbackCtx_=ne}return X.prototype.observe=function(J){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(J instanceof T(J).Element))throw new TypeError('parameter 1 is not of type "Element".');var te=this.observations_;te.has(J)||(te.set(J,new R(J)),this.controller_.addObserver(this),this.controller_.refresh())}},X.prototype.unobserve=function(J){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(J instanceof T(J).Element))throw new TypeError('parameter 1 is not of type "Element".');var te=this.observations_;te.has(J)&&(te.delete(J),te.size||this.controller_.removeObserver(this))}},X.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},X.prototype.gatherActive=function(){var J=this;this.clearActive(),this.observations_.forEach(function(te){te.isActive()&&J.activeObservations_.push(te)})},X.prototype.broadcastActive=function(){if(this.hasActive()){var J=this.callbackCtx_,te=this.activeObservations_.map(function(ne){return new u(ne.target,ne.broadcastRect())});this.callback_.call(J,te,J),this.clearActive()}},X.prototype.clearActive=function(){this.activeObservations_.splice(0)},X.prototype.hasActive=function(){return this.activeObservations_.length>0},X}(),f=typeof WeakMap!="undefined"?new WeakMap:new b,O=function(){return function X(J){if(!(this instanceof X))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var te=N.getInstance(),ne=new c(J,te,this);f.set(this,ne)}}();["observe","unobserve","disconnect"].forEach(function(X){O.prototype[X]=function(){var J;return(J=f.get(this))[X].apply(J,arguments)}});var W=U.ResizeObserver!==void 0?U.ResizeObserver:O;a.a=W}).call(this,v("c8ba"))},c8ba:function(o,a){var v;v=function(){return this}();try{v=v||new Function("return this")()}catch(h){typeof window=="object"&&(v=window)}o.exports=v},f6fd:function(o,a){(function(v){var h="currentScript",b=v.getElementsByTagName("script");h in v||Object.defineProperty(v,h,{get:function(){try{throw new Error}catch(V){var D,U=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(V.stack)||[!1])[1];for(D in b)if(b[D].src==U||b[D].readyState=="interactive")return b[D];return null}}})})(document)},fae3:function(o,a,v){var h;v.r(a),v.d(a,"EventListenerWrapper",function(){return V}),typeof window!="undefined"&&(v("f6fd"),(h=window.document.currentScript)&&(h=h.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(v.p=h[1]));var b=v("6dd8");const D=EventTarget.prototype.addEventListener,U=function(A){const M=document.createEvent("HTMLEvents");return M.initEvent(A),M},V=function(A){A==="resize"&&g(this),D.apply(this,arguments)};function I(A){const M=I.observer=I.observer||new b.a(A);return M.initialized=!0,M}function g(A){const M=I(N=>{if(M.initialized)M.initialized=!1;else for(let F of N){const T=U("resize");F.target.dispatchEvent(T),F&&F.target&&typeof F.target.onresize=="function"&&F.target.onresize(T)}});M.observe(A)}HTMLElement.prototype.addEventListener=V,Reflect.defineProperty(HTMLElement.prototype,"onresize",{set(A){this._onresize=A,typeof A=="function"&&g(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});export{DetailedResult as D,MxFun as M,MrxDbgUiPrBaseReturn$1 as a,MxCursorType as b,DynamicInputType as c,MrxDbgUtils as d,MrxDbgUiPrPoint as e,MrxDbgUiPrDist as f,MrxDbgUiPrAngle as g,MrxDbgUiPrInt as h,MrxDbgUiPrKeyWord as i,MrxDbgUiPrString as j,MxDrawObject as k,loadCoreCode as l,MxType as m,MxDbArrow as n,MxDbLeadComment as o,MxDbArea as p,McEdGetPointWorldDrawObject as q,MxDbCoord as r,store as s,MxDb2LineAngularDimension as t,MxThreeJS as u};
|