Files
workGit/数字孪生可视化大屏vue源码/BYDVue2TV/public/app.2e897c39.js
2026-05-23 14:11:26 +08:00

2 lines
155 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function(t){function e(e){for(var n,o,s=e[0],c=e[1],l=e[2],u=0,f=[];u<s.length;u++)o=s[u],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&f.push(r[o][0]),r[o]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(t[n]=c[n]);d&&d(e);while(f.length)f.shift()();return i.push.apply(i,l||[]),a()}function a(){for(var t,e=0;e<i.length;e++){for(var a=i[e],n=!0,s=1;s<a.length;s++){var c=a[s];0!==r[c]&&(n=!1)}n&&(i.splice(e--,1),t=o(o.s=a[0]))}return t}var n={},r={app:0},i=[];function o(e){if(n[e])return n[e].exports;var a=n[e]={i:e,l:!1,exports:{}};return t[e].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.m=t,o.c=n,o.d=function(t,e,a){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(a,n,function(e){return t[e]}.bind(null,n));return a},o.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],c=s.push.bind(s);s.push=e,s=s.slice();for(var l=0;l<s.length;l++)e(s[l]);var d=c;i.push([1,"chunk-vendors"]),a()})({0:function(t,e){},"034f":function(t,e,a){"use strict";var n=a("108a"),r=a.n(n);r.a},1:function(t,e,a){t.exports=a("56d7")},"108a":function(t,e,a){},"1c3a":function(t,e,a){t.exports=a.p+"media/alarm.43363501.mp3"},2:function(t,e){},"25c7":function(t,e,a){},3:function(t,e){},3127:function(t,e,a){"use strict";var n=a("25c7"),r=a.n(n);r.a},"3a6c":function(t,e,a){},4:function(t,e){},5:function(t,e){},"56d7":function(t,e,a){"use strict";a.r(e);a("e260"),a("e6cf"),a("cca6"),a("a79d");var n=a("2b0e"),r=(a("0fae"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"app"}},[a("keep-alive",[this.$route.meta.keepAlive?a("router-view"):t._e()],1),this.$route.meta.keepAlive?t._e():a("router-view")],1)}),i=[],o=(a("034f"),a("2877")),s={},c=Object(o["a"])(s,r,i,!1,null,null,null);c.options.__file="App.vue";var l=c.exports,d=a("2f62"),u=a("a78e"),f=a.n(u),h={state:{sidebar:{opened:!+f.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},mutations:{TOGGLE_SIDEBAR:function(t){t.sidebar.opened?f.a.set("sidebarStatus",1):f.a.set("sidebarStatus",0),t.sidebar.opened=!t.sidebar.opened,t.sidebar.withoutAnimation=!1},CLOSE_SIDEBAR:function(t,e){f.a.set("sidebarStatus",1),t.sidebar.opened=!1,t.sidebar.withoutAnimation=e},TOGGLE_DEVICE:function(t,e){t.device=e}},actions:{ToggleSideBar:function(t){var e=t.commit;e("TOGGLE_SIDEBAR")},CloseSideBar:function(t,e){var a=t.commit,n=e.withoutAnimation;a("CLOSE_SIDEBAR",n)},ToggleDevice:function(t,e){var a=t.commit;a("TOGGLE_DEVICE",e)}}},v=h,p=a("2909"),g=a("3835"),m=a("b85c"),y=(a("d3b7"),a("b0c0"),a("ddb0"),a("a434"),a("fb6a"),{state:{visitedViews:[],cachedViews:[]},mutations:{ADD_VISITED_VIEWS:function(t,e){t.visitedViews.some((function(t){return t.path===e.path}))||(t.visitedViews.push({name:e.name,path:e.path,title:e.meta.title||"no-name"}),e.meta.noCache||t.cachedViews.push(e.name))},DEL_VISITED_VIEWS:function(t,e){var a,n=Object(m["a"])(t.visitedViews.entries());try{for(n.s();!(a=n.n()).done;){var r=Object(g["a"])(a.value,2),i=r[0],o=r[1];if(o.path===e.path){t.visitedViews.splice(i,1);break}}}catch(u){n.e(u)}finally{n.f()}var s,c=Object(m["a"])(t.cachedViews);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(l===e.name){var d=t.cachedViews.indexOf(l);t.cachedViews.splice(d,1);break}}}catch(u){c.e(u)}finally{c.f()}},DEL_OTHERS_VIEWS:function(t,e){var a,n=Object(m["a"])(t.visitedViews.entries());try{for(n.s();!(a=n.n()).done;){var r=Object(g["a"])(a.value,2),i=r[0],o=r[1];if(o.path===e.path){t.visitedViews=t.visitedViews.slice(i,i+1);break}}}catch(u){n.e(u)}finally{n.f()}var s,c=Object(m["a"])(t.cachedViews);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(l===e.name){var d=t.cachedViews.indexOf(l);t.cachedViews=t.cachedViews.slice(d,l+1);break}}}catch(u){c.e(u)}finally{c.f()}},DEL_ALL_VIEWS:function(t){t.visitedViews=[],t.cachedViews=[]}},actions:{addVisitedViews:function(t,e){var a=t.commit;a("ADD_VISITED_VIEWS",e)},delVisitedViews:function(t,e){var a=t.commit,n=t.state;return new Promise((function(t){a("DEL_VISITED_VIEWS",e),t(Object(p["a"])(n.visitedViews))}))},delOthersViews:function(t,e){var a=t.commit,n=t.state;return new Promise((function(t){a("DEL_OTHERS_VIEWS",e),t(Object(p["a"])(n.visitedViews))}))},delAllViews:function(t){var e=t.commit,a=t.state;return new Promise((function(t){e("DEL_ALL_VIEWS"),t(Object(p["a"])(a.visitedViews))}))}}}),b=y,x=(a("498a"),"Admin-Token");function w(){return f.a.get(x)}function S(t){return f.a.set(x,t)}function _(){return f.a.remove(x)}var T=a("5c96"),C=a.n(T),A=a("bc3a"),O=a.n(A),B={state:{token:w(),name:f.a.get("name"),roles:[],id:f.a.get("id")},mutations:{SET_TOKEN:function(t,e){t.token=e},SET_NAME:function(t,e){t.name=e},SET_ROLES:function(t,e){t.roles=e},SET_ID:function(t,e){t.id=e}},actions:{Login:function(t,e){var a=this,n=t.commit,r=e.username.trim(),i=e.password.trim();return new Promise((function(t,e){var o="?userName="+r+"&passWord="+i;O.a.get(o).then((function(e){var i=e.data;if(!1===i.IsSuccess){var o="错误"+e.data.ErrorCode+","+i.ErrorDesc;Object(T["Message"])({showClose:!0,message:o,type:"error"}),a.$router.push({path:"/login"})}""===i.token||""===i.$id||""===i?(T["Message"].error("账号或密码错误,请重新登录"),a.$router.push({path:"/login"})):(S(i.token),f.a.set("id",i.$id,{expires:1}),f.a.set("name",r,{expires:1}),n("SET_TOKEN",i.token),n("SET_NAME",r),n("SET_ID",i.$id),t({data:i,commit:n}))})).catch((function(t){e(t)}))}))},FedLogOut:function(t){var e=t.commit;return new Promise((function(t){e("SET_TOKEN",""),f.a.remove("name"),f.a.remove("id"),_(),t()}))}}},D=B,M=(a("99af"),a("8c4f")),P=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"background"},[a("el-row",[a("div",{staticStyle:{position:"relative",height:"980px"}},[a("div",{staticStyle:{height:"100%",width:"100%",position:"absolute"}},[a("div",{staticStyle:{width:"100%",height:"980px",filter:"blur(10)","z-index":"999"}},[a("d-m-t",{ref:"dmtCom",attrs:{containerHeight:"980px",containerWidth:"100%"}})],1)]),a("div",{staticStyle:{position:"absolute",left:"10px",top:"10px",width:"200px",height:"30px"},on:{mouseover:function(e){t.isShowBtn="inline"},mouseleave:function(e){t.isShowBtn="none"}}},[a("div",{style:{display:t.isShowBtn}},[a("el-button",{staticStyle:{background:"#103666",color:"white",border:"1px solid #103666"},attrs:{size:"mini"},on:{click:t.restView}},[t._v("复原")])],1)])])])],1)},I=[],k=(a("313d"),a("0eb6"),a("b7ef"),a("8bd4"),a("ace4"),a("5cc6"),a("907a"),a("9a8c"),a("a975"),a("735e"),a("c1ac"),a("d139"),a("3a7b"),a("d5d6"),a("82f8"),a("e91f"),a("60bd"),a("5f96"),a("3280"),a("3fcc"),a("ca91"),a("25a1"),a("cd26"),a("3c5d"),a("2954"),a("649e"),a("219c"),a("170b"),a("b39a"),a("72f7"),a("13d5"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{height:"100%"}},[a("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"},style:{height:t.containerHeight,width:t.containerWidth},attrs:{id:"viewPort"}}),a("div",{ref:"modelProcess",staticStyle:{position:"absolute",top:"10px",left:"2px",color:"white"}},[t._v("正在加载模型0%")]),t._m(0)])}),j=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{display:"none"}},[n("audio",{attrs:{controls:"",loop:"",id:"alarm"}},[n("source",{attrs:{src:a("1c3a"),type:"audio/mpeg"}})]),n("audio",{attrs:{controls:"",id:"clash"}},[n("source",{attrs:{src:a("1c3a"),type:"audio/mpeg"}})])])}],L=(a("4ec9"),a("3ca3"),a("159b"),a("b64b"),a("b680"),a("ac1f"),a("5319"),a("5b81"),a("e9c4"),a("4de4"),a("53ca")),E=(a("d9e2"),a("131a"),a("3410"),a("f8c9"),a("4ae1"),a("a4d3"),a("e01a"),a("d28b"),a("a630"),a("00b4"),a("d81d"),a("1276"),a("cb29"),a("5a89"));function R(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function F(t,e,a){return e&&V(t.prototype,e),a&&V(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function N(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&W(t,e)}function H(t){return H=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},H(t)}function W(t,e){return W=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},W(t,e)}function z(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function U(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function q(t,e){if(e&&("object"===Object(L["a"])(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return U(t)}function Z(t){var e=z();return function(){var a,n=H(t);if(e){var r=H(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return q(this,a)}}function Y(t,e){return K(t)||Q(t,e)||$(t,e)||at()}function J(t){return G(t)||X(t)||$(t)||et()}function G(t){if(Array.isArray(t))return tt(t)}function K(t){if(Array.isArray(t))return t}function X(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Q(t,e){var a=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var n,r,i=[],o=!0,s=!1;try{for(a=a.call(t);!(o=(n=a.next()).done);o=!0)if(i.push(n.value),e&&i.length===e)break}catch(c){s=!0,r=c}finally{try{o||null==a["return"]||a["return"]()}finally{if(s)throw r}}return i}}function $(t,e){if(t){if("string"===typeof t)return tt(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?tt(t,e):void 0}}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}function et(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function at(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var nt="undefined"!==typeof window&&window.THREE?window.THREE:{LinearFilter:E["O"],Sprite:E["Mb"],SpriteMaterial:E["Nb"],Texture:E["Pb"]},rt=function(t){N(a,t);var e=Z(a);function a(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgba(255, 255, 255, 1)";return R(this,a),t=e.call(this,new nt.SpriteMaterial),t._text="".concat(n),t._textHeight=r,t._color=i,t._backgroundColor=!1,t._padding=0,t._borderWidth=0,t._borderRadius=0,t._borderColor="white",t._strokeWidth=0,t._strokeColor="white",t._fontFace="Arial",t._fontSize=90,t._fontWeight="normal",t._canvas=document.createElement("canvas"),t.material.depthTest=!1,t._genCanvas(),t}return F(a,[{key:"text",get:function(){return this._text},set:function(t){this._text=t,this._genCanvas()}},{key:"textHeight",get:function(){return this._textHeight},set:function(t){this._textHeight=t,this._genCanvas()}},{key:"color",get:function(){return this._color},set:function(t){this._color=t,this._genCanvas()}},{key:"backgroundColor",get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._genCanvas()}},{key:"padding",get:function(){return this._padding},set:function(t){this._padding=t,this._genCanvas()}},{key:"borderWidth",get:function(){return this._borderWidth},set:function(t){this._borderWidth=t,this._genCanvas()}},{key:"borderRadius",get:function(){return this._borderRadius},set:function(t){this._borderRadius=t,this._genCanvas()}},{key:"borderColor",get:function(){return this._borderColor},set:function(t){this._borderColor=t,this._genCanvas()}},{key:"fontFace",get:function(){return this._fontFace},set:function(t){this._fontFace=t,this._genCanvas()}},{key:"fontSize",get:function(){return this._fontSize},set:function(t){this._fontSize=t,this._genCanvas()}},{key:"fontWeight",get:function(){return this._fontWeight},set:function(t){this._fontWeight=t,this._genCanvas()}},{key:"strokeWidth",get:function(){return this._strokeWidth},set:function(t){this._strokeWidth=t,this._genCanvas()}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(t){this._strokeColor=t,this._genCanvas()}},{key:"_genCanvas",value:function(){var t=this,e=this._canvas,a=e.getContext("2d"),n=Array.isArray(this.borderWidth)?this.borderWidth:[this.borderWidth,this.borderWidth],r=n.map((function(e){return e*t.fontSize*.1})),i=Array.isArray(this.borderRadius)?this.borderRadius:[this.borderRadius,this.borderRadius,this.borderRadius,this.borderRadius],o=i.map((function(e){return e*t.fontSize*.1})),s=Array.isArray(this.padding)?this.padding:[this.padding,this.padding],c=s.map((function(e){return e*t.fontSize*.1})),l=this.text.split("\n"),d="".concat(this.fontWeight," ").concat(this.fontSize,"px ").concat(this.fontFace);a.font=d;var u=Math.max.apply(Math,J(l.map((function(t){return a.measureText(t).width})))),f=this.fontSize*l.length;if(e.width=u+2*r[0]+2*c[0],e.height=f+2*r[1]+2*c[1],this.borderWidth){if(a.strokeStyle=this.borderColor,r[0]){var h=r[0]/2;a.lineWidth=r[0],a.beginPath(),a.moveTo(h,o[0]),a.lineTo(h,e.height-o[3]),a.moveTo(e.width-h,o[1]),a.lineTo(e.width-h,e.height-o[2]),a.stroke()}if(r[1]){var v=r[1]/2;a.lineWidth=r[1],a.beginPath(),a.moveTo(Math.max(r[0],o[0]),v),a.lineTo(e.width-Math.max(r[0],o[1]),v),a.moveTo(Math.max(r[0],o[3]),e.height-v),a.lineTo(e.width-Math.max(r[0],o[2]),e.height-v),a.stroke()}if(this.borderRadius){var p=Math.max.apply(Math,J(r)),g=p/2;a.lineWidth=p,a.beginPath(),[!!o[0]&&[o[0],g,g,o[0]],!!o[1]&&[e.width-o[1],e.width-g,g,o[1]],!!o[2]&&[e.width-o[2],e.width-g,e.height-g,e.height-o[2]],!!o[3]&&[o[3],g,e.height-g,e.height-o[3]]].filter((function(t){return t})).forEach((function(t){var e=Y(t,4),n=e[0],r=e[1],i=e[2],o=e[3];a.moveTo(n,i),a.quadraticCurveTo(r,i,r,o)})),a.stroke()}}this.backgroundColor&&(a.fillStyle=this.backgroundColor,this.borderRadius?(a.beginPath(),a.moveTo(r[0],o[0]),[[r[0],o[0],e.width-o[1],r[1],r[1],r[1]],[e.width-r[0],e.width-r[0],e.width-r[0],r[1],o[1],e.height-o[2]],[e.width-r[0],e.width-o[2],o[3],e.height-r[1],e.height-r[1],e.height-r[1]],[r[0],r[0],r[0],e.height-r[1],e.height-o[3],o[0]]].forEach((function(t){var e=Y(t,6),n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],c=e[5];a.quadraticCurveTo(n,o,r,s),a.lineTo(i,c)})),a.closePath(),a.fill()):a.fillRect(r[0],r[1],e.width-2*r[0],e.height-2*r[1])),a.translate.apply(a,J(r)),a.translate.apply(a,J(c)),a.font=d,a.fillStyle=this.color,a.textBaseline="bottom";var m=this.strokeWidth>0;m&&(a.lineWidth=this.strokeWidth*this.fontSize/10,a.strokeStyle=this.strokeColor),l.forEach((function(e,n){var r=(u-a.measureText(e).width)/2,i=(n+1)*t.fontSize;m&&a.strokeText(e,r,i),a.fillText(e,r,i)})),this.material.map&&this.material.map.dispose();var y=this.material.map=new nt.Texture(e);y.minFilter=nt.LinearFilter,y.needsUpdate=!0;var b=this.textHeight*l.length+2*n[1]+2*s[1];this.scale.set(b*e.width/e.height,b,.001)}},{key:"clone",value:function(){return new this.constructor(this.text,this.textHeight,this.color).copy(this)}},{key:"copy",value:function(t){return nt.Sprite.prototype.copy.call(this,t),this.color=t.color,this.backgroundColor=t.backgroundColor,this.padding=t.padding,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.fontFace=t.fontFace,this.fontSize=t.fontSize,this.fontWeight=t.fontWeight,this.strokeWidth=t.strokeWidth,this.strokeColor=t.strokeColor,this}}]),a}(nt.Sprite),it=a("34ad"),ot=a("0ca5"),st=a("fd34"),ct=a("bee2"),lt=a("d4ec"),dt=a("257e"),ut=a("262e"),ft=a("2caf"),ht=(a("25f0"),a("4721")),vt={type:"change"},pt=function(t){Object(ut["a"])(a,t);var e=Object(ft["a"])(a);function a(t,n){var r;Object(lt["a"])(this,a),r=e.call(this,t,n),r.cubeControlDirection={TOP:"TOP",BOTTOM:"BOTTOM",FRONT:"FRONT",BACK:"BACK",LEFT:"LEFT",RIGHT:"RIGHT","BACK-LEFT":"BACK-LEFT","FRONT-LEFT":"FRONT-LEFT","TOP-LEFT":"TOP-LEFT","TOP-RIGHT":"TOP-RIGHT","RIGHT-BOTTOM":"RIGHT-BOTTOM","LEFT-BOTTOM":"LEFT-BOTTOM","BACK-BOTTOM":"BACK-BOTTOM","TOP-FRONT":"TOP-FRONT","FRONT-BOTTOM":"FRONT-BOTTOM","TOP-BACK":"TOP-BACK","RIGHT-FRONT":"RIGHT-FRONT","BACK-RIGHT":"BACK-RIGHT","BACK-RIGHT-BOTTOM":"BACK-RIGHT-BOTTOM","TOP-RIGHT-BACK":"TOP-RIGHT-BACK","TOP-LEFT-BACK":"TOP-LEFT-BACK","TOP-LEFT-FRONT":"TOP-LEFT-FRONT","FRONT-BOTTOM-RIGHT":"FRONT-BOTTOM-RIGHT","TOP-RIGHT-FRONT":"TOP-RIGHT-FRONT","BACK-BOTTOM-LEFT":"BACK-BOTTOM-LEFT","FRONT-BOTTOM-LEFT":"FRONT-BOTTOM-LEFT"};var i=Object(dt["a"])(r),o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};o.NONE;return r.resetState=function(t,e,a){i.target.copy(t),i.object.position.copy(e),i.object.isOrthographicCamera?i.object.zoom=a:i.object.zoom=1,i.object.updateProjectionMatrix(),i.dispatchEvent(vt),i.update(),o.NONE},r.resetStateTween=function(t,e,a,n,r){var i=this,o={x1:e.x,y1:e.y,z1:e.z,x2:t.x,y2:t.y,z2:t.z};i.enabled=!1;var s=new st["b"](o);s.to({x1:n.x,y1:n.y,z1:n.z,x2:a.x,y2:a.y,z2:a.z},r),s.onUpdate((function(){i.object.position.x=o.x1,i.object.position.y=o.y1,i.object.position.z=o.z1,i.target.x=o.x2,i.target.y=o.y2,i.target.z=o.z2,i.object.updateProjectionMatrix(),i.update()})),s.start(),s.onComplete((function(){i.enabled=!0})),s.easing(st["a"].Cubic.InOut)},r.setLookAt=function(t,e,a){i.target.copy(e),i.object.position.copy(t),i.object.zoom=a,i.object.updateProjectionMatrix(),i.dispatchEvent(vt),i.update(),o.NONE},r.setLookAt1=function(t,e){i.target.copy(this.target),i.object.rotation.copy(e),i.object.updateProjectionMatrix(),i.dispatchEvent(vt),i.update(),o.NONE},r.moveTo=function(t,e,a){i.target.set(t,e,a)},r.getState=function(){return{target:i.target.clone(),position:i.object.position.clone(),zoom:parseFloat(i.object.zoom.toString())}},r}return Object(ct["a"])(a)}(ht["a"]),gt=function(){function t(e,a){Object(lt["a"])(this,t),this.type="ObjectAlarmCommand",this.ModelId=a,this.editor=e,this.object=e.getObjectById(a)}return Object(ct["a"])(t,[{key:"exec",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.object&&(e?this.object.traverse((function(t){t instanceof E["ab"]&&!Object.hasOwnProperty.call(t.userData,"isAxis")&&(t.material.color=new E["l"]("#ff0000"),t.material.side=2,t.material.transparent=!0,t.material.opacity=.8)})):this.object.traverse((function(e){if(e instanceof E["ab"]){var a=t.editor.objMaterial.get(e.id);a&&(e.material=a.clone())}})))}}]),t}(),mt=function(t){var e=this,a=this;this.websocketMessage=function(n){new Promise((function(r,i){var o,s=n.data.split("|"),c=s[0],l=s[1],d=s[2],u=s[3],f=s[4];switch(c){case"DT":switch(l){case t.ProtocolIdentifiers.Robot_7:o=a.deviceMoveEvent.RobotTranslation7(d,u,f);break;case t.ProtocolIdentifiers.Device_3:console.log("设备运行"),o=a.deviceMoveEvent.DeviceThreeAxis(d,u,f);break;case t.ProtocolIdentifiers.Agv_3:console.log("AGV运行"),o=a.deviceMoveEvent.AGVThreeAxis(d,u,f);break;case t.ProtocolIdentifiers.Device_1:break;case t.ProtocolIdentifiers.FirstPosition:break;case t.ProtocolIdentifiers.WareHousePart:o=a.drawWareHousePartOne(d);break;case t.ProtocolIdentifiers.Robot_6:o=a.deviceMoveEvent.RobotTranslation(d,u,f);break;case t.ProtocolIdentifiers.ReLoadData:break;case t.ProtocolIdentifiers.PlayAct:a.playActData(d,parseInt(u));break;case t.ProtocolIdentifiers.Visible:o=a.visibleObjectToBS(d,u);break;case"JointMoveTo":JSON.parse(u)||console.log("JointMoveTo数据不对"+u),e.JointMoveTo(d,JSON.parse(u));break;case t.ProtocolIdentifiers.C_B_TagIDTrigger:var h=JSON.parse(d);a.solveTagValue(h.TagID,h.TagValue);break;case t.ProtocolIdentifiers.C_B_ObjectAlarm:var v=JSON.parse(d);console.log(v);var p,g=Object(m["a"])(v);try{for(g.s();!(p=g.n()).done;){var y=p.value;new gt(t,y.ModelId).exec(!!parseInt(y.value))}}catch(w){g.e(w)}finally{g.f()}break;case t.ProtocolIdentifiers.C_B_JointMoveTo:var b=JSON.parse(d);a.ModelJointMoveTo(b);break;case t.ProtocolIdentifiers.C_B_SparkTrigger:try{var x=JSON.parse(d);e.showWeld(x.ModelCode,x.TagValue)}catch(S){console.log(S)}break;case"showCheckOk":e.showCheckOk(d,u);break;default:o="不存在协议:"+n;break}break;default:break}r(o)}))},this.solveTagValue=function(a,n){var r=e,i=t.TagActList[a];if(i){var o,s=Object(m["a"])(i);try{for(s.s();!(o=s.n()).done;){var c=o.value;switch(c.HandlerType){case t.signalSolveType.warning:n===c.TagValue&&new gt(t,c.HandlerCode).exec(!!parseInt(c.HandlerValue));break;case t.signalSolveType.visible:n===c.TagValue&&r.visibleObjectToBS(c.HandlerCode,parseInt(c.HandlerValue));break;case t.signalSolveType.rotation:if(n===c.TagValue){var l=c.ValueFactor,d=c.Axis,u=c.Flip,f=c.HandlerCode;r.modelRotation(f,d,u*parseFloat(l))}break;case t.signalSolveType.craft:n===c.TagValue&&r.playActData(c.HandlerCode,parseInt(c.HandlerValue));break;case t.signalSolveType.targetLocation:r.solveServoSignal(c,n);break;case t.signalSolveType.attach:console.log("这个地方的附加功能没用写");break;default:break}}}catch(h){s.e(h)}finally{s.f()}}},this.playActData=function(a,n){var r=e;t.isOk&&(t.worker[a]||(t.worker[a]=new Worker("./DMT_WEB/webWorker/playFunction.js")),t.moveTrigger[a].moveStatus!==n&&(t.worker[a].postMessage({ActID:a,State:n,isOk:t.isOk,craftPlaySolveType:t.craftPlaySolveType,moveTrigger:JSON.stringify(t.moveTrigger[a])}),t.moveTrigger[a].moveStatus=n),t.worker[a].onmessage=function(e){t.moveTrigger[a].myVarSetInterval=e.data.myVarSetInterval,t.moveTrigger[a].currentFrame=e.data.pausedFrame;var n=e.data.currentFrameData,i=e.data.frameType;switch(t.solveAttachModel("",!0),i){case t.craftPlaySolveType.attach:if(t.FrameOperation.attach){var o=n["AttachToModelCode"],s=n["List_AttachModel"],c=n["IsTwoWay"],l=n["IsAttach"];if(l){var d,u=[],f=Object(m["a"])(s);try{for(f.s();!(d=f.n()).done;){var h=d.value;u.push({ModelId:h.ModelCode,ModelName:h.ModelName,RootId:o,IsTwoWay:c})}}catch(D){f.e(D)}finally{f.f()}t.attachList.set(o,u)}else{var v,p=Object(m["a"])(s);try{var g=function(){var e=v.value,a=e.ModelCode;t.scene.attach(t.getObjectById(a)),t.attachList.forEach((function(e,n){var r=e.filter((function(t){return t.ModelId!==a}));t.attachList.set(n,r)}))};for(p.s();!(v=p.n()).done;)g()}catch(D){p.e(D)}finally{p.f()}}}break;case t.craftPlaySolveType.visible:if(t.FrameOperation.visibleObject){var y=n["ModelCode"],b=parseInt(n["Visible"]);r.visibleObjectToBS(y,b)}break;case t.craftPlaySolveType.rotation:if(t.FrameOperation.rotationObject){var x=n["ModelCode"],w=n["Axis"],S=n["Rate"];r.modelRotation(x,w,S)}break;case t.craftPlaySolveType.craft:if(t.FrameOperation.playCraft){var _=n["CraftCode"],T=parseInt(n["CraftValue"]);r.playActData(_,T)}break;case t.craftPlaySolveType.FrameData:var C=n["i"],A=t.getObjectById(C);if(A)if("NaN"===n.tx||"NaN"===n.ty||"NaN"===n.tz||"NaN"===n.qx||"NaN"===n.qy||"NaN"===n.qz||"NaN"===n.qw)console.log("craftDataError");else{var O=new E["Zb"](parseFloat(n.tx),parseFloat(n.ty),parseFloat(n.tz)),B=new E["tb"](parseFloat(n.qx),parseFloat(n.qy),parseFloat(n.qz),parseFloat(n.qw));A.quaternion.copy(B),A.position.copy(O)}break;case t.craftPlaySolveType.warning:t.FrameOperation.warning&&new gt(r.editor,n["ModelCode"]).exec(!!parseInt(n["Visible"]));break;default:delete t.worker[e.data.ActID],t.moveTrigger[a].moveStatus=0,t.moveTrigger[a].myVarSetInterval=null,t.moveTrigger[a].currentFrame=0,t.moveTrigger[a].pausedFrame=0;break}t.solveAttachModel("",!1)})},this.modelRotation=function(a,n,r){var i=e,o=1e-6,s=0;if(t.getObjectById(a)){var c=t.getObjectById(a);parseFloat(r)>=-o&&parseFloat(r)<=o?t.RotationWorker[a]&&(t.RotationWorker[a].terminate(),delete t.RotationWorker[a],delete t.ModelRotateWorker[a]):(s=1,t.RotationWorker[a]&&(t.RotationWorker[a].terminate(),delete t.RotationWorker[a],delete t.ModelRotateWorker[a]),t.RotationWorker[a]=new Worker("webWorker/modelRotation.js"),t.ModelRotateWorker[a]||(t.ModelRotateWorker[a]={state:0,myVarSetInterval:null,doAnimation:!1,ModelCode:a}),t.RotationWorker[a].postMessage({ObjectNames:a,Values:r,Dir:s,ModelRotateWorker:t.ModelRotateWorker[a],RotateSpeed:t.rotateSpeed,RotationValue:c.rotation[n]}),t.RotationWorker[a].onmessage=function(t){i.modelSelfRotation(c,t.data.rotation,n)})}},this.modelSelfRotation=function(t,e,a){t.rotation[a]=e},this.ModelJointMoveTo=function(e){new Promise((function(a){var n,r=Object(m["a"])(e);try{var i=function(){var e=n.value,a=e.ModelCode,r=parseFloat(e.ValueFactor),i=e.JointType,o=parseFloat(e.Value),s=parseFloat(e.Flip),c=e.Axis,l=parseFloat(e.Delta),d=t.getObjectById(a),u=t.objectIdSet.get(a);if(!u)return{v:void 0};var f=u["matrix"],h="rotation"===i?u[i]["_"+c]:u[i][c],v=null===u["lastValue"]?h:u["lastValue"],p=s*(o-l)*r;if(d){t.solveAttachModel("",!0);var g=h+p;new st["b"]({moveValue:v}).to({moveValue:g},50).onStart((function(){u["lastValue"]=g})).onUpdate((function(){switch(i){case"position":d[i][c]=this._object.moveValue;break;case"rotation":var t={x:new E["Zb"](1,1,1),y:new E["Zb"](1,1,1),z:new E["Zb"](1,1,1)};f.extractBasis(t.x,t.y,t.z);var e=new E["Z"];e.makeRotationAxis(t[c],this._object.moveValue),e.multiply(f),d.rotation.setFromRotationMatrix(e),d.updateWorldMatrix();break}})).start(),t.solveAttachModel("",!1)}else console.log("模型不存在")};for(r.s();!(n=r.n()).done;){var o=i();if("object"===Object(L["a"])(o))return o.v}}catch(s){r.e(s)}finally{r.f()}}))},this.solveServoSignal=function(e,a){try{var n=e.JointType,r=e.Axis,i=e.Flip,o=e.Value,s=e.ValueFactor,c=e.HandlerCode,l=t.getObjectById(c),d=t.objectIdSet.get(c);if(!d)return;var u=d["matrix"],f="rotation"===n?d[n]["_"+r]:d[n][r],h=null===d["lastValue"]?f:d["lastValue"],v=i*(parseFloat(a)-o)*s;if(l){t.solveAttachModel("",!0);var p=f+v;new st["b"]({moveValue:h}).to({moveValue:p},100).onStart((function(){d["lastValue"]=p})).onUpdate((function(){switch(n){case"position":l[n][r]=this._object.moveValue;break;case"rotation":var t={x:new E["Zb"](1,1,1),y:new E["Zb"](1,1,1),z:new E["Zb"](1,1,1)};u.extractBasis(t.x,t.y,t.z);var e=new E["Z"];e.makeRotationAxis(t[r],this._object.moveValue),e.multiply(u),l.rotation.setFromRotationMatrix(e),l.updateWorldMatrix();break}})).start(),t.solveAttachModel("",!1)}}catch(g){console.log("solveServoSignal错误")}},this.JointMoveTo=function(a){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.robotList[a])for(var r=t.robotList[a],i=0;i<r.length;i++){if(""===r[i].ModelId)return;e.jointMoveToPromise(n,r[i],i,a)}},this.jointMoveToPromise=function(e,a,n,r){new Promise((function(i){var o=a.ModelId,s=a.object,c=a.type,l=a.axis,d=a.matrix,u=a.flip,f=parseFloat(a.delta),h=a.multiple,v=t.objectIdSet.get(o);if(v){var p="rotation"===c?v[c]["_"+l]:v[c][l],g=null===a.lastValue?p:a.lastValue,m=u*(parseFloat(e["J"+(n+1)])-f)*h;if(s){var y=p+m;new st["b"]({moveValue:g}).to({moveValue:y},200).onStart((function(){t.robotList[r][n]["lastValue"]=y})).onUpdate((function(){switch(c){case"position":s[c][l]=this._object.moveValue;break;case"rotation":var t={x:new E["Zb"](1,1,1),y:new E["Zb"](1,1,1),z:new E["Zb"](1,1,1)};d.extractBasis(t.x,t.y,t.z);var e=new E["Z"];e.makeRotationAxis(t[l],this._object.moveValue),e.multiply(d),s.rotation.setFromRotationMatrix(e),s.updateWorldMatrix();break}})).start()}}}))},this.getAxisValue=function(t,e){return JSON.parse('{"'+t+'":'+e+"}")},this.getAxisValue=function(t,e){return JSON.parse('{"'+t+'":'+e+"}")},this.showWeld=function(e,a){for(var n=0;n<t.WeldLightList.length;n++)t.WeldLightList[n].id===e&&(t.WeldLightList[n].TagValue=a)},this.showCheckOk=function(e){parseInt(e)?t.showTagList[3].title="工件QY16KC, 检测OK":t.showTagList[3].title="工件QY16KC"},this.visibleObjectToBS=function(e,a){var n=t.getObjectById(e);n&&(n.visible=!!parseInt(a),n.traverse((function(t){t.visible=!!parseInt(a)})),n.userData["visible"]=!!parseInt(a))},this.getOriginTagValue=function(){var e="",a="",n="B_C_DT_WebLoaded";e="DT|"+n,a=t.BSport+e;var r=t.BSport.split("?")[2];switch(t.connectType){case 1:t.socket.send(a);break;case 2:t.mqttClient.publish(r,e,0,(function(t){t&&console.log("Publish error",t)}));break;default:break}},this.drawWareHousePartOne=function(a){var n=e;try{var r,i=JSON.parse(a),o=Object(m["a"])(i);try{for(o.s();!(r=o.n()).done;){var s=r.value,c=s.Key,l=s.Value,d=c.toString().substring(0,4),u=t.WareHouse.get(c);u?0===parseInt(l)?(t.removeObject(u.object),t.WareHouse.delete(c)):u.whStoreState!==l&&(t.removeObject(u.object),n.updateStoreModel(d,c,l),u.whStoreState=l,u.object=null):(t.WareHouse.set(c,{whNum:d,whStoreNum:c,whStoreState:l,object:null}),n.updateStoreModel(d,c,l))}}catch(f){o.e(f)}finally{o.f()}}catch(h){console.log("库存解析错误")}},this.updateStoreModel=function(e,a,n){try{var r=t.WareHouseBasicModel.get("warehousepart"+n),i=t.WareHouseBasicModel.get("warehouse"+e);if(r&&i){var o=r.clone(),s=i[a];o.position.copy(s.getWorldPosition(new E["Zb"])),t.scene.add(o),t.WareHouse.get(a).object=o}}catch(c){console.log("库存模型解析错误")}}};function yt(t){var e="ws://"+t.ip+"//WebModule//websocket",a=null,n=new mt(t);try{"WebSocket"in window?t.socket=new WebSocket(e):t.showMessage("浏览器不支持WebSocket","error",2e3)}catch(r){return void t.showMessage("与服务器断开连接","error",2e3)}t.socket.onopen=function(){try{clearInterval(a)}catch(r){console.log(r)}var e=t.opname;t.socket.send("LIN,"+e),t.showMessage("加载完成,连接服务器成功!","success",2e3),t.isOk=!0,n.getOriginTagValue()},t.socket.onmessage=function(t){try{n.websocketMessage(t)}catch(r){var e=r.toString();console.log(e)}},t.socket.onclose=function(e){try{t.showMessage("onclose服务器连接失败","error",2e3),t.socket.close(),t.IsAllowConnect&&(t.showMessage("重新连接服务器","warning",2e3),console.log("onclose重新连接服务器"),a=setTimeout((function(){yt(t)}),5e3))}catch(r){var n=r.toString();t.showMessage.error("服务器出现错误,关闭连接"+n,"error",2e3)}},t.socket.onerror=function(e){console.log("onerror_服务器连接失败"),t.showMessage.error("服务器连接失败","error",2e3)}}var bt=a("15fd"),xt=a("e7fc"),wt=a.n(xt),St=["host","port","endpoint"];function _t(t){var e={host:t.mqttHost,port:t.mqttPort,endpoint:"/mqtt",clean:!0,connectTimeout:4e3,reconnectPeriod:4e3,clientId:"mqttjs_3be2c321"+(new Date).getTime(),username:"DT",password:""},a={topic:t.opname,qos:0},n=new mt(t),r=e.host,i=e.port,o=e.endpoint,s=Object(bt["a"])(e,St),c="https:"===location.protocol?"wss":"ws",l="".concat(c,"://").concat(r,":").concat(i).concat(o);console.log(l);try{t.mqttClient=wt.a.connect(l,s)}catch(d){console.log("MQTT connect error",d)}t.mqttClient.on("connect",(function(){t.showMessage("加载完成连接MQTT服务器成功","success",2e3),console.log("MQTT Connection succeeded!"),t.isOk=!0;var e=a.topic,r=a.qos;t.mqttClient.subscribe(e,{qos:r},(function(t,e){t?console.log("Subscribe to topics error",t):n.getOriginTagValue()}))})),t.mqttClient.on("error",(function(e){console.log("MQTT Connection failed",e);try{t.showMessage("MQTT服务器连接失败","error",2e3),t.socket.close(),t.IsAllowConnect&&(t.showMessage("重新连接MQTT服务器","warning",2e3),console.log("重新连接MQTT服务器"),setTimeout((function(){_t(t)}),5e3))}catch(n){var a=n.toString();t.showMessage.error("MQTT服务器出现错误,关闭连接"+a,"error",2e3)}})),t.mqttClient.on("message",(function(t,e){try{n.websocketMessage({data:e.toString()})}catch(a){console.log(a.toString())}})),t.mqttClient.on("close",(function(){t.mqttClient.end()}))}var Tt=function(){function t(){Object(lt["a"])(this,t),this.type="PlaySoundCommand",this.PlayType={Alarm:"Alarm",Clash:"Clash"},this.AlarmList=[],this.isAlarm=!1}return Object(ct["a"])(t,[{key:"exec",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2?arguments[2]:void 0;switch(t){case this.PlayType.Alarm:e?(this.isAlarm||this.playAlarmSound(!0),-1===this.AlarmList.indexOf(a)&&this.AlarmList.push(a),this.isAlarm=!0):(this.AlarmList=this.AlarmList.filter((function(t){return t!==a})),0===this.AlarmList.length&&(this.playAlarmSound(!1),this.isAlarm=!1));break;case this.PlayType.Clash:break;default:break}}},{key:"playAlarmSound",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]}},{key:"playClashSound",value:function(t){var e=document.getElementById("clash");t?e.play():e.pause()}}]),t}(),Ct=a("4a72"),At=a("ade3"),Ot=a("5530"),Bt=(a("fb2c"),a("84c3"),a("cfc3"),0),Dt=1,Mt=2,Pt=2,It=1.25,kt=1,jt=32,Lt=65535,Et=Math.pow(2,-24),Rt=Symbol("SKIP_GENERATION");a("c19f"),a("6062"),a("4e82");function Vt(t){return t.index?t.index.count:t.attributes.position.count}function Ft(t){return Vt(t)/3}function Nt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ArrayBuffer;return t>65535?new Uint32Array(new e(4*t)):new Uint16Array(new e(2*t))}function Ht(t,e){if(!t.index){var a=t.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,r=Nt(a,n);t.setIndex(new E["h"](r,1));for(var i=0;i<a;i++)r[i]=i}}function Wt(t){var e=Ft(t),a=t.drawRange,n=a.start/3,r=(a.start+a.count)/3,i=Math.max(0,n),o=Math.min(e,r)-i;return[{offset:Math.floor(i),count:Math.floor(o)}]}function zt(t){if(!t.groups||!t.groups.length)return Wt(t);var e,a=[],n=new Set,r=t.drawRange,i=r.start/3,o=(r.start+r.count)/3,s=Object(m["a"])(t.groups);try{for(s.s();!(e=s.n()).done;){var c=e.value,l=c.start/3,d=(c.start+c.count)/3;n.add(Math.max(i,l)),n.add(Math.min(o,d))}}catch(p){s.e(p)}finally{s.f()}for(var u=Array.from(n.values()).sort((function(t,e){return t-e})),f=0;f<u.length-1;f++){var h=u[f],v=u[f+1];a.push({offset:Math.floor(h),count:Math.floor(v-h)})}return a}function Ut(t){if(0===t.groups.length)return!1;var e=Ft(t),a=zt(t).sort((function(t,e){return t.offset-e.offset})),n=a[a.length-1];n.count=Math.min(e-n.offset,n.count);var r=0;return a.forEach((function(t){var e=t.count;return r+=e})),e!==r}function qt(t,e,a,n,r){for(var i=1/0,o=1/0,s=1/0,c=-1/0,l=-1/0,d=-1/0,u=1/0,f=1/0,h=1/0,v=-1/0,p=-1/0,g=-1/0,m=6*e,y=6*(e+a);m<y;m+=6){var b=t[m+0],x=t[m+1],w=b-x,S=b+x;w<i&&(i=w),S>c&&(c=S),b<u&&(u=b),b>v&&(v=b);var _=t[m+2],T=t[m+3],C=_-T,A=_+T;C<o&&(o=C),A>l&&(l=A),_<f&&(f=_),_>p&&(p=_);var O=t[m+4],B=t[m+5],D=O-B,M=O+B;D<s&&(s=D),M>d&&(d=M),O<h&&(h=O),O>g&&(g=O)}n[0]=i,n[1]=o,n[2]=s,n[3]=c,n[4]=l,n[5]=d,r[0]=u,r[1]=f,r[2]=h,r[3]=v,r[4]=p,r[5]=g}function Zt(t){var e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=t.attributes.position,o=t.index?t.index.array:null,s=Ft(t),c=i.normalized;null===a?(e=new Float32Array(6*s*4),n=0,r=s):(e=a,n=n||0,r=r||s);var l=i.array,d=i.offset||0,u=3;i.isInterleavedBufferAttribute&&(u=i.data.stride);for(var f=["getX","getY","getZ"],h=n;h<n+r;h++){var v=3*h,p=6*h,g=v+0,m=v+1,y=v+2;o&&(g=o[g],m=o[m],y=o[y]),c||(g=g*u+d,m=m*u+d,y=y*u+d);for(var b=0;b<3;b++){var x=void 0,w=void 0,S=void 0;c?(x=i[f[b]](g),w=i[f[b]](m),S=i[f[b]](y)):(x=l[g+b],w=l[m+b],S=l[y+b]);var _=x;w<_&&(_=w),S<_&&(_=S);var T=x;w>T&&(T=w),S>T&&(T=S);var C=(T-_)/2,A=2*b;e[p+A+0]=_+C,e[p+A+1]=C+(Math.abs(_)+C)*Et}}return e}function Yt(t,e,a){return a.min.x=e[t],a.min.y=e[t+1],a.min.z=e[t+2],a.max.x=e[t+3],a.max.y=e[t+4],a.max.z=e[t+5],a}function Jt(t){for(var e=-1,a=-1/0,n=0;n<3;n++){var r=t[n+3]-t[n];r>a&&(a=r,e=n)}return e}function Gt(t,e){e.set(t)}function Kt(t,e,a){for(var n,r,i=0;i<3;i++){var o=i+3;n=t[i],r=e[i],a[i]=n<r?n:r,n=t[o],r=e[o],a[o]=n>r?n:r}}function Xt(t,e,a){for(var n=0;n<3;n++){var r=e[t+2*n],i=e[t+2*n+1],o=r-i,s=r+i;o<a[n]&&(a[n]=o),s>a[n+3]&&(a[n+3]=s)}}function Qt(t){var e=t[3]-t[0],a=t[4]-t[1],n=t[5]-t[2];return 2*(e*a+a*n+n*e)}var $t=32,te=function(t,e){return t.candidate-e.candidate},ee=new Array($t).fill().map((function(){return{count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0}})),ae=new Float32Array(6);function ne(t,e,a,n,r,i){var o=-1,s=0;if(i===Bt)o=Jt(e),-1!==o&&(s=(e[o]+e[o+3])/2);else if(i===Dt)o=Jt(t),-1!==o&&(s=re(a,n,r,o));else if(i===Mt)for(var c=Qt(t),l=It*r,d=6*n,u=6*(n+r),f=0;f<3;f++){var h=e[f],v=e[f+3],g=v-h,m=g/$t;if(r<$t/4){var y=Object(p["a"])(ee);y.length=r;for(var b=0,x=d;x<u;x+=6,b++){var w=y[b];w.candidate=a[x+2*f],w.count=0;for(var S=w.bounds,_=w.leftCacheBounds,T=w.rightCacheBounds,C=0;C<3;C++)T[C]=1/0,T[C+3]=-1/0,_[C]=1/0,_[C+3]=-1/0,S[C]=1/0,S[C+3]=-1/0;Xt(x,a,S)}y.sort(te);for(var A=r,O=0;O<A;O++){var B=y[O];while(O+1<A&&y[O+1].candidate===B.candidate)y.splice(O+1,1),A--}for(var D=d;D<u;D+=6)for(var M=a[D+2*f],P=0;P<A;P++){var I=y[P];M>=I.candidate?Xt(D,a,I.rightCacheBounds):(Xt(D,a,I.leftCacheBounds),I.count++)}for(var k=0;k<A;k++){var j=y[k],L=j.count,E=r-j.count,R=j.leftCacheBounds,V=j.rightCacheBounds,F=0;0!==L&&(F=Qt(R)/c);var N=0;0!==E&&(N=Qt(V)/c);var H=kt+It*(F*L+N*E);H<l&&(o=f,l=H,s=j.candidate)}}else{for(var W=0;W<$t;W++){var z=ee[W];z.count=0,z.candidate=h+m+W*m;for(var U=z.bounds,q=0;q<3;q++)U[q]=1/0,U[q+3]=-1/0}for(var Z=d;Z<u;Z+=6){var Y=a[Z+2*f],J=Y-h,G=~~(J/m);G>=$t&&(G=$t-1);var K=ee[G];K.count++,Xt(Z,a,K.bounds)}var X=ee[$t-1];Gt(X.bounds,X.rightCacheBounds);for(var Q=$t-2;Q>=0;Q--){var $=ee[Q],tt=ee[Q+1];Kt($.bounds,tt.rightCacheBounds,$.rightCacheBounds)}for(var et=0,at=0;at<$t-1;at++){var nt=ee[at],rt=nt.count,it=nt.bounds,ot=ee[at+1],st=ot.rightCacheBounds;0!==rt&&(0===et?Gt(it,ae):Kt(it,ae,ae)),et+=rt;var ct=0,lt=0;0!==et&&(ct=Qt(ae)/c);var dt=r-et;0!==dt&&(lt=Qt(st)/c);var ut=kt+It*(ct*et+lt*dt);ut<l&&(o=f,l=ut,s=nt.candidate)}}}else console.warn("MeshBVH: Invalid build strategy value ".concat(i," used."));return{axis:o,pos:s}}function re(t,e,a,n){for(var r=0,i=e,o=e+a;i<o;i++)r+=t[6*i+2*n];return r/a}var ie,oe,se,ce,le=Object(ct["a"])((function t(){Object(lt["a"])(this,t),this.boundingData=new Float32Array(6)}));function de(t,e,a,n,r,i){var o=n,s=n+r-1,c=i.pos,l=2*i.axis;while(1){while(o<=s&&a[6*o+l]<c)o++;while(o<=s&&a[6*s+l]>=c)s--;if(!(o<s))return o;for(var d=0;d<3;d++){var u=e[3*o+d];e[3*o+d]=e[3*s+d],e[3*s+d]=u}for(var f=0;f<6;f++){var h=a[6*o+f];a[6*o+f]=a[6*s+f],a[6*s+f]=h}o++,s--}}function ue(t,e,a,n,r,i){var o=n,s=n+r-1,c=i.pos,l=2*i.axis;while(1){while(o<=s&&a[6*o+l]<c)o++;while(o<=s&&a[6*s+l]>=c)s--;if(!(o<s))return o;var d=t[o];t[o]=t[s],t[s]=d;for(var u=0;u<6;u++){var f=a[6*o+u];a[6*o+u]=a[6*s+u],a[6*s+u]=f}o++,s--}}function fe(t,e){return 65535===e[t+15]}function he(t,e){return e[t+6]}function ve(t,e){return e[t+14]}function pe(t){return t+8}function ge(t,e){return e[t+6]}function me(t,e){return e[t+7]}function ye(t){return t}var be=Math.pow(2,32);function xe(t){return"count"in t?1:1+xe(t.left)+xe(t.right)}function we(t,e,a){return ie=new Float32Array(a),oe=new Uint32Array(a),se=new Uint16Array(a),ce=new Uint8Array(a),Se(t,e)}function Se(t,e){for(var a=t/4,n=t/2,r=("count"in e),i=e.boundingData,o=0;o<6;o++)ie[a+o]=i[o];if(r){if(e.buffer){var s=e.buffer;ce.set(new Uint8Array(s),t);for(var c=t,l=t+s.byteLength;c<l;c+=jt){var d=c/2;fe(d,se)||(oe[c/4+6]+=a)}return t+s.byteLength}var u=e.offset,f=e.count;return oe[a+6]=u,se[n+14]=f,se[n+15]=Lt,t+jt}var h,v=e.left,p=e.right,g=e.splitAxis;if(h=Se(t+jt,v),h/4>be)throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return oe[a+6]=h/4,h=Se(h,p),oe[a+7]=g,h}function _e(t,e){for(var a=(t.index?t.index.count:t.attributes.position.count)/3,n=a>Math.pow(2,16),r=n?4:2,i=e?new SharedArrayBuffer(a*r):new ArrayBuffer(a*r),o=n?new Uint32Array(i):new Uint16Array(i),s=0,c=o.length;s<c;s++)o[s]=s;return o}function Te(t,e,a,n,r){var i=r.maxDepth,o=r.verbose,s=r.maxLeafTris,c=r.strategy,l=r.onProgress,d=r.indirect,u=t._indirectBuffer,f=t.geometry,h=f.index?f.index.array:null,v=d?ue:de,p=Ft(f),g=new Float32Array(6),m=!1,y=new le;return qt(e,a,n,y.boundingData,g),x(y,a,n,g),y;function b(t){l&&l(t/p)}function x(t,a,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!m&&l>=i&&(m=!0,o&&(console.warn("MeshBVH: Max depth of ".concat(i," reached when generating BVH. Consider increasing maxDepth.")),console.warn(f))),n<=s||l>=i)return b(a+n),t.offset=a,t.count=n,t;var d=ne(t.boundingData,r,e,a,n,c);if(-1===d.axis)return b(a+n),t.offset=a,t.count=n,t;var p=v(u,h,e,a,n,d);if(p===a||p===a+n)b(a+n),t.offset=a,t.count=n;else{t.splitAxis=d.axis;var y=new le,w=a,S=p-a;t.left=y,qt(e,w,S,y.boundingData,g),x(y,w,S,g,l+1);var _=new le,T=p,C=n-S;t.right=_,qt(e,T,C,_.boundingData,g),x(_,T,C,g,l+1)}return t}}function Ce(t,e){var a=t.geometry;e.indirect&&(t._indirectBuffer=_e(a,e.useSharedArrayBuffer),Ut(a)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),t._indirectBuffer||Ht(a,e);var n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,r=Zt(a),i=e.indirect?Wt(a):zt(a);t._roots=i.map((function(a){var i=Te(t,r,a.offset,a.count,e),o=xe(i),s=new n(jt*o);return we(0,i,s),s}))}var Ae=function(){function t(){Object(lt["a"])(this,t),this.min=1/0,this.max=-1/0}return Object(ct["a"])(t,[{key:"setFromPointsField",value:function(t,e){for(var a=1/0,n=-1/0,r=0,i=t.length;r<i;r++){var o=t[r],s=o[e];a=s<a?s:a,n=s>n?s:n}this.min=a,this.max=n}},{key:"setFromPoints",value:function(t,e){for(var a=1/0,n=-1/0,r=0,i=e.length;r<i;r++){var o=e[r],s=t.dot(o);a=s<a?s:a,n=s>n?s:n}this.min=a,this.max=n}},{key:"isSeparated",value:function(t){return this.min>t.max||t.min>this.max}}]),t}();Ae.prototype.setFromBox=function(){var t=new E["Zb"];return function(e,a){for(var n=a.min,r=a.max,i=1/0,o=-1/0,s=0;s<=1;s++)for(var c=0;c<=1;c++)for(var l=0;l<=1;l++){t.x=n.x*s+r.x*(1-s),t.y=n.y*c+r.y*(1-c),t.z=n.z*l+r.z*(1-l);var d=e.dot(t);i=Math.min(d,i),o=Math.max(d,o)}this.min=i,this.max=o}}();(function(){var t=new Ae})(),a("33d1"),a("ea98");var Oe=function(){var t=new E["Zb"],e=new E["Zb"],a=new E["Zb"];return function(n,r,i){var o=n.start,s=t,c=r.start,l=e;a.subVectors(o,c),t.subVectors(n.end,n.start),e.subVectors(r.end,r.start);var d,u,f=a.dot(l),h=l.dot(s),v=l.dot(l),p=a.dot(s),g=s.dot(s),m=g*v-h*h;d=0!==m?(f*h-p*v)/m:0,u=(f+d*h)/v,i.x=d,i.y=u}}(),Be=function(){var t=new E["Yb"],e=new E["Zb"],a=new E["Zb"];return function(n,r,i,o){Oe(n,r,t);var s,c,l=t.x,d=t.y;if(l>=0&&l<=1&&d>=0&&d<=1)return n.at(l,i),void r.at(d,o);if(l>=0&&l<=1)return d<0?r.at(0,o):r.at(1,o),void n.closestPointToPoint(o,!0,i);if(d>=0&&d<=1)return l<0?n.at(0,i):n.at(1,i),void r.closestPointToPoint(i,!0,o);s=l<0?n.start:n.end,c=d<0?r.start:r.end;var u=e,f=a;return n.closestPointToPoint(c,!0,e),r.closestPointToPoint(s,!0,a),u.distanceToSquared(c)<=f.distanceToSquared(s)?(i.copy(u),void o.copy(c)):(i.copy(s),void o.copy(f))}}(),De=function(){var t=new E["Zb"],e=new E["Zb"],a=new E["ob"],n=new E["K"];return function(r,i){var o=r.radius,s=r.center,c=i.a,l=i.b,d=i.c;n.start=c,n.end=l;var u=n.closestPointToPoint(s,!0,t);if(u.distanceTo(s)<=o)return!0;n.start=c,n.end=d;var f=n.closestPointToPoint(s,!0,t);if(f.distanceTo(s)<=o)return!0;n.start=l,n.end=d;var h=n.closestPointToPoint(s,!0,t);if(h.distanceTo(s)<=o)return!0;var v=i.getPlane(a),p=Math.abs(v.distanceToPoint(s));if(p<=o){var g=v.projectPoint(s,e),m=i.containsPoint(g);if(m)return!0}return!1}}(),Me=1e-15;function Pe(t){return Math.abs(t)<Me}var Ie=function(t){Object(ut["a"])(a,t);var e=Object(ft["a"])(a);function a(){var t;Object(lt["a"])(this,a);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t=e.call.apply(e,[this].concat(r)),t.isExtendedTriangle=!0,t.satAxes=new Array(4).fill().map((function(){return new E["Zb"]})),t.satBounds=new Array(4).fill().map((function(){return new Ae})),t.points=[t.a,t.b,t.c],t.sphere=new E["Jb"],t.plane=new E["ob"],t.needsUpdate=!0,t}return Object(ct["a"])(a,[{key:"intersectsSphere",value:function(t){return De(t,this)}},{key:"update",value:function(){var t=this.a,e=this.b,a=this.c,n=this.points,r=this.satAxes,i=this.satBounds,o=r[0],s=i[0];this.getNormal(o),s.setFromPoints(o,n);var c=r[1],l=i[1];c.subVectors(t,e),l.setFromPoints(c,n);var d=r[2],u=i[2];d.subVectors(e,a),u.setFromPoints(d,n);var f=r[3],h=i[3];f.subVectors(a,t),h.setFromPoints(f,n),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,t),this.needsUpdate=!1}}]),a}(E["Rb"]);Ie.prototype.closestPointToSegment=function(){var t=new E["Zb"],e=new E["Zb"],a=new E["K"];return function(n){for(var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=n.start,c=n.end,l=this.points,d=1/0,u=0;u<3;u++){var f=(u+1)%3;a.start.copy(l[u]),a.end.copy(l[f]),Be(a,n,t,e),r=t.distanceToSquared(e),r<d&&(d=r,i&&i.copy(t),o&&o.copy(e))}return this.closestPointToPoint(s,t),r=s.distanceToSquared(t),r<d&&(d=r,i&&i.copy(t),o&&o.copy(s)),this.closestPointToPoint(c,t),r=c.distanceToSquared(t),r<d&&(d=r,i&&i.copy(t),o&&o.copy(c)),Math.sqrt(d)}}(),Ie.prototype.intersectsTriangle=function(){var t=new Ie,e=new Array(3),a=new Array(3),n=new Ae,r=new Ae,i=new E["Zb"],o=new E["Zb"],s=new E["Zb"],c=new E["Zb"],l=new E["Zb"],d=new E["K"],u=new E["K"],f=new E["K"],h=new E["Zb"];function v(t,e,a){for(var n=t.points,r=0,i=-1,s=0;s<3;s++){var c=d.start,l=d.end;c.copy(n[s]),l.copy(n[(s+1)%3]),d.delta(o);var u=Pe(e.distanceToPoint(c));if(Pe(e.normal.dot(o))&&u){a.copy(d),r=2;break}var f=e.intersectLine(d,h);if(!f&&u&&h.copy(c),(f||u)&&!Pe(h.distanceTo(l))){if(r<=1){var v=1===r?a.start:a.end;v.copy(h),u&&(i=r)}else if(r>=2){var p=1===i?a.start:a.end;p.copy(h),r=2;break}if(r++,2===r&&-1===i)break}}return r}return function(o){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,h=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.needsUpdate&&this.update(),o.isExtendedTriangle?o.needsUpdate&&o.update():(t.copy(o),t.update(),o=t);var p=this.plane,g=o.plane;if(Math.abs(p.normal.dot(g.normal))>1-1e-10){var m=this.satBounds,y=this.satAxes;a[0]=o.a,a[1]=o.b,a[2]=o.c;for(var b=0;b<4;b++){var x=m[b],w=y[b];if(n.setFromPoints(w,a),x.isSeparated(n))return!1}var S=o.satBounds,_=o.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(var T=0;T<4;T++){var C=S[T],A=_[T];if(n.setFromPoints(A,e),C.isSeparated(n))return!1}for(var O=0;O<4;O++)for(var B=y[O],D=0;D<4;D++){var M=_[D];if(i.crossVectors(B,M),n.setFromPoints(i,e),r.setFromPoints(i,a),n.isSeparated(r))return!1}return d&&(h||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),d.start.set(0,0,0),d.end.set(0,0,0)),!0}var P=v(this,g,u);if(1===P&&o.containsPoint(u.end))return d&&(d.start.copy(u.end),d.end.copy(u.end)),!0;if(2!==P)return!1;var I=v(o,p,f);if(1===I&&this.containsPoint(f.end))return d&&(d.start.copy(f.end),d.end.copy(f.end)),!0;if(2!==I)return!1;if(u.delta(s),f.delta(c),s.dot(c)<0){var k=f.start;f.start=f.end,f.end=k}var j=u.start.dot(s),L=u.end.dot(s),E=f.start.dot(s),R=f.end.dot(s),V=L<E,F=j<R;return(j===R||E===L||V!==F)&&(d&&(l.subVectors(u.start,f.start),l.dot(s)>0?d.start.copy(u.start):d.start.copy(f.start),l.subVectors(u.end,f.end),l.dot(s)<0?d.end.copy(u.end):d.end.copy(f.end)),!0)}}(),Ie.prototype.distanceToPoint=function(){var t=new E["Zb"];return function(e){return this.closestPointToPoint(e,t),e.distanceTo(t)}}(),Ie.prototype.distanceToTriangle=function(){var t=new E["Zb"],e=new E["Zb"],a=["a","b","c"],n=new E["K"],r=new E["K"];return function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,c=o||s?n:null;if(this.intersectsTriangle(i,c))return(o||s)&&(o&&c.getCenter(o),s&&c.getCenter(s)),0;for(var l=1/0,d=0;d<3;d++){var u=void 0,f=a[d],h=i[f];this.closestPointToPoint(h,t),u=h.distanceToSquared(t),u<l&&(l=u,o&&o.copy(t),s&&s.copy(h));var v=this[f];i.closestPointToPoint(v,t),u=v.distanceToSquared(t),u<l&&(l=u,o&&o.copy(v),s&&s.copy(t))}for(var p=0;p<3;p++){var g=a[p],m=a[(p+1)%3];n.set(this[g],this[m]);for(var y=0;y<3;y++){var b=a[y],x=a[(y+1)%3];r.set(i[b],i[x]),Be(n,r,t,e);var w=t.distanceToSquared(e);w<l&&(l=w,o&&o.copy(t),s&&s.copy(e))}}return Math.sqrt(l)}}();var ke=function(){function t(e,a,n){Object(lt["a"])(this,t),this.isOrientedBox=!0,this.min=new E["Zb"],this.max=new E["Zb"],this.matrix=new E["Z"],this.invMatrix=new E["Z"],this.points=new Array(8).fill().map((function(){return new E["Zb"]})),this.satAxes=new Array(3).fill().map((function(){return new E["Zb"]})),this.satBounds=new Array(3).fill().map((function(){return new Ae})),this.alignedSatBounds=new Array(3).fill().map((function(){return new Ae})),this.needsUpdate=!1,e&&this.min.copy(e),a&&this.max.copy(a),n&&this.matrix.copy(n)}return Object(ct["a"])(t,[{key:"set",value:function(t,e,a){this.min.copy(t),this.max.copy(e),this.matrix.copy(a),this.needsUpdate=!0}},{key:"copy",value:function(t){this.min.copy(t.min),this.max.copy(t.max),this.matrix.copy(t.matrix),this.needsUpdate=!0}}]),t}();ke.prototype.update=function(){return function(){for(var t=this.matrix,e=this.min,a=this.max,n=this.points,r=0;r<=1;r++)for(var i=0;i<=1;i++)for(var o=0;o<=1;o++){var s=1*r|2*i|4*o,c=n[s];c.x=r?a.x:e.x,c.y=i?a.y:e.y,c.z=o?a.z:e.z,c.applyMatrix4(t)}for(var l=this.satBounds,d=this.satAxes,u=n[0],f=0;f<3;f++){var h=d[f],v=l[f],p=1<<f,g=n[p];h.subVectors(u,g),v.setFromPoints(h,n)}var m=this.alignedSatBounds;m[0].setFromPointsField(n,"x"),m[1].setFromPointsField(n,"y"),m[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),ke.prototype.intersectsBox=function(){var t=new Ae;return function(e){this.needsUpdate&&this.update();var a=e.min,n=e.max,r=this.satBounds,i=this.satAxes,o=this.alignedSatBounds;if(t.min=a.x,t.max=n.x,o[0].isSeparated(t))return!1;if(t.min=a.y,t.max=n.y,o[1].isSeparated(t))return!1;if(t.min=a.z,t.max=n.z,o[2].isSeparated(t))return!1;for(var s=0;s<3;s++){var c=i[s],l=r[s];if(t.setFromBox(c,e),l.isSeparated(t))return!1}return!0}}(),ke.prototype.intersectsTriangle=function(){var t=new Ie,e=new Array(3),a=new Ae,n=new Ae,r=new E["Zb"];return function(i){this.needsUpdate&&this.update(),i.isExtendedTriangle?i.needsUpdate&&i.update():(t.copy(i),t.update(),i=t);var o=this.satBounds,s=this.satAxes;e[0]=i.a,e[1]=i.b,e[2]=i.c;for(var c=0;c<3;c++){var l=o[c],d=s[c];if(a.setFromPoints(d,e),l.isSeparated(a))return!1}for(var u=i.satBounds,f=i.satAxes,h=this.points,v=0;v<3;v++){var p=u[v],g=f[v];if(a.setFromPoints(g,h),p.isSeparated(a))return!1}for(var m=0;m<3;m++)for(var y=s[m],b=0;b<4;b++){var x=f[b];if(r.crossVectors(y,x),a.setFromPoints(r,e),n.setFromPoints(r,h),a.isSeparated(n))return!1}return!0}}(),ke.prototype.closestPointToPoint=function(){return function(t,e){return this.needsUpdate&&this.update(),e.copy(t).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),e}}(),ke.prototype.distanceToPoint=function(){var t=new E["Zb"];return function(e){return this.closestPointToPoint(e,t),e.distanceTo(t)}}(),ke.prototype.distanceToBox=function(){var t=["x","y","z"],e=new Array(12).fill().map((function(){return new E["K"]})),a=new Array(12).fill().map((function(){return new E["K"]})),n=new E["Zb"],r=new E["Zb"];return function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(this.needsUpdate&&this.update(),this.intersectsBox(i))return(s||c)&&(i.getCenter(r),this.closestPointToPoint(r,n),i.closestPointToPoint(n,r),s&&s.copy(n),c&&c.copy(r)),0;for(var l=o*o,d=i.min,u=i.max,f=this.points,h=1/0,v=0;v<8;v++){var p=f[v];r.copy(p).clamp(d,u);var g=p.distanceToSquared(r);if(g<h&&(h=g,s&&s.copy(p),c&&c.copy(r),g<l))return Math.sqrt(g)}for(var m=0,y=0;y<3;y++)for(var b=0;b<=1;b++)for(var x=0;x<=1;x++){var w=(y+1)%3,S=(y+2)%3,_=b<<w|x<<S,T=1<<y|b<<w|x<<S,C=f[_],A=f[T],O=e[m];O.set(C,A);var B=t[y],D=t[w],M=t[S],P=a[m],I=P.start,k=P.end;I[B]=d[B],I[D]=b?d[D]:u[D],I[M]=x?d[M]:u[D],k[B]=u[B],k[D]=b?d[D]:u[D],k[M]=x?d[M]:u[D],m++}for(var j=0;j<=1;j++)for(var L=0;L<=1;L++)for(var E=0;E<=1;E++){r.x=j?u.x:d.x,r.y=L?u.y:d.y,r.z=E?u.z:d.z,this.closestPointToPoint(r,n);var R=r.distanceToSquared(n);if(R<h&&(h=R,s&&s.copy(n),c&&c.copy(r),R<l))return Math.sqrt(R)}for(var V=0;V<12;V++)for(var F=e[V],N=0;N<12;N++){var H=a[N];Be(F,H,n,r);var W=n.distanceToSquared(r);if(W<h&&(h=W,s&&s.copy(n),c&&c.copy(r),W<l))return Math.sqrt(W)}return Math.sqrt(h)}}();var je,Le,Ee=function(){function t(e){Object(lt["a"])(this,t),this._getNewPrimitive=e,this._primitives=[]}return Object(ct["a"])(t,[{key:"getPrimitive",value:function(){var t=this._primitives;return 0===t.length?this._getNewPrimitive():t.pop()}},{key:"releasePrimitive",value:function(t){this._primitives.push(t)}}]),t}(),Re=function(t){Object(ut["a"])(a,t);var e=Object(ft["a"])(a);function a(){return Object(lt["a"])(this,a),e.call(this,(function(){return new Ie}))}return Object(ct["a"])(a)}(Ee),Ve=new Re,Fe=Object(ct["a"])((function t(){var e=this;Object(lt["a"])(this,t),this.float32Array=null,this.uint16Array=null,this.uint32Array=null;var a=[],n=null;this.setBuffer=function(t){n&&a.push(n),n=t,e.float32Array=new Float32Array(t),e.uint16Array=new Uint16Array(t),e.uint32Array=new Uint32Array(t)},this.clearBuffer=function(){n=null,e.float32Array=null,e.uint16Array=null,e.uint32Array=null,0!==a.length&&e.setBuffer(a.pop())}})),Ne=new Fe,He=[],We=new Ee((function(){return new E["g"]}));function ze(t,e,a,n,r,i){je=We.getPrimitive(),Le=We.getPrimitive(),He.push(je,Le),Ne.setBuffer(t._roots[e]);var o=Ue(0,t.geometry,a,n,r,i);Ne.clearBuffer(),We.releasePrimitive(je),We.releasePrimitive(Le),He.pop(),He.pop();var s=He.length;return s>0&&(Le=He[s-1],je=He[s-2]),o}function Ue(t,e,a,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=Ne.float32Array,c=Ne.uint16Array,l=Ne.uint32Array,d=2*t,u=fe(d,c);if(u){var f=he(t,l),h=ve(d,c);return Yt(ye(t),s,je),n(f,h,!1,o,i+t,je)}var v,p,g,m,y=function(t){var e=Ne.uint16Array,a=Ne.uint32Array,n=2*t;while(!fe(n,e))t=pe(t),n=2*t;return he(t,a)},b=function(t){var e=Ne.uint16Array,a=Ne.uint32Array,n=2*t;while(!fe(n,e))t=ge(t,a),n=2*t;return he(t,a)+ve(n,e)},x=pe(t),w=ge(t,l),S=x,_=w;if(r&&(g=je,m=Le,Yt(ye(S),s,g),Yt(ye(_),s,m),v=r(g),p=r(m),p<v)){S=w,_=x;var T=v;v=p,p=T,g=m}g||(g=je,Yt(ye(S),s,g));var C,A=fe(2*S,c),O=a(g,A,v,o+1,i+S);if(O===Pt){var B=y(S),D=b(S),M=D-B;C=n(B,M,!0,o+1,i+S,g)}else C=O&&Ue(S,e,a,n,r,i,o+1);if(C)return!0;m=Le,Yt(ye(_),s,m);var P,I=fe(2*_,c),k=a(m,I,p,o+1,i+_);if(k===Pt){var j=y(_),L=b(_),E=L-j;P=n(j,E,!0,o+1,i+_,m)}else P=k&&Ue(_,e,a,n,r,i,o+1);return!!P}var qe=new E["Zb"],Ze=new E["Zb"];function Ye(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,i=n*n,o=r*r,s=1/0,c=null;if(t.shapecast({boundsTraverseOrder:function(t){return qe.copy(e).clamp(t.min,t.max),qe.distanceToSquared(e)},intersectsBounds:function(t,e,a){return a<s&&a<o},intersectsTriangle:function(t,a){t.closestPointToPoint(e,qe);var n=e.distanceToSquared(qe);return n<s&&(Ze.copy(qe),s=n,c=a),n<i}}),s===1/0)return null;var l=Math.sqrt(s);return a.point?a.point.copy(Ze):a.point=Ze.clone(),a.distance=l,a.faceIndex=c,a}var Je=new E["Zb"],Ge=new E["Zb"],Ke=new E["Zb"],Xe=new E["Yb"],Qe=new E["Yb"],$e=new E["Yb"],ta=new E["Zb"],ea=new E["Zb"],aa=new E["Zb"],na=new E["Zb"];function ra(t,e,a,n,r,i){var o;if(o=i===E["e"]?t.intersectTriangle(n,a,e,!0,r):t.intersectTriangle(e,a,n,i!==E["r"],r),null===o)return null;var s=t.origin.distanceTo(r);return{distance:s,point:r.clone()}}function ia(t,e,a,n,r,i,o,s,c){Je.fromBufferAttribute(e,i),Ge.fromBufferAttribute(e,o),Ke.fromBufferAttribute(e,s);var l=ra(t,Je,Ge,Ke,na,c);if(l){n&&(Xe.fromBufferAttribute(n,i),Qe.fromBufferAttribute(n,o),$e.fromBufferAttribute(n,s),l.uv=E["Rb"].getInterpolation(na,Je,Ge,Ke,Xe,Qe,$e,new E["Yb"])),r&&(Xe.fromBufferAttribute(r,i),Qe.fromBufferAttribute(r,o),$e.fromBufferAttribute(r,s),l.uv1=E["Rb"].getInterpolation(na,Je,Ge,Ke,Xe,Qe,$e,new E["Yb"])),a&&(ta.fromBufferAttribute(a,i),ea.fromBufferAttribute(a,o),aa.fromBufferAttribute(a,s),l.normal=E["Rb"].getInterpolation(na,Je,Ge,Ke,ta,ea,aa,new E["Zb"]),l.normal.dot(t.direction)>0&&l.normal.multiplyScalar(-1));var d={a:i,b:o,c:s,normal:new E["Zb"],materialIndex:0};E["Rb"].getNormal(Je,Ge,Ke,d.normal),l.face=d,l.faceIndex=i}return l}function oa(t,e,a,n,r){var i=3*n,o=i+0,s=i+1,c=i+2,l=t.index;t.index&&(o=l.getX(o),s=l.getX(s),c=l.getX(c));var d=t.attributes,u=d.position,f=d.normal,h=d.uv,v=d.uv1,p=ia(a,u,f,h,v,o,s,c,e);return p?(p.faceIndex=n,r&&r.push(p),p):null}function sa(t,e,a,n){var r=t.a,i=t.b,o=t.c,s=e,c=e+1,l=e+2;a&&(s=a.getX(s),c=a.getX(c),l=a.getX(l)),r.x=n.getX(s),r.y=n.getY(s),r.z=n.getZ(s),i.x=n.getX(c),i.y=n.getY(c),i.z=n.getZ(c),o.x=n.getX(l),o.y=n.getY(l),o.z=n.getZ(l)}function ca(t,e,a,n,r,i){for(var o=t.geometry,s=(t._indirectBuffer,n),c=n+r;s<c;s++)oa(o,e,a,s,i)}function la(t,e,a,n,r){for(var i=t.geometry,o=(t._indirectBuffer,1/0),s=null,c=n,l=n+r;c<l;c++){var d=void 0;d=oa(i,e,a,c),d&&d.distance<o&&(s=d,o=d.distance)}return s}function da(t,e,a,n,r,i,o){for(var s=a.geometry,c=s.index,l=s.attributes.position,d=t,u=e+t;d<u;d++){var f=void 0;if(f=d,sa(o,3*f,c,l),o.needsUpdate=!0,n(o,f,r,i))return!0}return!1}function ua(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e&&Array.isArray(e)&&(e=new Set(e));for(var a,n,r,i,o=t.geometry,s=o.index?o.index.array:null,c=o.attributes.position,l=0,d=t._roots,u=0,f=d.length;u<f;u++)a=d[u],n=new Uint32Array(a),r=new Uint16Array(a),i=new Float32Array(a),h(0,l),l+=a.byteLength;function h(t,a){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=2*t,d=r[l+15]===Lt;if(d){for(var u=n[t+6],f=r[l+14],v=1/0,p=1/0,g=1/0,m=-1/0,y=-1/0,b=-1/0,x=3*u,w=3*(u+f);x<w;x++){var S=s[x],_=c.getX(S),T=c.getY(S),C=c.getZ(S);_<v&&(v=_),_>m&&(m=_),T<p&&(p=T),T>y&&(y=T),C<g&&(g=C),C>b&&(b=C)}return(i[t+0]!==v||i[t+1]!==p||i[t+2]!==g||i[t+3]!==m||i[t+4]!==y||i[t+5]!==b)&&(i[t+0]=v,i[t+1]=p,i[t+2]=g,i[t+3]=m,i[t+4]=y,i[t+5]=b,!0)}var A=t+8,O=n[t+6],B=A+a,D=O+a,M=o,P=!1,I=!1;e?M||(P=e.has(B),I=e.has(D),M=!P&&!I):(P=!0,I=!0);var k=M||P,j=M||I,L=!1;k&&(L=h(A,a,M));var E=!1;j&&(E=h(O,a,M));var R=L||E;if(R)for(var V=0;V<3;V++){var F=A+V,N=O+V,H=i[F],W=i[F+3],z=i[N],U=i[N+3];i[t+V]=H<z?H:z,i[t+V+3]=W>U?W:U}return R}}function fa(t,e,a){var n,r,i,o,s,c,l=1/a.direction.x,d=1/a.direction.y,u=1/a.direction.z,f=a.origin.x,h=a.origin.y,v=a.origin.z,p=e[t],g=e[t+3],m=e[t+1],y=e[t+3+1],b=e[t+2],x=e[t+3+2];return l>=0?(n=(p-f)*l,r=(g-f)*l):(n=(g-f)*l,r=(p-f)*l),d>=0?(i=(m-h)*d,o=(y-h)*d):(i=(y-h)*d,o=(m-h)*d),!(n>o||i>r)&&((i>n||isNaN(n))&&(n=i),(o<r||isNaN(r))&&(r=o),u>=0?(s=(b-v)*u,c=(x-v)*u):(s=(x-v)*u,c=(b-v)*u),!(n>c||s>r)&&((c<r||r!==r)&&(r=c),!(r<0)))}function ha(t,e,a,n,r,i){for(var o=t.geometry,s=t._indirectBuffer,c=n,l=n+r;c<l;c++){var d=s?s[c]:c;oa(o,e,a,d,i)}}function va(t,e,a,n,r){for(var i=t.geometry,o=t._indirectBuffer,s=1/0,c=null,l=n,d=n+r;l<d;l++){var u=void 0;u=oa(i,e,a,o?o[l]:l),u&&u.distance<s&&(c=u,s=u.distance)}return c}function pa(t,e,a,n,r,i,o){for(var s=a.geometry,c=s.index,l=s.attributes.position,d=t,u=e+t;d<u;d++){var f=void 0;if(f=a.resolveTriangleIndex(d),sa(o,3*f,c,l),o.needsUpdate=!0,n(o,f,r,i))return!0}return!1}function ga(t,e,a,n,r){Ne.setBuffer(t._roots[e]),ma(0,t,a,n,r),Ne.clearBuffer()}function ma(t,e,a,n,r){var i=Ne.float32Array,o=Ne.uint16Array,s=Ne.uint32Array,c=2*t,l=fe(c,o);if(l){var d=he(t,s),u=ve(c,o);ca(e,a,n,d,u,r)}else{var f=pe(t);fa(f,i,n)&&ma(f,e,a,n,r);var h=ge(t,s);fa(h,i,n)&&ma(h,e,a,n,r)}}var ya=["x","y","z"];function ba(t,e,a,n){Ne.setBuffer(t._roots[e]);var r=xa(0,t,a,n);return Ne.clearBuffer(),r}function xa(t,e,a,n){var r=Ne.float32Array,i=Ne.uint16Array,o=Ne.uint32Array,s=2*t,c=fe(s,i);if(c){var l=he(t,o),d=ve(s,i);return la(e,a,n,l,d)}var u,f,h=me(t,o),v=ya[h],p=n.direction[v],g=p>=0;g?(u=pe(t),f=ge(t,o)):(u=ge(t,o),f=pe(t));var m=fa(u,r,n),y=m?xa(u,e,a,n):null;if(y){var b=y.point[v],x=g?b<=r[f+h]:b>=r[f+h+3];if(x)return y}var w=fa(f,r,n),S=w?xa(f,e,a,n):null;return y&&S?y.distance<=S.distance?y:S:y||S||null}var wa=new E["g"],Sa=new Ie,_a=new Ie,Ta=new E["Z"],Ca=new ke,Aa=new ke;function Oa(t,e,a,n){Ne.setBuffer(t._roots[e]);var r=Ba(0,t,a,n);return Ne.clearBuffer(),r}function Ba(t,e,a,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=Ne.float32Array,o=Ne.uint16Array,s=Ne.uint32Array,c=2*t;null===r&&(a.boundingBox||a.computeBoundingBox(),Ca.set(a.boundingBox.min,a.boundingBox.max,n),r=Ca);var l=fe(c,o);if(!l){var d=t+8,u=s[t+6];Yt(ye(d),i,wa);var f=r.intersectsBox(wa)&&Ba(d,e,a,n,r);if(f)return!0;Yt(ye(u),i,wa);var h=r.intersectsBox(wa)&&Ba(u,e,a,n,r);return!!h}var v=e.geometry,p=v.index,g=v.attributes.position,m=a.index,y=a.attributes.position,b=he(t,s),x=ve(c,o);if(Ta.copy(n).invert(),a.boundsTree){Yt(ye(t),i,Aa),Aa.matrix.copy(Ta),Aa.needsUpdate=!0;var w=a.boundsTree.shapecast({intersectsBounds:function(t){return Aa.intersectsBox(t)},intersectsTriangle:function(t){t.a.applyMatrix4(n),t.b.applyMatrix4(n),t.c.applyMatrix4(n),t.needsUpdate=!0;for(var e=3*b,a=3*(x+b);e<a;e+=3)if(sa(_a,e,p,g),_a.needsUpdate=!0,t.intersectsTriangle(_a))return!0;return!1}});return w}for(var S=3*b,_=3*(x+b);S<_;S+=3){sa(Sa,S,p,g),Sa.a.applyMatrix4(Ta),Sa.b.applyMatrix4(Ta),Sa.c.applyMatrix4(Ta),Sa.needsUpdate=!0;for(var T=0,C=m.count;T<C;T+=3)if(sa(_a,T,m,y),_a.needsUpdate=!0,Sa.intersectsTriangle(_a))return!0}}a("4c53");var Da=new E["Z"],Ma=new ke,Pa=new ke,Ia=new E["Zb"],ka=new E["Zb"],ja=new E["Zb"],La=new E["Zb"];function Ea(t,e,a){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1/0;e.boundingBox||e.computeBoundingBox(),Ma.set(e.boundingBox.min,e.boundingBox.max,a),Ma.needsUpdate=!0;var s=t.geometry,c=s.attributes.position,l=s.index,d=e.attributes.position,u=e.index,f=Ve.getPrimitive(),h=Ve.getPrimitive(),v=Ia,p=ka,g=null,m=null;r&&(g=ja,m=La);var y=1/0,b=null,x=null;return Da.copy(a).invert(),Pa.matrix.copy(Da),t.shapecast({boundsTraverseOrder:function(t){return Ma.distanceToBox(t)},intersectsBounds:function(t,e,a){return a<y&&a<o&&(e&&(Pa.min.copy(t.min),Pa.max.copy(t.max),Pa.needsUpdate=!0),!0)},intersectsRange:function(t,n){if(e.boundsTree){var r=e.boundsTree;return r.shapecast({boundsTraverseOrder:function(t){return Pa.distanceToBox(t)},intersectsBounds:function(t,e,a){return a<y&&a<o},intersectsRange:function(e,r){for(var o=e,s=e+r;o<s;o++){sa(h,3*o,u,d),h.a.applyMatrix4(a),h.b.applyMatrix4(a),h.c.applyMatrix4(a),h.needsUpdate=!0;for(var w=t,S=t+n;w<S;w++){sa(f,3*w,l,c),f.needsUpdate=!0;var _=f.distanceToTriangle(h,v,g);if(_<y&&(p.copy(v),m&&m.copy(g),y=_,b=w,x=o),_<i)return!0}}}})}for(var s=Ft(e),w=0,S=s;w<S;w++){sa(h,3*w,u,d),h.a.applyMatrix4(a),h.b.applyMatrix4(a),h.c.applyMatrix4(a),h.needsUpdate=!0;for(var _=t,T=t+n;_<T;_++){sa(f,3*_,l,c),f.needsUpdate=!0;var C=f.distanceToTriangle(h,v,g);if(C<y&&(p.copy(v),m&&m.copy(g),y=C,b=_,x=w),C<i)return!0}}}}),Ve.releasePrimitive(f),Ve.releasePrimitive(h),y===1/0?null:(n.point?n.point.copy(p):n.point=p.clone(),n.distance=y,n.faceIndex=b,r&&(r.point?r.point.copy(m):r.point=m.clone(),r.point.applyMatrix4(Da),p.applyMatrix4(Da),r.distance=p.sub(r.point).length(),r.faceIndex=x),n)}function Ra(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e&&Array.isArray(e)&&(e=new Set(e));for(var a,n,r,i,o=t.geometry,s=o.index?o.index.array:null,c=o.attributes.position,l=0,d=t._roots,u=0,f=d.length;u<f;u++)a=d[u],n=new Uint32Array(a),r=new Uint16Array(a),i=new Float32Array(a),h(0,l),l+=a.byteLength;function h(a,o){var l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=2*a,u=r[d+15]===Lt;if(u){for(var f=n[a+6],v=r[d+14],p=1/0,g=1/0,m=1/0,y=-1/0,b=-1/0,x=-1/0,w=f,S=f+v;w<S;w++)for(var _=3*t.resolveTriangleIndex(w),T=0;T<3;T++){var C=_+T;C=s?s[C]:C;var A=c.getX(C),O=c.getY(C),B=c.getZ(C);A<p&&(p=A),A>y&&(y=A),O<g&&(g=O),O>b&&(b=O),B<m&&(m=B),B>x&&(x=B)}return(i[a+0]!==p||i[a+1]!==g||i[a+2]!==m||i[a+3]!==y||i[a+4]!==b||i[a+5]!==x)&&(i[a+0]=p,i[a+1]=g,i[a+2]=m,i[a+3]=y,i[a+4]=b,i[a+5]=x,!0)}var D=a+8,M=n[a+6],P=D+o,I=M+o,k=l,j=!1,L=!1;e?k||(j=e.has(P),L=e.has(I),k=!j&&!L):(j=!0,L=!0);var E=k||j,R=k||L,V=!1;E&&(V=h(D,o,k));var F=!1;R&&(F=h(M,o,k));var N=V||F;if(N)for(var H=0;H<3;H++){var W=D+H,z=M+H,U=i[W],q=i[W+3],Z=i[z],Y=i[z+3];i[a+H]=U<Z?U:Z,i[a+H+3]=q>Y?q:Y}return N}}function Va(t,e,a,n,r){Ne.setBuffer(t._roots[e]),Fa(0,t,a,n,r),Ne.clearBuffer()}function Fa(t,e,a,n,r){var i=Ne.float32Array,o=Ne.uint16Array,s=Ne.uint32Array,c=2*t,l=fe(c,o);if(l){var d=he(t,s),u=ve(c,o);ha(e,a,n,d,u,r)}else{var f=pe(t);fa(f,i,n)&&Fa(f,e,a,n,r);var h=ge(t,s);fa(h,i,n)&&Fa(h,e,a,n,r)}}var Na=["x","y","z"];function Ha(t,e,a,n){Ne.setBuffer(t._roots[e]);var r=Wa(0,t,a,n);return Ne.clearBuffer(),r}function Wa(t,e,a,n){var r=Ne.float32Array,i=Ne.uint16Array,o=Ne.uint32Array,s=2*t,c=fe(s,i);if(c){var l=he(t,o),d=ve(s,i);return va(e,a,n,l,d)}var u,f,h=me(t,o),v=Na[h],p=n.direction[v],g=p>=0;g?(u=pe(t),f=ge(t,o)):(u=ge(t,o),f=pe(t));var m=fa(u,r,n),y=m?Wa(u,e,a,n):null;if(y){var b=y.point[v],x=g?b<=r[f+h]:b>=r[f+h+3];if(x)return y}var w=fa(f,r,n),S=w?Wa(f,e,a,n):null;return y&&S?y.distance<=S.distance?y:S:y||S||null}var za=new E["g"],Ua=new Ie,qa=new Ie,Za=new E["Z"],Ya=new ke,Ja=new ke;function Ga(t,e,a,n){Ne.setBuffer(t._roots[e]);var r=Ka(0,t,a,n);return Ne.clearBuffer(),r}function Ka(t,e,a,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=Ne.float32Array,o=Ne.uint16Array,s=Ne.uint32Array,c=2*t;null===r&&(a.boundingBox||a.computeBoundingBox(),Ya.set(a.boundingBox.min,a.boundingBox.max,n),r=Ya);var l=fe(c,o);if(!l){var d=t+8,u=s[t+6];Yt(ye(d),i,za);var f=r.intersectsBox(za)&&Ka(d,e,a,n,r);if(f)return!0;Yt(ye(u),i,za);var h=r.intersectsBox(za)&&Ka(u,e,a,n,r);return!!h}var v=e.geometry,p=v.index,g=v.attributes.position,m=a.index,y=a.attributes.position,b=he(t,s),x=ve(c,o);if(Za.copy(n).invert(),a.boundsTree){Yt(ye(t),i,Ja),Ja.matrix.copy(Za),Ja.needsUpdate=!0;var w=a.boundsTree.shapecast({intersectsBounds:function(t){return Ja.intersectsBox(t)},intersectsTriangle:function(t){t.a.applyMatrix4(n),t.b.applyMatrix4(n),t.c.applyMatrix4(n),t.needsUpdate=!0;for(var a=b,r=x+b;a<r;a++)if(sa(qa,3*e.resolveTriangleIndex(a),p,g),qa.needsUpdate=!0,t.intersectsTriangle(qa))return!0;return!1}});return w}for(var S=b,_=x+b;S<_;S++){var T=e.resolveTriangleIndex(S);sa(Ua,3*T,p,g),Ua.a.applyMatrix4(Za),Ua.b.applyMatrix4(Za),Ua.c.applyMatrix4(Za),Ua.needsUpdate=!0;for(var C=0,A=m.count;C<A;C+=3)if(sa(qa,C,m,y),qa.needsUpdate=!0,Ua.intersectsTriangle(qa))return!0}}var Xa=new E["Z"],Qa=new ke,$a=new ke,tn=new E["Zb"],en=new E["Zb"],an=new E["Zb"],nn=new E["Zb"];function rn(t,e,a){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1/0;e.boundingBox||e.computeBoundingBox(),Qa.set(e.boundingBox.min,e.boundingBox.max,a),Qa.needsUpdate=!0;var s=t.geometry,c=s.attributes.position,l=s.index,d=e.attributes.position,u=e.index,f=Ve.getPrimitive(),h=Ve.getPrimitive(),v=tn,p=en,g=null,m=null;r&&(g=an,m=nn);var y=1/0,b=null,x=null;return Xa.copy(a).invert(),$a.matrix.copy(Xa),t.shapecast({boundsTraverseOrder:function(t){return Qa.distanceToBox(t)},intersectsBounds:function(t,e,a){return a<y&&a<o&&(e&&($a.min.copy(t.min),$a.max.copy(t.max),$a.needsUpdate=!0),!0)},intersectsRange:function(n,r){if(e.boundsTree){var s=e.boundsTree;return s.shapecast({boundsTraverseOrder:function(t){return $a.distanceToBox(t)},intersectsBounds:function(t,e,a){return a<y&&a<o},intersectsRange:function(e,o){for(var w=e,S=e+o;w<S;w++){var _=s.resolveTriangleIndex(w);sa(h,3*_,u,d),h.a.applyMatrix4(a),h.b.applyMatrix4(a),h.c.applyMatrix4(a),h.needsUpdate=!0;for(var T=n,C=n+r;T<C;T++){var A=t.resolveTriangleIndex(T);sa(f,3*A,l,c),f.needsUpdate=!0;var O=f.distanceToTriangle(h,v,g);if(O<y&&(p.copy(v),m&&m.copy(g),y=O,b=T,x=w),O<i)return!0}}}})}for(var w=Ft(e),S=0,_=w;S<_;S++){sa(h,3*S,u,d),h.a.applyMatrix4(a),h.b.applyMatrix4(a),h.c.applyMatrix4(a),h.needsUpdate=!0;for(var T=n,C=n+r;T<C;T++){var A=t.resolveTriangleIndex(T);sa(f,3*A,l,c),f.needsUpdate=!0;var O=f.distanceToTriangle(h,v,g);if(O<y&&(p.copy(v),m&&m.copy(g),y=O,b=T,x=S),O<i)return!0}}}}),Ve.releasePrimitive(f),Ve.releasePrimitive(h),y===1/0?null:(n.point?n.point.copy(p):n.point=p.clone(),n.distance=y,n.faceIndex=b,r&&(r.point?r.point.copy(m):r.point=m.clone(),r.point.applyMatrix4(Xa),p.applyMatrix4(Xa),r.distance=p.sub(r.point).length(),r.faceIndex=x),n)}function on(){return"undefined"!==typeof SharedArrayBuffer}var sn=new Ne.constructor,cn=new Ne.constructor,ln=new Ee((function(){return new E["g"]})),dn=new E["g"],un=new E["g"],fn=new E["g"],hn=new E["g"],vn=!1;function pn(t,e,a,n){if(vn)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");vn=!0;for(var r,i=t._roots,o=e._roots,s=0,c=0,l=(new E["Z"]).copy(a).invert(),d=0,u=i.length;d<u;d++){sn.setBuffer(i[d]),c=0;var f=ln.getPrimitive();Yt(ye(0),sn.float32Array,f),f.applyMatrix4(l);for(var h=0,v=o.length;h<v;h++)if(cn.setBuffer(o[d]),r=gn(0,0,a,l,n,s,c,0,0,f),cn.clearBuffer(),c+=o[h].length,r)break;if(ln.releasePrimitive(f),sn.clearBuffer(),s+=i[d].length,r)break}return vn=!1,r}function gn(t,e,a,n,r){var i,o,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,d=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,u=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null,f=arguments.length>10&&void 0!==arguments[10]&&arguments[10];f?(i=cn,o=sn):(i=sn,o=cn);var h=i.float32Array,v=i.uint32Array,p=i.uint16Array,g=o.float32Array,m=o.uint32Array,y=o.uint16Array,b=2*t,x=2*e,w=fe(b,p),S=fe(x,y),_=!1;if(S&&w)_=f?r(he(e,m),ve(2*e,y),he(t,v),ve(2*t,p),d,c+e,l,s+t):r(he(t,v),ve(2*t,p),he(e,m),ve(2*e,y),l,s+t,d,c+e);else if(S){var T=ln.getPrimitive();Yt(ye(e),g,T),T.applyMatrix4(a);var C=pe(t),A=ge(t,v);Yt(ye(C),h,dn),Yt(ye(A),h,un);var O=T.intersectsBox(dn),B=T.intersectsBox(un);_=O&&gn(e,C,n,a,r,c,s,d,l+1,T,!f)||B&&gn(e,A,n,a,r,c,s,d,l+1,T,!f),ln.releasePrimitive(T)}else{var D=pe(e),M=ge(e,m);Yt(ye(D),g,fn),Yt(ye(M),g,hn);var P=u.intersectsBox(fn),I=u.intersectsBox(hn);if(P&&I)_=gn(t,D,a,n,r,s,c,l,d+1,u,f)||gn(t,M,a,n,r,s,c,l,d+1,u,f);else if(P)if(w)_=gn(t,D,a,n,r,s,c,l,d+1,u,f);else{var k=ln.getPrimitive();k.copy(fn).applyMatrix4(a);var j=pe(t),L=ge(t,v);Yt(ye(j),h,dn),Yt(ye(L),h,un);var E=k.intersectsBox(dn),R=k.intersectsBox(un);_=E&&gn(D,j,n,a,r,c,s,d,l+1,k,!f)||R&&gn(D,L,n,a,r,c,s,d,l+1,k,!f),ln.releasePrimitive(k)}else if(I)if(w)_=gn(t,M,a,n,r,s,c,l,d+1,u,f);else{var V=ln.getPrimitive();V.copy(hn).applyMatrix4(a);var F=pe(t),N=ge(t,v);Yt(ye(F),h,dn),Yt(ye(N),h,un);var H=V.intersectsBox(dn),W=V.intersectsBox(un);_=H&&gn(M,F,n,a,r,c,s,d,l+1,V,!f)||W&&gn(M,N,n,a,r,c,s,d,l+1,V,!f),ln.releasePrimitive(V)}}return _}var mn=new ke,yn=new E["g"],bn={strategy:Bt,maxDepth:40,maxLeafTris:10,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,verbose:!0},xn=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Object(lt["a"])(this,t),!e.isBufferGeometry)throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.");if(a=Object.assign(Object(Ot["a"])(Object(Ot["a"])({},bn),{},Object(At["a"])({},Rt,!1)),a),a.useSharedArrayBuffer&&!on())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,a[Rt]||(Ce(this,a),!e.boundingBox&&a.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new E["g"])));var n=this._indirectBuffer;this.resolveTriangleIndex=a.indirect?function(t){return n[t]}:function(t){return t}}return Object(ct["a"])(t,[{key:"indirect",get:function(){return!!this._indirectBuffer}},{key:"refit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.indirect?Ra:ua;return e(this,t)}},{key:"traverse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=this._roots[e],n=new Uint32Array(a),r=new Uint16Array(a);function i(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=2*e,c=r[s+15]===Lt;if(c){var l=n[e+6],d=r[s+14];t(o,c,new Float32Array(a,4*e,6),l,d)}else{var u=e+jt/4,f=n[e+6],h=n[e+7],v=t(o,c,new Float32Array(a,4*e,6),h);v||(i(u,o+1),i(f,o+1))}}i(0)}},{key:"raycast",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E["x"],a=this._roots,n=this.geometry,r=[],i=e.isMaterial,o=Array.isArray(e),s=n.groups,c=i?e.side:e,l=this.indirect?Va:ga,d=0,u=a.length;d<u;d++){var f=o?e[s[d].materialIndex].side:c,h=r.length;if(l(this,d,f,t,r),o)for(var v=s[d].materialIndex,p=h,g=r.length;p<g;p++)r[p].face.materialIndex=v}return r}},{key:"raycastFirst",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E["x"],a=this._roots,n=this.geometry,r=e.isMaterial,i=Array.isArray(e),o=null,s=n.groups,c=r?e.side:e,l=this.indirect?Ha:ba,d=0,u=a.length;d<u;d++){var f=i?e[s[d].materialIndex].side:c,h=l(this,d,f,t);null!=h&&(null==o||h.distance<o.distance)&&(o=h,i&&(h.face.materialIndex=s[d].materialIndex))}return o}},{key:"intersectsGeometry",value:function(t,e){for(var a=!1,n=this._roots,r=this.indirect?Ga:Oa,i=0,o=n.length;i<o;i++)if(a=r(this,i,t,e),a)break;return a}},{key:"shapecast",value:function(t){var e=this,a=Ve.getPrimitive(),n=this.indirect?pa:da,r=t.boundsTraverseOrder,i=t.intersectsBounds,o=t.intersectsRange,s=t.intersectsTriangle;if(o&&s){var c=o;o=function(t,r,i,o,l){return!!c(t,r,i,o,l)||n(t,r,e,s,i,o,a)}}else o||(o=s?function(t,r,i,o){return n(t,r,e,s,i,o,a)}:function(t,e,a){return a});for(var l=!1,d=0,u=this._roots,f=0,h=u.length;f<h;f++){var v=u[f];if(l=ze(this,f,i,o,r,d),l)break;d+=v.byteLength}return Ve.releasePrimitive(a),l}},{key:"bvhcast",value:function(t,e,a){var n=this,r=a.intersectsRanges,i=a.intersectsTriangles,o=Ve.getPrimitive(),s=this.geometry.index,c=this.geometry.attributes.position,l=this.indirect?function(t){var e=n.resolveTriangleIndex(t);sa(o,3*e,s,c)}:function(t){sa(o,3*t,s,c)},d=Ve.getPrimitive(),u=t.geometry.index,f=t.geometry.attributes.position,h=t.indirect?function(e){var a=t.resolveTriangleIndex(e);sa(d,3*a,u,f)}:function(t){sa(d,3*t,u,f)};if(i){var v=function(t,a,n,r,s,c,u,f){for(var v=n,p=n+r;v<p;v++){h(v),d.a.applyMatrix4(e),d.b.applyMatrix4(e),d.c.applyMatrix4(e),d.needsUpdate=!0;for(var g=t,m=t+a;g<m;g++)if(l(g),o.needsUpdate=!0,i(o,d,g,v,s,c,u,f))return!0}return!1};if(r){var p=r;r=function(t,e,a,n,r,i,o,s){return!!p(t,e,a,n,r,i,o,s)||v(t,e,a,n,r,i,o,s)}}else r=v}return pn(this,t,e,r)}},{key:"intersectsBox",value:function(t,e){return mn.set(t.min,t.max,e),mn.needsUpdate=!0,this.shapecast({intersectsBounds:function(t){return mn.intersectsBox(t)},intersectsTriangle:function(t){return mn.intersectsTriangle(t)}})}},{key:"intersectsSphere",value:function(t){return this.shapecast({intersectsBounds:function(e){return t.intersectsBox(e)},intersectsTriangle:function(e){return e.intersectsSphere(t)}})}},{key:"closestPointToGeometry",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1/0,o=this.indirect?rn:Ea;return o(this,t,e,a,n,r,i)}},{key:"closestPointToPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;return Ye(this,t,e,a,n)}},{key:"getBoundingBox",value:function(t){t.makeEmpty();var e=this._roots;return e.forEach((function(e){Yt(0,new Float32Array(e),yn),t.union(yn)})),t}}],[{key:"serialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object(Ot["a"])({cloneBuffers:!0},e);var a,n=t.geometry,r=t._roots,i=t._indirectBuffer,o=n.getIndex();return a=e.cloneBuffers?{roots:r.map((function(t){return t.slice()})),index:o?o.array.slice():null,indirectBuffer:i?i.slice():null}:{roots:r,index:o?o.array:null,indirectBuffer:i},a}},{key:"deserialize",value:function(e,a){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=Object(Ot["a"])({setIndex:!0,indirect:Boolean(e.indirectBuffer)},n);var r=e.index,i=e.roots,o=e.indirectBuffer,s=new t(a,Object(Ot["a"])(Object(Ot["a"])({},n),{},Object(At["a"])({},Rt,!0)));if(s._roots=i,s._indirectBuffer=o||null,n.setIndex){var c=a.getIndex();if(null===c){var l=new E["h"](e.index,1,!1);a.setIndex(l)}else c.array!==r&&(c.array.set(r),c.needsUpdate=!0)}return s}}]),t}(),wn=a("45eb"),Sn=a("7e84"),_n=new E["g"],Tn=function(t){Object(ut["a"])(a,t);var e=Object(ft["a"])(a);function a(t,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(lt["a"])(this,a),r=e.call(this),r.material=n,r.geometry=new E["i"],r.name="MeshBVHRootHelper",r.depth=i,r.displayParents=!1,r.bvh=t,r.displayEdges=!0,r._group=o,r}return Object(ct["a"])(a,[{key:"isMesh",get:function(){return!this.displayEdges}},{key:"isLineSegments",get:function(){return this.displayEdges}},{key:"isLine",get:function(){return this.displayEdges}},{key:"raycast",value:function(){}},{key:"update",value:function(){var t=this.geometry,e=this.bvh,a=this._group;if(t.dispose(),this.visible=!1,e){var n=this.depth-1,r=this.displayParents,i=0;e.traverse((function(t,e){if(t>=n||e)return i++,!0;r&&i++}),a);var o,s,c=0,l=new Float32Array(24*i);e.traverse((function(t,e,a){var i=t>=n||e;if(i||r){Yt(0,a,_n);for(var o=_n.min,s=_n.max,d=-1;d<=1;d+=2)for(var u=d<0?o.x:s.x,f=-1;f<=1;f+=2)for(var h=f<0?o.y:s.y,v=-1;v<=1;v+=2){var p=v<0?o.z:s.z;l[c+0]=u,l[c+1]=h,l[c+2]=p,c+=3}return i}}),a),s=this.displayEdges?new Uint8Array([0,4,1,5,2,6,3,7,0,2,1,3,4,6,5,7,0,1,2,3,4,5,6,7]):new Uint8Array([0,1,2,2,1,3,4,6,5,6,7,5,1,4,5,0,4,1,2,3,6,3,7,6,0,2,4,2,6,4,1,5,3,3,5,7]),o=l.length>65535?new Uint32Array(s.length*i):new Uint16Array(s.length*i);for(var d=s.length,u=0;u<i;u++)for(var f=8*u,h=u*d,v=0;v<d;v++)o[h+v]=f+s[v];t.setIndex(new E["h"](o,1,!1)),t.setAttribute("position",new E["h"](l,3,!1)),this.visible=!0}}}]),a}(E["kb"]);E["y"];function Cn(t,e,a){return null===t?null:(t.point.applyMatrix4(e.matrixWorld),t.distance=t.point.distanceTo(a.ray.origin),t.object=e,t.distance<a.near||t.distance>a.far?null:t)}var An=new E["zb"],On=new E["Z"],Bn=E["ab"].prototype.raycast;function Dn(t,e){if(this.geometry.boundsTree){if(void 0===this.material)return;On.copy(this.matrixWorld).invert(),An.copy(t.ray).applyMatrix4(On);var a=this.geometry.boundsTree;if(!0===t.firstHitOnly){var n=Cn(a.raycastFirst(An,this.material),this,t);n&&e.push(n)}else for(var r=a.raycast(An,this.material),i=0,o=r.length;i<o;i++){var s=Cn(r[i],this,t);s&&e.push(s)}}else Bn.call(this,t,e)}function Mn(t){return this.boundsTree=new xn(this,t),this.boundsTree}function Pn(){this.boundsTree=null}a("fd87"),a("8b09"),a("143c");function In(t){switch(t){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function kn(t){switch(t){case 1:return E["Bb"];case 2:return E["xb"];case 3:return E["vb"];case 4:return E["vb"]}}function jn(t){switch(t){case 1:return E["Cb"];case 2:return E["yb"];case 3:return E["wb"];case 4:return E["wb"]}}E["n"];a("10d1"),a("caad"),a("2532");var Ln,En,Rn,Vn,Fn,Nn="\n\n// A stack of uint32 indices can can store the indices for\n// a perfectly balanced tree with a depth up to 31. Lower stack\n// depth gets higher performance.\n//\n// However not all trees are balanced. Best value to set this to\n// is the trees max depth.\n#ifndef BVH_STACK_DEPTH\n#define BVH_STACK_DEPTH 60\n#endif\n\n#ifndef INFINITY\n#define INFINITY 1e20\n#endif\n\n// Utilities\nuvec4 uTexelFetch1D( usampler2D tex, uint index ) {\n\n\tuint width = uint( textureSize( tex, 0 ).x );\n\tuvec2 uv;\n\tuv.x = index % width;\n\tuv.y = index / width;\n\n\treturn texelFetch( tex, ivec2( uv ), 0 );\n\n}\n\nivec4 iTexelFetch1D( isampler2D tex, uint index ) {\n\n\tuint width = uint( textureSize( tex, 0 ).x );\n\tuvec2 uv;\n\tuv.x = index % width;\n\tuv.y = index / width;\n\n\treturn texelFetch( tex, ivec2( uv ), 0 );\n\n}\n\nvec4 texelFetch1D( sampler2D tex, uint index ) {\n\n\tuint width = uint( textureSize( tex, 0 ).x );\n\tuvec2 uv;\n\tuv.x = index % width;\n\tuv.y = index / width;\n\n\treturn texelFetch( tex, ivec2( uv ), 0 );\n\n}\n\nvec4 textureSampleBarycoord( sampler2D tex, vec3 barycoord, uvec3 faceIndices ) {\n\n\treturn\n\t\tbarycoord.x * texelFetch1D( tex, faceIndices.x ) +\n\t\tbarycoord.y * texelFetch1D( tex, faceIndices.y ) +\n\t\tbarycoord.z * texelFetch1D( tex, faceIndices.z );\n\n}\n\nvoid ndcToCameraRay(\n\tvec2 coord, mat4 cameraWorld, mat4 invProjectionMatrix,\n\tout vec3 rayOrigin, out vec3 rayDirection\n) {\n\n\t// get camera look direction and near plane for camera clipping\n\tvec4 lookDirection = cameraWorld * vec4( 0.0, 0.0, - 1.0, 0.0 );\n\tvec4 nearVector = invProjectionMatrix * vec4( 0.0, 0.0, - 1.0, 1.0 );\n\tfloat near = abs( nearVector.z / nearVector.w );\n\n\t// get the camera direction and position from camera matrices\n\tvec4 origin = cameraWorld * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec4 direction = invProjectionMatrix * vec4( coord, 0.5, 1.0 );\n\tdirection /= direction.w;\n\tdirection = cameraWorld * direction - origin;\n\n\t// slide the origin along the ray until it sits at the near clip plane position\n\torigin.xyz += direction.xyz * near / dot( direction, lookDirection );\n\n\trayOrigin = origin.xyz;\n\trayDirection = direction.xyz;\n\n}\n",Hn="\n\n#ifndef TRI_INTERSECT_EPSILON\n#define TRI_INTERSECT_EPSILON 1e-5\n#endif\n\n// Raycasting\nbool intersectsBounds( vec3 rayOrigin, vec3 rayDirection, vec3 boundsMin, vec3 boundsMax, out float dist ) {\n\n\t// https://www.reddit.com/r/opengl/comments/8ntzz5/fast_glsl_ray_box_intersection/\n\t// https://tavianator.com/2011/ray_box.html\n\tvec3 invDir = 1.0 / rayDirection;\n\n\t// find intersection distances for each plane\n\tvec3 tMinPlane = invDir * ( boundsMin - rayOrigin );\n\tvec3 tMaxPlane = invDir * ( boundsMax - rayOrigin );\n\n\t// get the min and max distances from each intersection\n\tvec3 tMinHit = min( tMaxPlane, tMinPlane );\n\tvec3 tMaxHit = max( tMaxPlane, tMinPlane );\n\n\t// get the furthest hit distance\n\tvec2 t = max( tMinHit.xx, tMinHit.yz );\n\tfloat t0 = max( t.x, t.y );\n\n\t// get the minimum hit distance\n\tt = min( tMaxHit.xx, tMaxHit.yz );\n\tfloat t1 = min( t.x, t.y );\n\n\t// set distance to 0.0 if the ray starts inside the box\n\tdist = max( t0, 0.0 );\n\n\treturn t1 >= dist;\n\n}\n\nbool intersectsTriangle(\n\tvec3 rayOrigin, vec3 rayDirection, vec3 a, vec3 b, vec3 c,\n\tout vec3 barycoord, out vec3 norm, out float dist, out float side\n) {\n\n\t// https://stackoverflow.com/questions/42740765/intersection-between-line-and-triangle-in-3d\n\tvec3 edge1 = b - a;\n\tvec3 edge2 = c - a;\n\tnorm = cross( edge1, edge2 );\n\n\tfloat det = - dot( rayDirection, norm );\n\tfloat invdet = 1.0 / det;\n\n\tvec3 AO = rayOrigin - a;\n\tvec3 DAO = cross( AO, rayDirection );\n\n\tvec4 uvt;\n\tuvt.x = dot( edge2, DAO ) * invdet;\n\tuvt.y = - dot( edge1, DAO ) * invdet;\n\tuvt.z = dot( AO, norm ) * invdet;\n\tuvt.w = 1.0 - uvt.x - uvt.y;\n\n\t// set the hit information\n\tbarycoord = uvt.wxy; // arranged in A, B, C order\n\tdist = uvt.z;\n\tside = sign( det );\n\tnorm = side * normalize( norm );\n\n\t// add an epsilon to avoid misses between triangles\n\tuvt += vec4( TRI_INTERSECT_EPSILON );\n\n\treturn all( greaterThanEqual( uvt, vec4( 0.0 ) ) );\n\n}\n\nbool intersectTriangles(\n\t// geometry info and triangle range\n\tsampler2D positionAttr, usampler2D indexAttr, uint offset, uint count,\n\n\t// ray\n\tvec3 rayOrigin, vec3 rayDirection,\n\n\t// outputs\n\tinout float minDistance, inout uvec4 faceIndices, inout vec3 faceNormal, inout vec3 barycoord,\n\tinout float side, inout float dist\n) {\n\n\tbool found = false;\n\tvec3 localBarycoord, localNormal;\n\tfloat localDist, localSide;\n\tfor ( uint i = offset, l = offset + count; i < l; i ++ ) {\n\n\t\tuvec3 indices = uTexelFetch1D( indexAttr, i ).xyz;\n\t\tvec3 a = texelFetch1D( positionAttr, indices.x ).rgb;\n\t\tvec3 b = texelFetch1D( positionAttr, indices.y ).rgb;\n\t\tvec3 c = texelFetch1D( positionAttr, indices.z ).rgb;\n\n\t\tif (\n\t\t\tintersectsTriangle( rayOrigin, rayDirection, a, b, c, localBarycoord, localNormal, localDist, localSide )\n\t\t\t&& localDist < minDistance\n\t\t) {\n\n\t\t\tfound = true;\n\t\t\tminDistance = localDist;\n\n\t\t\tfaceIndices = uvec4( indices.xyz, i );\n\t\t\tfaceNormal = localNormal;\n\n\t\t\tside = localSide;\n\t\t\tbarycoord = localBarycoord;\n\t\t\tdist = localDist;\n\n\t\t}\n\n\t}\n\n\treturn found;\n\n}\n\nbool intersectsBVHNodeBounds( vec3 rayOrigin, vec3 rayDirection, sampler2D bvhBounds, uint currNodeIndex, out float dist ) {\n\n\tuint cni2 = currNodeIndex * 2u;\n\tvec3 boundsMin = texelFetch1D( bvhBounds, cni2 ).xyz;\n\tvec3 boundsMax = texelFetch1D( bvhBounds, cni2 + 1u ).xyz;\n\treturn intersectsBounds( rayOrigin, rayDirection, boundsMin, boundsMax, dist );\n\n}\n\n// use a macro to hide the fact that we need to expand the struct into separate fields\n#define\tbvhIntersectFirstHit(\t\tbvh,\t\trayOrigin, rayDirection, faceIndices, faceNormal, barycoord, side, dist\t)\t_bvhIntersectFirstHit(\t\tbvh.position, bvh.index, bvh.bvhBounds, bvh.bvhContents,\t\trayOrigin, rayDirection, faceIndices, faceNormal, barycoord, side, dist\t)\n\nbool _bvhIntersectFirstHit(\n\t// bvh info\n\tsampler2D bvh_position, usampler2D bvh_index, sampler2D bvh_bvhBounds, usampler2D bvh_bvhContents,\n\n\t// ray\n\tvec3 rayOrigin, vec3 rayDirection,\n\n\t// output variables split into separate variables due to output precision\n\tinout uvec4 faceIndices, inout vec3 faceNormal, inout vec3 barycoord,\n\tinout float side, inout float dist\n) {\n\n\t// stack needs to be twice as long as the deepest tree we expect because\n\t// we push both the left and right child onto the stack every traversal\n\tint ptr = 0;\n\tuint stack[ BVH_STACK_DEPTH ];\n\tstack[ 0 ] = 0u;\n\n\tfloat triangleDistance = INFINITY;\n\tbool found = false;\n\twhile ( ptr > - 1 && ptr < BVH_STACK_DEPTH ) {\n\n\t\tuint currNodeIndex = stack[ ptr ];\n\t\tptr --;\n\n\t\t// check if we intersect the current bounds\n\t\tfloat boundsHitDistance;\n\t\tif (\n\t\t\t! intersectsBVHNodeBounds( rayOrigin, rayDirection, bvh_bvhBounds, currNodeIndex, boundsHitDistance )\n\t\t\t|| boundsHitDistance > triangleDistance\n\t\t) {\n\n\t\t\tcontinue;\n\n\t\t}\n\n\t\tuvec2 boundsInfo = uTexelFetch1D( bvh_bvhContents, currNodeIndex ).xy;\n\t\tbool isLeaf = bool( boundsInfo.x & 0xffff0000u );\n\n\t\tif ( isLeaf ) {\n\n\t\t\tuint count = boundsInfo.x & 0x0000ffffu;\n\t\t\tuint offset = boundsInfo.y;\n\n\t\t\tfound = intersectTriangles(\n\t\t\t\tbvh_position, bvh_index, offset, count,\n\t\t\t\trayOrigin, rayDirection, triangleDistance,\n\t\t\t\tfaceIndices, faceNormal, barycoord, side, dist\n\t\t\t) || found;\n\n\t\t} else {\n\n\t\t\tuint leftIndex = currNodeIndex + 1u;\n\t\t\tuint splitAxis = boundsInfo.x & 0x0000ffffu;\n\t\t\tuint rightIndex = boundsInfo.y;\n\n\t\t\tbool leftToRight = rayDirection[ splitAxis ] >= 0.0;\n\t\t\tuint c1 = leftToRight ? leftIndex : rightIndex;\n\t\t\tuint c2 = leftToRight ? rightIndex : leftIndex;\n\n\t\t\t// set c2 in the stack so we traverse it later. We need to keep track of a pointer in\n\t\t\t// the stack while we traverse. The second pointer added is the one that will be\n\t\t\t// traversed first\n\t\t\tptr ++;\n\t\t\tstack[ ptr ] = c2;\n\n\t\t\tptr ++;\n\t\t\tstack[ ptr ] = c1;\n\n\t\t}\n\n\t}\n\n\treturn found;\n\n}\n";"\n\t".concat(Nn,"\n\t").concat(Hn,"\n");E["ab"].prototype.raycast=Dn,E["i"].prototype.computeBoundsTree=Mn,E["i"].prototype.disposeBoundsTree=Pn;var Wn=0,zn={WeldLightList:[],cameraStateZoom:25,addEventListener:E["t"].prototype.addEventListener,removeEventListener:E["t"].prototype.removeEventListener,dispatchEvent:E["t"].prototype.dispatchEvent,hasEventListener:E["t"].prototype.hasEventListener,ip:"",scene:null,objectIdUUidMap:new Map,opname:"",connectType:2,BSport:"",IsAllowConnect:!0,service:O.a.create({baseURL:"./submit/MESCommonBase.ashx",timeout:15e5}),selected:null,socket:null,mqttClient:{connected:!1},ProjectCode:null,sceneConfig:null,resourcesTree:null,attachments:null,resources:null,cameraState:null,cameraStateAll:[],isOk:!1,objectIdSet:new Map,animOperations:null,CraftList:{},moveTrigger:null,camera:null,cameraPosition:10,currentButton:1,cameraControls:null,TagActList:{},worker:{},RotationWorker:{},ModelRotateWorker:{},rotateSpeed:5*Math.PI/180,getObjectById:null,solveAttachModel:null,removeObject:null,setModelWireFrame:null,setTransparent:null,showMessage:null,drawPartTextInfo:null,ModelLabelList:new Map,playSoundCommand:new Tt,attachList:new Map,objMaterial:new Map,WareHouseList:[],WareHouse:new Map,WareHouseBasicModel:new Map,ProtocolIdentifiers:{Robot_7:"Robot_7",Device_3:"Device_3",Agv_3:"Agv_3",Device_1:"Device_1",FirstPosition:"FirstPosition",WareHousePart:"WareHousePart",Robot_6:"Robot_6",RobotTcp:"RobotTcp",DrawPath:"DrawPath",ReLoadData:"ReLoadData",PlayAct:"PlayAct",CraftCurrOperation:"CraftCurrOperation",Position:"Position",Select:"Select",DragMove:"DragMove",ModelTransparent:"ModelTransparent",Visible:"Visible",Frames:"Frames",ModelRotation:"ModelRotation",GoHome:"GoHome",GetJointAxisInfo:"GetJointAxisInfo",GetDeviceBaseTool:"GetDeviceBaseTool",GetJointValue:"GetJointValue",C_B_ImportModel:"C_B_ImportModel",SendURDF:"SendURDF",SendDeviceJson:"SendDeviceJson",GetDeviceJson:"GetDeviceJson",SendMotionInfo:"SendMotionInfo",C_B_ImportLayout:"C_B_ImportLayout",GetPoseLocation:"GetPoseLocation",C_B_SetProjectCode:"C_B_SetProjectCode",C_B_TagIDTrigger:"C_B_TagIDTrigger",C_B_ReLoad_TagIDHandler:"C_B_ReLoad_TagIDHandler",C_B_SetCurrSignalList:"C_B_SetCurrSignalList",SendClearModelInfo:"SendClearModelInfo",C_B_SaveProjectSimulationData:"C_B_SaveProjectSimulationData",C_B_GetProjectSimulationData:"C_B_GetProjectSimulationData",C_B_KinematicsEditing:"C_B_KinematicsEditing",C_B_SaveModel:"C_B_SaveModel",C_B_ObjectAlarm:"C_B_ObjectAlarm",C_B_JointMoveTo:"C_B_JointMoveTo",JointMoveTo:"JointMoveTo",C_B_ImportDevice:"C_B_ImportDevice",C_B_OutputDevice:"C_B_OutputDevice",C_B_ANDON:"C_B_ANDON",C_B_SparkTrigger:"C_B_SparkTrigger",C_B_ModeRun:"C_B_ModeRun"},craftPlaySolveType:{visible:"visible",rotation:"rotation",craft:"craft",signalwrite:"signalwrite",wait:"wait",FrameData:"FrameData",attach:"attach",warning:"warning"},FrameOperation:{playCraft:!0,visibleObject:!0,rotationObject:!0,writeSignal:!0,waitSignal:!0,attach:!0,warning:!0},signalSolveType:{visible:"visible",rotation:"rotation",craft:"craft",targetLocation:"targetlocation",attach:"attach",warning:"warning"}},Un=[],qn=[],Zn=new E["Yb"],Yn=new E["Ab"],Jn=new E["Yb"],Gn={components:{},name:"DMT",props:{containerHeight:{type:String,default:"100vh"},containerWidth:{type:String,default:"100vw"}},data:function(){return{checked:!1,cameraData:[],object:null,s:null}},mounted:function(){var t=this,e=this;zn.objectIdSet=new Map,zn.objMaterial=new Map,zn.attachList=new Map,this.getConfig().then((function(e){Object.hasOwnProperty.call(e,"robotList")&&(zn.robotList=e.robotList),Object.hasOwnProperty.call(e,"WareHouseList")&&(zn.WareHouseList=e.WareHouseList),Object.hasOwnProperty.call(e,"transParentList")&&e.transParentList,Object.hasOwnProperty.call(e,"connectType")&&(zn.connectType=e.connectType),zn.mqttHost=e.MQTTHost,zn.mqttPort=e.MQTTPort,zn.ip=e.webSocketIp,zn.opname=e.webSocketOpName,zn.BSport=e.webSocketBSport,zn.rootIp=e.NodeRootIp,t.getProjectConfig()})),zn.showMessage=function(t,a){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e3;e.$message({message:t,type:a,duration:n,center:!0})},zn.addEventListener("dmtModelDBClick",(function(t){console.log("dmtModelDBClick",t)}))},created:function(){},methods:{getConfig:function(){return new Promise((function(t,e){O.a.get("./DMT_WEB/config/config.json").then((function(e){var a=e.data;t(a)})).catch((function(t){e(t)}))}))},getProjectConfig:function(){var t=this,e=new Promise((function(t,e){O()({method:"get",url:"./DMT_WEB/models/DTDATA.json"}).then((function(e){zn.animOperations={},zn.moveTrigger={},e.data.forEach((function(t){Object.keys(t).forEach((function(e){"OperationTree"===e&&t[e].forEach((function(t){zn.CraftList[t.CraftCode]={},zn.CraftList[t.CraftCode]["CraftName"]=t.CraftName,zn.CraftList[t.CraftCode]["Varieties"]=t.Varieties,zn.CraftList[t.CraftCode]["CurrPlay"]=t.CurrPlay,t.CraftPlayData.length<2?zn.animOperations[t.CraftCode]="":zn.animOperations[t.CraftCode]=JSON.parse(t.CraftPlayData),zn.moveTrigger[t.CraftCode]={moveStatus:0,myVarSetInterval:null,doAnimation:!1,currentFrame:0,pausedFrame:0,animOperations:zn.animOperations[t.CraftCode],simPaceTime:20,moveStatusPosition:0}})),"TagTriggerHandler"===e&&t[e].forEach((function(t){zn.TagActList[t.TagID]?zn.TagActList[t.TagID].push({HandlerType:t.HandlerType,HandlerCode:t.HandlerCode,HandlerValue:t.HandlerValue,TagValue:t.TagValue,JointType:t.JointType,Axis:t.Axis,Flip:t.Flip,Value:t.Value,ValueFactor:t.ValueFactor}):(zn.TagActList[t.TagID]=[],zn.TagActList[t.TagID].push({HandlerType:t.HandlerType,HandlerCode:t.HandlerCode,HandlerValue:t.HandlerValue,TagValue:t.TagValue,JointType:t.JointType,Axis:t.Axis,Flip:t.Flip,Value:t.Value,ValueFactor:t.ValueFactor}))}))}))})),t(1)}))})),a=new Promise((function(t,e){O()({method:"get",url:"./DMT_WEB/models/RobotPlan_Process.json"}).then((function(e){zn.sceneConfig=e.data.sceneConfig,zn.attachments=e.data.attachments,zn.resources=e.data.resources,zn.resourcesTree=e.data.resourcesTree,zn.cameraState=e.data.cameraState,zn.ProjectCode=e.data.ProjectCode,zn.resourcesTree.forEach((function(t){"OriginModel"===t.treeType&&Un.push(t.name)})),zn.resources.forEach((function(t){zn.objectIdUUidMap.set(t.id,t)})),zn.attachments.forEach((function(t){zn.attachList.set(t.RootId,t.attachList)})),t(1)})).catch((function(t){console.log(t)}))}));Promise.all([e,a]).then((function(e){t.init()}))},setModelSates:function(){zn.resourcesTree.forEach((function(t){"0"===t.visible&&zn.getObjectById(t.id)&&(zn.getObjectById(t.id).visible=!!parseInt(t.visible))}));var t,e=zn.resourcesTree,a=Object(m["a"])(e);try{for(a.s();!(t=a.n()).done;){var n=t.value;if("folder"!==n.treeType){var r=zn.getObjectById(n.id);Object.hasOwnProperty.call(n,"WireFrame")&&n.WireFrame&&zn.setModelWireFrame(r,!0),Object.hasOwnProperty.call(n,"transParent")&&n.transParent&&zn.setTransparent(n.id,.3),r&&(r.visible=!!parseInt(n.visible))}}}catch(i){a.e(i)}finally{a.f()}},setSceneStates:function(t){var e=t.RenderColorModel.model;switch(e){case"0":En.background=new E["l"]("#dcdcdc");break;case"1":En.background=new E["l"](t.RenderColorModel.color);break;case"2":if(""===t.RenderColorModel.image)return void(zn.scene.background=new E["l"](t.RenderColorModel.color));(new E["Qb"]).load(""===t.RenderColorModel.image,(function(t){En.background=t,t.dispose()}));break;default:En.background=new E["l"]("#dcdcdc");break}var a=t.sliderToneMappingExposure;Fn.toneMappingExposure=a},init:function(){var t=this;this.setEditorFunction();var e=this;Ln=document.getElementById("viewPort"),En=new E["Fb"],En.environmentRotation=new E["s"](Math.PI/2,0,0),En.backgroundRotation=new E["s"](Math.PI/2,0,0),zn.scene=En;var a=Ln.clientWidth,n=Ln.clientHeight,r=a/n;Rn=new E["nb"](45,r,.01,2e3),Rn.name="Camera",Rn.position.set(0,50,100),Rn.up.set(0,0,1),Rn.lookAt(new E["Zb"](1,1,1)),En.add(Rn),zn.camera=Rn,Vn=new E["d"](1),En.add(Vn),Fn=new E["cc"]({antialias:!0}),Fn.outputColorSpace=E["Eb"],Fn.setPixelRatio(window.devicePixelRatio),Fn.setSize(Ln.clientWidth,Ln.clientHeight),Fn.setClearColor(13421772),Fn.toneMapping=E["S"],Fn.toneMappingExposure=Math.pow(2,0);var i=new E["mb"](Fn);i.compileEquirectangularShader();var o=(new it["a"]).setPath("./DMT_WEB/models/"),s=new ot["a"];s.setDecoderPath("./DMT_WEB/draco/"),o.setDRACOLoader(s),(new Ct["a"]).load("./DMT_WEB/assets/IndoorEnvironment.exr",(function(t){var e=i.fromEquirectangular(t).texture;En.environment=e,En.background=new E["l"]("#081f48"),i.dispose()}),void 0,void 0),this.setSceneStates(zn.sceneConfig),Ln.appendChild(Fn.domElement),Ln.addEventListener("dblclick",this.ondblclick,!1),zn.cameraControls=new pt(zn.camera,Fn.domElement),zn.cameraControls.listenToKeyEvents(window),zn.cameraControls.update(),zn.cameraControls.addEventListener("change",(function(e){t.sendCameraState()}));var c=new E["b"](new E["l"]("#ffffff"),1);c.name="ambient_light",zn.cameraControls.object.add(c);var l=new E["q"](new E["l"]("#ffffff"),1);l.position.set(.5,0,.866),l.name="main_light",zn.cameraControls.object.add(l),window.addEventListener("resize",this.onWindowResize,!1),zn.cameraControls.resetState(zn.cameraState.target,zn.cameraState.position,zn.cameraState.zoom0),this.animate(),setTimeout((function(){for(var t=function(t){o.load(Un[t]+".glb",(function(t){var a=t.scene.children[0];a.traverse((function(t){t.isMesh&&t["material"]&&(t.geometry.computeBoundsTree({maxLeafTris:5,strategy:0}),t.geometry.boundsTree.splitStrategy=0,zn.objMaterial.set(t.id,t["material"]))})),En.add(a),e.setObjectByConfig(a),qn.push(t.scene.id),Wn+=1,e.$refs.modelProcess.innerText="正在加载模型"+(Wn/Un.length*100).toFixed(2)+"%",Wn===Un.length&&(e.$refs.modelProcess.style.display="none",e.lookObject(En),e.setModelSates(),e.connectService())}),(function(t){}),(function(a){Wn+=1,console.log("加载模型".concat(Un[t].ModelName,"出错!")),Wn===Un.length&&(e.$refs.modelProcess.style.display="none",e.lookObject(En),e.setModelSates(),e.connectService())}))},a=0;a<Un.length;a++)t(a)}),1e3)},setEditorFunction:function(){var t=this;zn.getObjectById=function(t){var e=null,a=zn.objectIdSet.get(t);return a&&(e=a.object),e},zn.solveAttachModel=function(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]},zn.removeObject=function(t){null!==t&&null!==t.parent&&t.parent.remove(t)},zn.setModelWireFrame=function(t,e){t.traverse((function(t){t instanceof E["ab"]&&(t.material=zn.objMaterial.get(t.id).clone(),t.material["wireframe"]=e,t.material.needsUpdate=!0)}))},zn.setTransparent=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.3;new Promise((function(a,n){var r=zn.getObjectById(t);r?(r.traverse((function(t){if(t.material){var a=zn.objMaterial.get(t.id).clone();t.material=a,1!==e&&(t.material=new E["db"]({color:a.color,side:2,transparent:!0,opacity:e}))}})),a(!0)):(console.warn("模型不存在setTransparent"),n(!1))}))},zn.drawPartTextInfo=function(e,a){new Promise((function(n,r){var i=zn.ModelLabelList.get(e),o=zn.getObjectById(e);if(o&&(i||(i={position:t.getDeltaPosition(new E["Zb"],{x:0,y:0,z:.5}),label:a,object:null},zn.ModelLabelList.set(e,i)),i.object&&zn.removeObject(i.object),o.visible)){i.label=a.replaceAll("\\n","\n");var s=new rt(i.label,.2,"#000000");s.backgroundColor="rgb(255,183,0)",s.position.copy(i.position),i.object=s,o.add(s)}}))}},onWindowResize:function(){var t=Ln.clientWidth/Ln.clientHeight;Fn.setSize(Ln.clientWidth,Ln.clientHeight),Rn.aspect=t,Rn.updateProjectionMatrix(),this.render(),this.sendCameraState()},setObjectByConfig:function(t){var e=t.userData["ModelId"],a=zn.objectIdUUidMap.get(e);a&&(t.position.copy(new E["Zb"](parseFloat(a.location.position.x),parseFloat(a.location.position.y),parseFloat(a.location.position.z))),t.quaternion.copy(new E["tb"](parseFloat(a.location.quaternion.x),parseFloat(a.location.quaternion.y),parseFloat(a.location.quaternion.z),parseFloat(a.location.quaternion.w))),t.visible=Boolean(parseInt(a.visible)))},animate:function(){this.render(),requestAnimationFrame(this.animate),zn.attachList.forEach((function(t,e){var a=zn.getObjectById(e);if(a&&!a.lastMatrixWorld.equals(a.matrixWorld)){var n,r=Object(m["a"])(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=zn.getObjectById(i.ModelId);if(o){var s=a.matrixWorld.clone(),c=s.clone().multiply(a.lastMatrixWorld.clone().invert()).clone(),l=o.matrixWorld.clone(),d=c.clone().multiply(l),u=o.parent.matrixWorld.clone(),f=u.invert().multiply(d),h=new E["Zb"],v=new E["tb"],p=new E["Zb"];f.decompose(h,v,p),o.quaternion.copy(v),o.position.copy(h),o.updateMatrixWorld()}}}catch(g){r.e(g)}finally{r.f()}a.lastMatrixWorld=a.matrixWorld.clone()}})),st["c"]()},render:function(){Fn.render(En,Rn);for(var t=0;t<zn.WeldLightList.length;t++)"1"===zn.WeldLightList[t].TagValue?zn.WeldLightList[t].light.visible=!zn.WeldLightList[t].light.visible:zn.WeldLightList[t].light.visible=!1},connectService:function(){switch(zn.connectType){case 1:yt(zn);break;case 2:_t(zn);break;default:break}},lookObject:function(t){for(var e in t.traverse((function(t){t&&Object.hasOwnProperty.call(t.userData,"ModelId")&&(zn.objectIdSet.has(t.userData["ModelId"])?(t.userData["ModelId"]=t.uuid,zn.objectIdSet.set(t.uuid,{ModelId:t.id,Name:t.name,position:JSON.parse(JSON.stringify(t.position)),rotation:JSON.parse(JSON.stringify(t.rotation)),quaternion:JSON.parse(JSON.stringify(t.quaternion)),object:t,matrix:t.matrix.clone(),lastValue:null})):zn.objectIdSet.set(t.userData["ModelId"],{ModelId:t.id,Name:t.name,position:JSON.parse(JSON.stringify(t.position)),rotation:JSON.parse(JSON.stringify(t.rotation)),quaternion:JSON.parse(JSON.stringify(t.quaternion)),object:t,matrix:t.matrix.clone(),lastValue:null}))})),zn.robotList){var a,n=Object(m["a"])(zn.robotList[e]);try{for(n.s();!(a=n.n()).done;){var r=a.value;r.object=zn.getObjectById(r.ModelId),r.matrix=r.object?r.object.matrix.clone():null,r.lastValue=null}}catch(o){n.e(o)}finally{n.f()}}for(var i in t.traverse((function(t){t.lastMatrixWorld=t.matrixWorld.clone()})),window.dt_Config.weldInfo)zn.WeldLightList.push({id:i,name:window.dt_Config.weldInfo[i].name,TagValue:"0",light:this.drawWeldLight(i,window.dt_Config.weldInfo[i].weldPosition)});window.editor=zn},getMousePosition:function(t,e,a){var n=t.getBoundingClientRect();return[(e-n.left)/n.width,(a-n.top)/n.height]},ondblclick:function(t){try{var e=this.getMousePosition(Ln,t.clientX,t.clientY);Zn.fromArray(e);var a=this.getIntersects(Zn,zn.scene.children);if(a=a.filter((function(t){return t.object.visible})),a.length>0){var n=a[0].object.userData["RootId"];zn.selected=zn.getObjectById(n),zn.dispatchEvent({type:"dmtModelDBClick",ModelId:zn.selected.userData["ModelId"],ModelName:zn.selected.userData["name"]})}else zn.selected=null,zn.dispatchEvent({type:"dmtModelDBClick",ModelId:"",ModelName:""})}catch(r){zn.selected=null,zn.dispatchEvent({type:"dmtModelDBClick",ModelId:"",ModelName:""})}},getIntersects:function(t,e){return Jn.set(2*t.x-1,-2*t.y+1),Yn.setFromCamera(Jn,Rn),Yn.intersectObjects(e,!0)},sendCameraState:function(t){var e=zn.cameraControls.target,a=Rn.position,n=a.distanceTo(e);this.$emit("changeCameraState",n)},updatePosition:function(){if(zn.selected){var t=zn.selected.getWorldPosition(new E["Zb"]).clone().project(Rn),e=window.innerWidth/2,a=window.innerHeight/2,n={left:t.x*e+e-200,top:-t.y*a+a-500};this.$emit("clickModel",zn.selected,n)}},getDeltaPosition:function(t,e){return new E["Zb"](e.x-t.x,e.y-t.y,e.z-t.z)},drawWeldLight:function(t,e){var a=new E["i"],n=[],r=new E["Qb"],i=r.load("./css/lensflare0_alpha.png"),o=0+e.x,s=0+e.y,c=0+e.z,l=[];n.push(o,s,c),a.setAttribute("position",new E["v"](n,3));var d=[[[1,1,1],i,.1]],u=d[0][1],f=d[0][2];l[0]=new E["rb"]({size:f,map:u,blending:E["a"],depthTest:!1,transparent:!0});var h=new E["qb"](a,l[0]),v=zn.getObjectById(t);return v&&v.add(h),h}}},Kn=Gn,Xn=(a("c0d8"),Object(o["a"])(Kn,k,j,!1,null,null,null));Xn.options.__file="index.vue";var Qn=Xn.exports,$n={name:"MingLuo",components:{DMT:Qn},data:function(){return{isShow1:!0,isShow:"inline",isShowBtn1:!1,isShowBtn:"none",src:localStorage.getItem("twinAddress"),titlePng:"",titlePng1:"",date:new Date,year:"",month:"",day:"",minute:"",hour:"",second:"",week:""}},created:function(){this.getLogo()},mounted:function(){var t=this,e=this;this.timer=setInterval((function(){e.date=new Date,t.year=(new Date).getFullYear()+1<10?"0"+((new Date).getFullYear()+1):(new Date).getFullYear(),t.month=(new Date).getMonth()+1<10?"0"+((new Date).getMonth()+1):(new Date).getMonth()+1,t.day=(new Date).getDate()<10?"0"+(new Date).getDate():(new Date).getDate(),t.hour=(new Date).getHours()<10?"0"+(new Date).getHours():(new Date).getHours(),t.minute=(new Date).getMinutes()<10?"0"+(new Date).getMinutes():(new Date).getMinutes(),t.second=(new Date).getSeconds()<10?"0"+(new Date).getSeconds():(new Date).getSeconds(),t.week="日一二三四五六".charAt((new Date).getDay())}),1e3)},beforeDestroy:function(){},methods:{restView:function(){window.editor.cameraControls.resetState(window.editor.cameraState.target,window.editor.cameraState.position,window.editor.cameraState.zoom0)},getLogo:function(){var t=this;O.a.get("../../DFlogo.jpg",{responseType:"arraybuffer"}).then((function(e){t.titlePng="data:image/jpeg;base64,"+btoa(new Uint8Array(e.data).reduce((function(t,e){return t+String.fromCharCode(e)}),""))})),O.a.get("../../MESlogo.png",{responseType:"arraybuffer"}).then((function(e){t.titlePng1="data:image/jpeg;base64,"+btoa(new Uint8Array(e.data).reduce((function(t,e){return t+String.fromCharCode(e)}),""))}))}}},tr=$n,er=(a("cc5b"),a("d499"),Object(o["a"])(tr,P,I,!1,null,"69b8aa70",null));er.options.__file="DT.vue";var ar=er.exports,nr=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"allShow",style:{width:t.style.width+"px",height:t.style.height+"px",transform:""+t.style.transform},attrs:{id:"screen"}},[n("el-row",{staticStyle:{"box-shadow":"inset 0 0 30px rgb(24, 78, 135)"}},[n("div",{staticStyle:{height:"65px",width:"1918px"}},[n("el-col",{staticStyle:{height:"100%",display:"flex","align-items":"center"},attrs:{span:6}},[n("div",{staticStyle:{"background-color":"#fff","margin-left":"15px"}},[n("img",{staticStyle:{height:"40px",cursor:"pointer","background-color":"#fff"},attrs:{src:t.titlePng}}),n("img",{staticStyle:{height:"40px",cursor:"pointer","background-color":"#fff","margin-left":"3px"},attrs:{src:t.titlePng2}})])]),n("el-col",{staticStyle:{height:"100%"},attrs:{span:12}},[n("div",{staticStyle:{"font-size":"2.8rem",color:"white","text-align":"center"}},[n("span",{staticStyle:{"letter-spacing":"5px","font-weight":"bolder"}},[t._v("航空发动机叶片制孔数字化柔性生产线")])])]),n("el-col",{staticStyle:{height:"100%",display:"flex","align-items":"center","justify-content":"flex-end"},attrs:{span:6}},[n("el-col",{attrs:{span:7}}),n("el-col",{staticStyle:{display:"flex","flex-direction":"column","font-size":"1.3rem"},attrs:{span:7}},[n("span",[t._v(t._s(this.year+"/"+this.month+"/"+this.day))]),n("span",{staticStyle:{"font-weight":"bolder"}},[t._v(t._s(this.hour+":"+this.minute+":"+this.second))])])],1)],1)]),n("el-row",[n("div",{staticStyle:{position:"relative"}},[n("div",{staticStyle:{height:"100%",width:"100%",position:"absolute"}},[n("div",{staticStyle:{width:"100%",height:"1000px",filter:"blur(10)","z-index":"999"}},[n("d-m-t",{ref:"dmtCom",attrs:{containerHeight:"1000px",containerWidth:"100%"},on:{changeCameraState:t.changeCameraState}})],1)]),n("div",{staticClass:"data-box",staticStyle:{left:"10px",top:"10px"},style:{display:t.isShow}},[n("span",{staticClass:"borderLeft1 boxBorder"}),n("span",{staticClass:"borderLeft2 boxBorder"}),n("span",{staticClass:"borderRight1 boxBorder"}),n("span",{staticClass:"borderRight2 boxBorder"}),n("div",{staticStyle:{width:"100%",height:"30px"}},[n("div",{staticClass:"indicatorBlock"}),n("div",{staticClass:"indicatorText"},[t._v("\n HS600小孔机1\n ")])]),n("div",{staticClass:"max-box"},[n("div",{attrs:{id:"title"}},[t._v("设备状态")]),n("div",{staticClass:"main"},[n("div",[n("div",{staticStyle:{margin:"0 80px"},style:{backgroundColor:t.getStatusBgc(t.deviceList[0].Status)}},[t._v(t._s(t.deviceStatus[t.deviceList[0].Status]))])])])]),n("div",{staticClass:"max-box"},[n("div",{attrs:{id:"title"}},[t._v("机械坐标")]),n("div",{staticClass:"main"})]),n("div",{staticStyle:{"margin-bottom":"0px",height:"145px"}},[n("div",{staticClass:"main",staticStyle:{"margin-left":"1px"}},[n("el-col",{attrs:{span:14}},[n("table",[n("tr",[n("td",{staticStyle:{"font-weight":"bolder","font-size":"15px",width:"50px"}},[t._v("轴")]),n("td",{staticStyle:{"font-weight":"bolder","font-size":"15px",width:"120px"}},[t._v("坐标")])]),t._l(t.deviceList[0].Axis,(function(e,a){return n("tr",{key:a,staticStyle:{"font-size":"13px"}},[n("td",{staticStyle:{width:"80px"}},[t._v(t._s(e.AxisName))]),n("td",[t._v(t._s(e.AxisValue))])])}))],2)]),n("el-col",{attrs:{span:10}},[n("div",{staticStyle:{width:"99%",height:"143px"}},[n("el-row",[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[n("img",{staticStyle:{width:"32px"},attrs:{src:a("bccc")}}),n("div",[n("div",{staticClass:"device_va_name"},[t._v("机床电流")]),n("div",{staticClass:"device_va_value"},[t._v(t._s(t.deviceList[0].Current))])])])]),n("el-row",[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[n("img",{staticStyle:{width:"32px"},attrs:{src:a("8bc3")}}),n("div",[n("div",{staticClass:"device_va_name"},[t._v("机床电压")]),n("div",{staticClass:"device_va_value"},[t._v(t._s(t.deviceList[0].Voltage))])])])])],1)])],1)]),n("div",{staticClass:"max-box",staticStyle:{margin:"0"}},[n("div",{attrs:{id:"title"}},[t._v("当前报警")])]),n("div",{staticStyle:{"margin-bottom":"0px"}},[n("div",{staticStyle:{"margin-left":"1px",border:"1px solid #9f9f9f",height:"25px"}},t._l(t.deviceList[0].Alarm,(function(e,a){return n("div",{key:a,staticStyle:{display:"flex","align-items":"center",height:"25px"}},[n("div",{staticStyle:{"border-right":"1px solid #9f9f9f",height:"25px",width:"80px","text-align":"center"}},[t._v(t._s(e.AlarmCode))]),n("div",{staticStyle:{height:"25px",width:"100%"}},[t._v(t._s(e.Alarm))])])})),0)]),n("div",{staticClass:"max-box",staticStyle:{margin:"0"}},[n("div",{attrs:{id:"title"}},[t._v("机床提示")])]),n("div",{staticStyle:{"margin-bottom":"0px",height:"20px"}},[n("div",{staticStyle:{"margin-left":"1px",border:"1px solid #9f9f9f",height:"25px"}},t._l(t.deviceList[0].Tip,(function(e,a){return n("div",{key:a,staticStyle:{display:"flex","align-items":"center",height:"25px"}},[n("div",{staticStyle:{"border-right":"1px solid #9f9f9f",height:"25px",width:"80px","text-align":"center"}},[t._v(t._s(e.TipCode))]),n("div",{staticStyle:{height:"25px",width:"100%"}},[t._v(t._s(e.Tip))])])})),0)])]),n("div",{staticClass:"data-box",staticStyle:{left:"10px",top:"370px"},style:{display:t.isShow}},[n("span",{staticClass:"borderLeft1 boxBorder"}),n("span",{staticClass:"borderLeft2 boxBorder"}),n("span",{staticClass:"borderRight1 boxBorder"}),n("span",{staticClass:"borderRight2 boxBorder"}),n("div",{staticStyle:{width:"100%",height:"30px"}},[n("div",{staticClass:"indicatorBlock"}),n("div",{staticClass:"indicatorText"},[t._v("\n HS600小孔机2\n ")])]),n("div",{staticClass:"max-box"},[n("div",{attrs:{id:"title"}},[t._v("设备状态")]),n("div",{staticClass:"main"},[n("div",{},[n("div",{staticStyle:{margin:"0 80px"},style:{backgroundColor:t.getStatusBgc(t.deviceList[1].Status)}},[t._v(t._s(t.deviceStatus[t.deviceList[1].Status]))])])])]),n("div",{staticClass:"max-box"},[n("div",{attrs:{id:"title"}},[t._v("机械坐标")]),n("div",{staticClass:"main"})]),n("div",{staticStyle:{"margin-bottom":"0px",height:"145px"}},[n("div",{staticClass:"main",staticStyle:{"margin-left":"1px"}},[n("el-col",{attrs:{span:14}},[n("table",[n("tr",[n("td",{staticStyle:{"font-weight":"bolder","font-size":"15px",width:"50px"}},[t._v("轴")]),n("td",{staticStyle:{"font-weight":"bolder","font-size":"15px",width:"120px"}},[t._v("坐标")])]),t._l(t.deviceList[1].Axis,(function(e,a){return n("tr",{key:a,staticStyle:{"font-size":"13px"}},[n("td",{staticStyle:{width:"80px"}},[t._v(t._s(e.AxisName))]),n("td",[t._v(t._s(e.AxisValue))])])}))],2)]),n("el-col",{attrs:{span:10}},[n("div",{staticStyle:{width:"99%",height:"143px"}},[n("el-row",[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[n("img",{staticStyle:{width:"32px"},attrs:{src:a("bccc")}}),n("div",[n("div",{staticClass:"device_va_name"},[t._v("机床电流")]),n("div",{staticClass:"device_va_value"},[t._v(t._s(t.deviceList[1].Current))])])])]),n("el-row",[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[n("img",{staticStyle:{width:"32px"},attrs:{src:a("8bc3")}}),n("div",[n("div",{staticClass:"device_va_name"},[t._v("机床电压")]),n("div",{staticClass:"device_va_value"},[t._v(t._s(t.deviceList[1].Voltage))])])])])],1)])],1)]),n("div",{staticClass:"max-box",staticStyle:{margin:"0"}},[n("div",{attrs:{id:"title"}},[t._v("当前报警")])]),n("div",{staticStyle:{"margin-bottom":"0px"}},[n("div",{staticStyle:{"margin-left":"1px",border:"1px solid #9f9f9f",height:"25px"}},t._l(t.deviceList[1].Alarm,(function(e,a){return n("div",{key:a,staticStyle:{display:"flex","align-items":"center",height:"25px"}},[n("div",{staticStyle:{"border-right":"1px solid #9f9f9f",height:"25px",width:"80px","text-align":"center"}},[t._v(t._s(e.AlarmCode))]),n("div",{staticStyle:{height:"25px",width:"100%"}},[t._v(t._s(e.Alarm))])])})),0)]),n("div",{staticClass:"max-box",staticStyle:{margin:"0"}},[n("div",{attrs:{id:"title"}},[t._v("机床提示")])]),n("div",{staticStyle:{"margin-bottom":"0px",height:"20px"}},[n("div",{staticStyle:{"margin-left":"1px",border:"1px solid #9f9f9f",height:"25px"}},t._l(t.deviceList[1].Tip,(function(e,a){return n("div",{key:a,staticStyle:{display:"flex","align-items":"center",height:"25px"}},[n("div",{staticStyle:{"border-right":"1px solid #9f9f9f",height:"25px",width:"80px","text-align":"center"}},[t._v(t._s(e.TipCode))]),n("div",{staticStyle:{height:"25px",width:"100%"}},[t._v(t._s(e.Tip))])])})),0)])]),n("div",{staticClass:"data-box",staticStyle:{left:"10px",top:"730px",height:"270px"},style:{display:t.isShow}},[n("span",{staticClass:"borderLeft1 boxBorder"}),n("span",{staticClass:"borderLeft2 boxBorder"}),n("span",{staticClass:"borderRight1 boxBorder"}),n("span",{staticClass:"borderRight2 boxBorder"}),n("div",{staticStyle:{width:"100%",height:"30px"}},[n("div",{staticClass:"indicatorBlock"}),n("div",{staticClass:"indicatorText"},[t._v("\n 设备开机率\n ")])]),n("div",{staticStyle:{height:"240px",width:"100%"},attrs:{id:"dashboard3"}})]),n("div",{staticClass:"data-box",staticStyle:{right:"10px",top:"10px"},style:{display:t.isShow}},[n("span",{staticClass:"borderLeft1 boxBorder"}),n("span",{staticClass:"borderLeft2 boxBorder"}),n("span",{staticClass:"borderRight1 boxBorder"}),n("span",{staticClass:"borderRight2 boxBorder"}),n("div",{staticStyle:{width:"100%",height:"30px"}},[n("div",{staticClass:"indicatorBlock"}),n("div",{staticClass:"indicatorText"},[t._v("\n HS600小孔机3\n ")])]),n("div",{staticClass:"max-box"},[n("div",{attrs:{id:"title"}},[t._v("设备状态")]),n("div",{staticClass:"main"},[n("div",{},[n("div",{staticStyle:{margin:"0 80px"},style:{backgroundColor:t.getStatusBgc(t.deviceList[2].Status)}},[t._v(t._s(t.deviceStatus[t.deviceList[2].Status]))])])])]),n("div",{staticClass:"max-box"},[n("div",{attrs:{id:"title"}},[t._v("机械坐标")]),n("div",{staticClass:"main"})]),n("div",{staticStyle:{"margin-bottom":"0px",height:"145px"}},[n("div",{staticClass:"main",staticStyle:{"margin-left":"1px"}},[n("el-col",{attrs:{span:14}},[n("table",[n("tr",[n("td",{staticStyle:{"font-weight":"bolder","font-size":"15px",width:"50px"}},[t._v("轴")]),n("td",{staticStyle:{"font-weight":"bolder","font-size":"15px",width:"120px"}},[t._v("坐标")])]),t._l(t.deviceList[2].Axis,(function(e,a){return n("tr",{key:a,staticStyle:{"font-size":"13px"}},[n("td",{staticStyle:{width:"80px"}},[t._v(t._s(e.AxisName))]),n("td",[t._v(t._s(e.AxisValue))])])}))],2)]),n("el-col",{attrs:{span:10}},[n("div",{staticStyle:{width:"99%",height:"143px"}},[n("el-row",[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[n("img",{staticStyle:{width:"32px"},attrs:{src:a("bccc")}}),n("div",[n("div",{staticClass:"device_va_name"},[t._v("机床电流")]),n("div",{staticClass:"device_va_value"},[t._v(t._s(t.deviceList[2].Current))])])])]),n("el-row",[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[n("img",{staticStyle:{width:"32px"},attrs:{src:a("8bc3")}}),n("div",[n("div",{staticClass:"device_va_name"},[t._v("机床电压")]),n("div",{staticClass:"device_va_value"},[t._v(t._s(t.deviceList[2].Voltage))])])])])],1)])],1)]),n("div",{staticClass:"max-box",staticStyle:{margin:"0"}},[n("div",{attrs:{id:"title"}},[t._v("当前报警")])]),n("div",{staticStyle:{"margin-bottom":"0px"}},[n("div",{staticStyle:{"margin-left":"1px",border:"1px solid #9f9f9f",height:"25px"}},t._l(t.deviceList[2].Alarm,(function(e,a){return n("div",{key:a,staticStyle:{display:"flex","align-items":"center",height:"25px"}},[n("div",{staticStyle:{"border-right":"1px solid #9f9f9f",height:"25px",width:"80px","text-align":"center"}},[t._v(t._s(e.AlarmCode))]),n("div",{staticStyle:{height:"25px",width:"100%"}},[t._v(t._s(e.Alarm))])])})),0)]),n("div",{staticClass:"max-box",staticStyle:{margin:"0"}},[n("div",{attrs:{id:"title"}},[t._v("机床提示")])]),n("div",{staticStyle:{"margin-bottom":"0px",height:"20px"}},[n("div",{staticStyle:{"margin-left":"1px",border:"1px solid #9f9f9f",height:"25px"}},t._l(t.deviceList[2].Tip,(function(e,a){return n("div",{key:a,staticStyle:{display:"flex","align-items":"center",height:"25px"}},[n("div",{staticStyle:{"border-right":"1px solid #9f9f9f",height:"25px",width:"80px","text-align":"center"}},[t._v(t._s(e.TipCode))]),n("div",{staticStyle:{height:"25px",width:"100%"}},[t._v(t._s(e.Tip))])])})),0)])]),n("div",{staticClass:"data-box",staticStyle:{right:"10px",top:"370px"},style:{display:t.isShow}},[n("span",{staticClass:"borderLeft1 boxBorder"}),n("span",{staticClass:"borderLeft2 boxBorder"}),n("span",{staticClass:"borderRight1 boxBorder"}),n("span",{staticClass:"borderRight2 boxBorder"}),n("div",{staticStyle:{width:"100%",height:"30px"}},[n("div",{staticClass:"indicatorBlock"}),n("div",{staticClass:"indicatorText"},[t._v("\n ADV600成形机\n ")])]),n("div",{staticClass:"max-box"},[n("div",{attrs:{id:"title"}},[t._v("设备状态")]),n("div",{staticClass:"main"},[n("div",{},[n("div",{staticStyle:{margin:"0 80px"},style:{backgroundColor:t.getStatusBgc(t.deviceList[3].Status)}},[t._v(t._s(t.deviceStatus[t.deviceList[3].Status]))])])])]),n("div",{staticClass:"max-box"},[n("div",{attrs:{id:"title"}},[t._v("机械坐标")]),n("div",{staticClass:"main"})]),n("div",{staticStyle:{"margin-bottom":"0px",height:"145px"}},[n("div",{staticClass:"main",staticStyle:{"margin-left":"1px"}},[n("el-col",{attrs:{span:14}},[n("table",[n("tr",[n("td",{staticStyle:{"font-weight":"bolder","font-size":"15px",width:"50px"}},[t._v("轴")]),n("td",{staticStyle:{"font-weight":"bolder","font-size":"15px",width:"120px"}},[t._v("坐标")])]),t._l(t.deviceList[3].Axis,(function(e,a){return n("tr",{key:a,staticStyle:{"font-size":"13px"}},[n("td",{staticStyle:{width:"80px"}},[t._v(t._s(e.AxisName))]),n("td",[t._v(t._s(e.AxisValue))])])}))],2)]),n("el-col",{attrs:{span:10}},[n("div",{staticStyle:{width:"99%",height:"143px"}},[n("el-row",[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[n("img",{staticStyle:{width:"32px"},attrs:{src:a("bccc")}}),n("div",[n("div",{staticClass:"device_va_name"},[t._v("机床电流")]),n("div",{staticClass:"device_va_value"},[t._v(t._s(t.deviceList[3].Current))])])])]),n("el-row",[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[n("img",{staticStyle:{width:"32px"},attrs:{src:a("8bc3")}}),n("div",[n("div",{staticClass:"device_va_name"},[t._v("机床电压")]),n("div",{staticClass:"device_va_value"},[t._v(t._s(t.deviceList[3].Voltage))])])])])],1)])],1)]),n("div",{staticClass:"max-box",staticStyle:{margin:"0"}},[n("div",{attrs:{id:"title"}},[t._v("当前报警")])]),n("div",{staticStyle:{"margin-bottom":"0px"}},[n("div",{staticStyle:{"margin-left":"1px",border:"1px solid #9f9f9f",height:"25px"}},t._l(t.deviceList[3].Alarm,(function(e,a){return n("div",{key:a,staticStyle:{display:"flex","align-items":"center",height:"25px"}},[n("div",{staticStyle:{"border-right":"1px solid #9f9f9f",height:"25px",width:"80px","text-align":"center"}},[t._v(t._s(e.AlarmCode))]),n("div",{staticStyle:{height:"25px",width:"100%"}},[t._v(t._s(e.Alarm))])])})),0)]),n("div",{staticClass:"max-box",staticStyle:{margin:"0"}},[n("div",{attrs:{id:"title"}},[t._v("机床提示")])]),n("div",{staticStyle:{"margin-bottom":"0px",height:"20px"}},[n("div",{staticStyle:{"margin-left":"1px",border:"1px solid #9f9f9f",height:"25px"}},t._l(t.deviceList[3].Tip,(function(e,a){return n("div",{key:a,staticStyle:{display:"flex","align-items":"center",height:"25px"}},[n("div",{staticStyle:{"border-right":"1px solid #9f9f9f",height:"25px",width:"80px","text-align":"center"}},[t._v(t._s(e.TipCode))]),n("div",{staticStyle:{height:"25px",width:"100%"}},[t._v(t._s(e.Tip))])])})),0)])]),n("div",{staticClass:"data-box",staticStyle:{right:"10px",top:"730px",height:"270px"},style:{display:t.isShow}},[n("span",{staticClass:"borderLeft1 boxBorder"}),n("span",{staticClass:"borderLeft2 boxBorder"}),n("span",{staticClass:"borderRight1 boxBorder"}),n("span",{staticClass:"borderRight2 boxBorder"}),n("div",{staticStyle:{width:"100%",height:"30px"}},[n("div",{staticClass:"indicatorBlock"}),n("div",{staticClass:"indicatorText"},[t._v("\n 故障统计\n ")])]),n("div",{staticStyle:{height:"240px",width:"100%"},attrs:{id:"dashboard444"}})]),n("div",{staticClass:"data-box",staticStyle:{left:"320px",top:"730px",height:"270px",width:"635px"},style:{display:t.isShow}},[n("span",{staticClass:"borderLeft1 boxBorder"}),n("span",{staticClass:"borderLeft2 boxBorder"}),n("span",{staticClass:"borderRight1 boxBorder"}),n("span",{staticClass:"borderRight2 boxBorder"}),n("div",{staticStyle:{width:"100%",height:"30px"}},[n("div",{staticClass:"indicatorBlock"}),n("div",{staticClass:"indicatorText"},[t._v("\n 设备运行履历\n ")])]),n("div",{staticStyle:{height:"240px",width:"100%"},attrs:{id:"dashboard44"}})]),t._v("4\n "),n("div",{staticClass:"data-box",staticStyle:{left:"965px",top:"730px",height:"270px",width:"635px"},style:{display:t.isShow}},[n("span",{staticClass:"borderLeft1 boxBorder"}),n("span",{staticClass:"borderLeft2 boxBorder"}),n("span",{staticClass:"borderRight1 boxBorder"}),n("span",{staticClass:"borderRight2 boxBorder"}),n("div",{staticStyle:{width:"100%",height:"30px"}},[n("div",{staticClass:"indicatorBlock"}),n("div",{staticClass:"indicatorText"},[t._v("\n 生产计数统计(JPH)\n ")])]),n("div",{staticStyle:{height:"240px",width:"100%"},attrs:{id:"dashboard4"}})]),n("div",{staticStyle:{position:"absolute",left:"390px",top:"10px",width:"200px",height:"30px"},on:{mouseover:function(e){t.isShowBtn="inline"},mouseleave:function(e){t.isShowBtn="none"}}},[n("div",{style:{display:t.isShowBtn}},[n("el-button",{staticStyle:{background:"#103666",color:"white",border:"1px solid #103666"},attrs:{size:"mini"},on:{click:t.restView}},[t._v("复原")])],1)])])])],1)},rr=[],ir=a("c7eb"),or=a("1da1"),sr=a("313e"),cr=a("1157"),lr=a.n(cr),dr=window.dt_Config.mqttTopic,ur=window.dt_Config.mqttIp,fr=window.dt_Config.mqttPort,hr=O.a.create({baseURL:window.dt_Config.serverAddress,timeout:15e5}),vr=hr;O.a.defaults.headers.post["Content-Type"]="application/json";var pr=window.dt_Config.serverAddress,gr=(window.dt_Config.serverAddress,["host","port","endpoint"]),mr=null,yr=null,br=null,xr=null,wr=null,Sr=null,_r={name:"MingLuo",components:{DMT:Qn},data:function(){return{deviceStatus:{"-1":"关机",0:"开机",1:"运行",2:"报警",3:"暂停"},deviceList:[{Name:window.dt_Config.outerLeftDeviceName,Id:"1",Status:"-1",Program:"",ProgramStatus:"",Feed:"0",Speed:"",Rapid:"0",Axis:[],Tool:{},OtherParameter:[],Alarm:[],Tip:[],robotDataList:[],servoLoadData:[],order:"21314",Voltage:"0 V",Current:"0 A"},{Name:window.dt_Config.outerRightDeviceName,Id:"2",Status:"-1",Program:"",ProgramStatus:"",Feed:"0",Speed:"",Rapid:"0",Axis:[],Tool:{},OtherParameter:[],Alarm:[],Tip:[],robotDataList:[],servoLoadData:[],order:"21314",Voltage:"0 V",Current:"0 A"},{Name:window.dt_Config.outerBottomLeftDeviceName,Id:"1",Status:"-1",Program:"",ProgramStatus:"",Feed:"",Speed:"",Rapid:"",Axis:[],Tool:{},OtherParameter:[],Alarm:[],Tip:[],robotDataList:[],servoLoadData:[],order:"21314",Voltage:"0 V",Current:"0 A"},{Name:window.dt_Config.outerBottomRightDeviceName1,Id:"1",Status:"-1",Program:"",ProgramStatus:"",Feed:"",Speed:"",Rapid:"",Axis:[],Tool:{},OtherParameter:[],Alarm:[],Tip:[],robotDataList:[],servoLoadData:[],order:"21314",Voltage:"0 V",Current:"0 A"}],style:{width:"1920",height:"1080",transform:"scaleY(1) scaleX(1) translate(-50%, -50%)"},classOption2:{step:.2,direction:1,limitMoveNum:2,openWatch:!0,hoverStop:!1},tellInfo:[],topInfo:{orderNumber:"10BK10|20230809-001-001",productNumber:"2401016-A5F/A",productName:"后桥半壳",planCount_beat:"0",realCount_beat:"0",persentCount_beat:0,planCount_day:"0",realCount_day:"0",persentCount_day:0,planCount_Week:"0",realCount_Week:"0",persentCount_Week:0,planStart:"2023-08-09",planEnd:"2023-08-09"},lightStatusFinal:{},lightStatusFinal1:{status:5},dialogFormVisible1:!1,isShow1:!0,isShow:"inline",isShowBtn1:!1,isShowBtn:"none",src:localStorage.getItem("twinAddress"),titlePng:"",titlePng1:"",titlePng2:"",listOP:[],machineInfo_state:{},list:[{"上电":"","运行":"","关机":"","报警":""}],energyPartData_Y:[],energyPartData_X:[],daliyOutPutData_X:[],daliyOutPutData_Y1:[],daliyOutPutData_Y:[],daliyOutPutData_Average:0,daliyOutPutData_Average1:0,toolListData_X:[],toolListData_Y:[],toolListData_Z:[],JPH_Xlist:[],JPH_Ylist:[],JPH_Y1list:[],MachienStatus:[],myChart4Alarm1:[],deviceStatus_colors:[],deviceStatus_state:[],deviceStatus_table:[],productionType:"",table1:[],colors:[],state:[],myChart1X:[],myChart1Y:[],myChart2X:[],myChart2Y:[],myChart3X:[],myChart3Y:[],myChart4X:[],myChart4min:0,myChart4max:500,myChart4Y:[],myChart5X:[],myChart5Y:[],myChart4X1:[],myChart4Y1:[],myChart41min:0,myChart41max:500,myChart5X1:[],myChart5Y1:[],myChart6X:[],myChart6Y:[],myChart7X:[],myChart7Y:[],myChart7min:0,myChart7max:500,myChart8X:[],myChart8Y:[],myChart11X:[],myChart11Y:[],myChart11min:0,myChart11max:500,myChart12X:[],myChart12Y:[],myChart12min:0,myChart12max:500,otherParams:[],planData:[],gaugeData:[0,0,0,0],gaugeDataRange:[.2,.8,.2,.8,.2,.8,.2,.8],planProcess:70,timeRate:50,performanceRate:54,performanceRate1:54,JPH:50,OEE:80,averData:0,timer:null,timer_1:null,timer_2:null,timer_3:null,timer_4:null,flag:0,date:new Date,year:"",month:"",day:"",minute:"",hour:"",second:"",week:"",PageCount:0,total:0,pageSize:5,PageCurrent:1}},created:function(){this.getLogo()},mounted:function(){var t=this,e=this;this.timer=setInterval((function(){e.date=new Date,t.year=(new Date).getFullYear()+1<10?"0"+((new Date).getFullYear()+1):(new Date).getFullYear(),t.month=(new Date).getMonth()+1<10?"0"+((new Date).getMonth()+1):(new Date).getMonth()+1,t.day=(new Date).getDate()<10?"0"+(new Date).getDate():(new Date).getDate(),t.hour=(new Date).getHours()<10?"0"+(new Date).getHours():(new Date).getHours(),t.minute=(new Date).getMinutes()<10?"0"+(new Date).getMinutes():(new Date).getMinutes(),t.second=(new Date).getSeconds()<10?"0"+(new Date).getSeconds():(new Date).getSeconds(),t.week="日一二三四五六".charAt((new Date).getDay())}),1e3),this.initEcharts(),this.drawDashboard3(),this.drawDashboard4(),this.drawDashboard44(),this.drawDashboard444(),this.init(),this.initLong(),this.initMqtt(),setTimeout((function(){t.timer_3=setInterval(t.init,5e3)}),200),this.setScale(),lr()(window).resize((function(){t.setScale()}))},beforeDestroy:function(){clearInterval(this.timer_1),clearInterval(this.timer_3),clearInterval(this.timer_4)},methods:{getScale:function(){var t=window.innerWidth/this.style.width,e=window.innerHeight/this.style.height;return{x:t,y:e}},setScale:function(){var t=this.getScale();this.style.transform="scaleY("+t.y+") scaleX("+t.x+") translate(-50%, -50%)"},goToOp:function(t){return Object(or["a"])(Object(ir["a"])().mark((function t(){return Object(ir["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:window.open(window.dt_Config.managerPage,"_blank");case 1:case"end":return t.stop()}}),t)})))()},initEcharts:function(){br=sr["init"](document.getElementById("dashboard3")),xr=sr["init"](document.getElementById("dashboard4")),wr=sr["init"](document.getElementById("dashboard44")),Sr=sr["init"](document.getElementById("dashboard444"))},init:function(){this.searchChartData3(),this.searchChartData4(),this.searchChartData44(),this.searchChartData444()},initLong:function(){},initFast:function(){this.searchDevicePartType()},initMqtt:function(){var t=this;window.websocketonmessageWeb=this.websocketonmessage;var e=this,a={host:ur,port:fr,endpoint:"/mqtt",clean:!0,connectTimeout:4e3,reconnectPeriod:4e3,clientId:"mqttjs_3be2c321"+(new Date).getTime(),username:"DT_WEB1",password:""},n={topic:dr,qos:0},r=a.host,i=a.port,o=a.endpoint,s=Object(bt["a"])(a,gr),c="ws://".concat(r,":").concat(i).concat(o);try{this.mqttClient=wt.a.connect(c,s)}catch(l){console.log("MQTT connect error",l)}this.mqttClient.on("connect",(function(){t.$message.success("加载完成连接MQTT服务器成功"),console.log("MQTT Connection succeeded!");var e=n.topic,a=n.qos;t.mqttClient.subscribe(e,{qos:a},(function(t,e){t&&console.log("Subscribe to topics error",t)}))})),this.mqttClient.on("error",(function(t){console.log("MQTT Connection failed",t);try{e.$message.error("MQTT服务器连接失败"),e.IsAllowConnect&&(e.$message.warning("重新连接MQTT服务器"),console.log("重新连接MQTT服务器"),setTimeout((function(){e.initMqtt()}),5e3))}catch(n){var a=n.toString();e.$message.error("MQTT服务器出现错误,关闭连接"+a)}})),this.mqttClient.on("message",(function(t,a){try{e.websocketonmessage({data:a.toString()})}catch(n){console.log(n.toString())}}))},websocketonmessage:function(t){this.msg=t;try{var e=t.data.split("|"),a=e[0],n=e[1],r=e[2];switch(a){case"MES":switch(n){case"C_B_DeviceInfo":for(var i=JSON.parse(r)[0],o=0;o<this.deviceList.length;o++){var s=this.deviceList[o];if(i.Name===s.Name){s=Object(Ot["a"])(Object(Ot["a"])({},s),i),s.hasOwnProperty("OtherParameter")&&null===s.OtherParameter&&(s.OtherParameter=[]),s.hasOwnProperty("Program")&&(null!==s.Program?s.Program=s.Program.split("\\")[s.Program.split("\\").length-1]:s.Program=""),s.hasOwnProperty("Tool")&&null===s.Tool&&(s.Tool={}),this.deviceList[o]=s;break}}break}break}}catch(l){var c=l.toString();console.log(c)}},toolInfoColor:function(t,e){var a=document.getElementById("OP_status_"+t),n="#808080";1===e&&(n="#009e1c"),3===e&&(n="#ff2020"),2===e&&(n="#ffc823"),4===e&&(n="#ff2020"),a.style.backgroundColor=n},getStatusBgc:function(t){var e="";return"1"===t&&(e="#009e1c"),"2"===t&&(e="#ff2020"),"0"===t&&(e="#ffc823"),"-1"===t&&(e="#666666"),"3"===t&&(e="#00b2ff"),e},searchPlanData:function(){var t=this,e=[],a=this.CreateData("11","产量管理_今日计划_查询",e);this.ExecDatabase(a).then((function(e){e.data.length>0&&(t.topInfo.orderNumber=e.data[0].工单号,t.topInfo.productNumber=e.data[0].产品型号,t.topInfo.planCount_beat=e.data[0].班计划数量,t.topInfo.realCount_beat=e.data[0].当班总产出,t.topInfo.persentCount_beat=e.data[0].班完成率,t.topInfo.planCount_day=e.data[0].日计划数量,t.topInfo.realCount_day=e.data[0].今日总产出,t.topInfo.persentCount_day=e.data[0].日完成率,t.topInfo.planCount_Week=e.data[0].周计划数量,t.topInfo.realCount_Week=e.data[0].本周总产出,t.topInfo.persentCount_Week=e.data[0].周完成率)}))},searchTable:function(){var t=this,e=[],a=this.CreateData("11","工位管理_工位基础信息_查询",e);this.ExecDatabase(a).then((function(e){t.listOP=e.data;var a,n=Object(m["a"])(e.data);try{for(n.s();!(a=n.n()).done;){var r=a.value;t.machineInfo_state[r.工位号]={},5===r.状态代码&&(t.machineInfo_state[r.工位号]["work"]=0,t.machineInfo_state[r.工位号]["ready"]=0,t.machineInfo_state[r.工位号]["off"]=1,t.machineInfo_state[r.工位号]["alarm"]=0,t.machineInfo_state[r.工位号]["status"]=5),0===r.状态代码&&(t.machineInfo_state[r.工位号]["work"]=0,t.machineInfo_state[r.工位号]["ready"]=0,t.machineInfo_state[r.工位号]["off"]=1,t.machineInfo_state[r.工位号]["alarm"]=0,t.machineInfo_state[r.工位号]["status"]=5),-1===r.状态代码&&(t.machineInfo_state[r.工位号]["work"]=0,t.machineInfo_state[r.工位号]["ready"]=0,t.machineInfo_state[r.工位号]["off"]=1,t.machineInfo_state[r.工位号]["alarm"]=0,t.machineInfo_state[r.工位号]["status"]=5),-2===r.状态代码&&(t.machineInfo_state[r.工位号]["work"]=0,t.machineInfo_state[r.工位号]["ready"]=0,t.machineInfo_state[r.工位号]["off"]=1,t.machineInfo_state[r.工位号]["alarm"]=0,t.machineInfo_state[r.工位号]["status"]=5),3===r.状态代码&&(t.machineInfo_state[r.工位号]["work"]=0,t.machineInfo_state[r.工位号]["ready"]=1,t.machineInfo_state[r.工位号]["off"]=0,t.machineInfo_state[r.工位号]["alarm"]=1,t.machineInfo_state[r.工位号]["status"]=3),1===r.状态代码&&(t.machineInfo_state[r.工位号]["work"]=1,t.machineInfo_state[r.工位号]["ready"]=1,t.machineInfo_state[r.工位号]["off"]=0,t.machineInfo_state[r.工位号]["alarm"]=0,t.machineInfo_state[r.工位号]["status"]=1),2===r.状态代码&&(t.machineInfo_state[r.工位号]["work"]=0,t.machineInfo_state[r.工位号]["ready"]=1,t.machineInfo_state[r.工位号]["off"]=0,t.machineInfo_state[r.工位号]["alarm"]=0,t.machineInfo_state[r.工位号]["status"]=2),4===r.状态代码&&(t.machineInfo_state[r.工位号]["work"]=0,t.machineInfo_state[r.工位号]["ready"]=1,t.machineInfo_state[r.工位号]["off"]=0,t.machineInfo_state[r.工位号]["alarm"]=1,t.machineInfo_state[r.工位号]["status"]=4)}}catch(i){n.e(i)}finally{n.f()}}))},searchTellInfoTable:function(){var t=this,e=[],a=this.CreateData("11","公告管理_公告内容_查询",e);this.ExecDatabase(a).then((function(e){e.data.length>0&&(t.tellInfo=e.data)}))},searchChartData1:function(){var t=this,e=[];this.MachienStatus=[];var a=this.CreateData("11","设备管理_设备状态占比_查询",e);this.ExecDatabase(a).then((function(e){for(var a=0;a<e.data.length;a++)t.MachienStatus.push({name:e.data[a]["设备状态名称"],value:e.data[a]["CountTime"],color:e.data[a]["颜色"]});t.drawDashboard1()}))},drawDashboard1:function(){mr.setOption({grid:{left:"10px",right:"4%",top:"8%",bottom:"0",containLabel:!0},tooltip:{trigger:"item"},legend:{orient:"vertical",left:"left",icon:"circle",textStyle:{color:"#fff",fontSize:16}},series:[{type:"pie",data:this.MachienStatus,itemStyle:{normal:{color:function(t){return t.data.color},label:{textStyle:{color:"#fff",fontSize:16,fontWeight:"bolder"}}}}}]})},searchChartData2:function(){var t=this,e=[];this.daliyOutPutData_X=[],this.daliyOutPutData_Y=[],this.daliyOutPutData_Y1=[];var a=this.CreateData("11","产量管理_7日产出曲线",e);this.ExecDatabase(a).then((function(e){if(e.data.length>0){var a,n=Object(m["a"])(e.data);try{for(n.s();!(a=n.n()).done;){var r=a.value;t.daliyOutPutData_X.push(r.date.substring(r.date.length-5,r.date.length)),t.daliyOutPutData_Y.push(r.num),t.daliyOutPutData_Y1.push(r.num1)}}catch(i){n.e(i)}finally{n.f()}t.drawDashboard2()}}))},drawDashboard2:function(){yr.setOption({legend:{type:"plain",show:!0,data:["下线","合格数"],textStyle:{color:"#fff"}},grid:[{left:"12%",top:"15%",right:"5%",bottom:"18%"}],tooltip:{trigger:"axis"},xAxis:{type:"category",data:this.daliyOutPutData_X,axisLine:{lineStyle:{color:"white"}},axisLabel:{color:"white",interval:0,rotate:45}},yAxis:{style:"white",type:"value",axisLine:{lineStyle:{color:"white"}},axisLabel:{color:"white"},splitLine:{show:!1}},series:[{name:"下线",data:this.daliyOutPutData_Y1,type:"bar",barWidth:"50%",color:"#ffc823",label:{show:!0,position:"top",color:"white",fontSize:"14"}},{name:"合格数",data:this.daliyOutPutData_Y,type:"line",barWidth:"50%",smooth:!0,itemStyle:{color:"#00beff"},label:{show:!1,color:"#fff",position:"top",fontSize:"16"}}]})},searchChartData3:function(){var t=this,e=[];this.energyPartData_X=[],this.energyPartData_Y=[];var a=this.CreateData("11","设备管理_设备开机率_查询",e);this.ExecDatabase(a).then((function(e){if(e.data.length>0){var a,n=Object(m["a"])(e.data);try{for(n.s();!(a=n.n()).done;){var r=a.value;t.energyPartData_X.push(r.工位号),t.energyPartData_Y.push(r.num)}}catch(i){n.e(i)}finally{n.f()}t.drawDashboard3()}}))},drawDashboard3:function(){br.setOption({grid:[{left:"10%",top:"12%",right:"5%",bottom:"12%"}],tooltip:{trigger:"axis"},xAxis:{type:"category",data:this.energyPartData_X,axisLine:{lineStyle:{color:"white"}},axisLabel:{color:"white",interval:0,rotate:0,fontFamily:"Microsoft YaHei"}},yAxis:{name:"%",type:"value",axisLine:{show:!0,lineStyle:{color:"white"}},axisLabel:{color:"white"},splitLine:{show:!1}},series:[{data:this.energyPartData_Y,type:"bar",barWidth:"50%",smooth:!0,itemStyle:{color:"#ffb700"},label:{show:!0,color:"#fff",position:"top",fontSize:"16",font:"Microsoft YaHei"}}]})},searchChartData4:function(){var t=this,e=[];this.JPH_Xlist=[],this.JPH_Ylist=[],this.JPH_Y1list=[];var a=this.CreateData("11","产量管理_JPH_查询",e);this.ExecDatabase(a).then((function(e){if(e.data.length>0){var a,n=Object(m["a"])(e.data);try{for(n.s();!(a=n.n()).done;){var r=a.value;t.JPH_Xlist.push(r.HH),t.JPH_Ylist.push(r.DataCountOK),t.JPH_Y1list.push(r.DataCountNG)}}catch(i){n.e(i)}finally{n.f()}t.drawDashboard4()}}))},drawDashboard4:function(){xr.setOption({title:{show:!0,left:"center",textStyle:{color:"#f79646"}},legend:{type:"plain",show:!0,textStyle:{color:"#fff"}},grid:[{top:"15%",left:"3%",right:"4%",bottom:"4%",containLabel:!0}],tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},xAxis:{name:"H",type:"category",data:this.JPH_Xlist,axisLine:{lineStyle:{color:"white"}},splitLine:{show:!1},axisLabel:{color:"white"}},yAxis:{name:"台",type:"value",axisLine:{show:!0,lineStyle:{color:"white"}},splitLine:{show:!1}},series:[{name:"合格台数",data:this.JPH_Ylist,type:"bar",itemStyle:{color:"#198800"},label:{show:!0,color:"#fff",position:"top"}},{name:"不合格台数",data:this.JPH_Y1list,type:"bar",itemStyle:{color:"#ffb700"},label:{show:!0,color:"#fff",position:"top"}}]})},searchChartData44:function(){var t=this;this.deviceStatus_table=[];var e=[],a=this.CreateData("11","设备管理_设备每分钟状态_查询",e);this.ExecDatabase(a).then((function(e){t.deviceStatus_table=e.data})).then((function(){t.drawDashboard44()}))},drawDashboard44:function(){var t=[],e=[],a=0;if(1===this.deviceStatus_table.length)t.push({itemStyle:{normal:{color:this.deviceStatus_table[0].颜色}},name:this.deviceStatus_table[0].设备状态名称,value:[0,this.deviceStatus_table[0].开始时间,this.deviceStatus_table[0].结束时间]});else for(var n=0;n<this.deviceStatus_table.length;n++)n<this.deviceStatus_table.length&&(0===n?(a=0,e.push(this.deviceStatus_table[n].工位号)):this.deviceStatus_table[n].工位号!==this.deviceStatus_table[n-1].工位号&&(a++,e.push(this.deviceStatus_table[n].工位号))),t.push({itemStyle:{normal:{color:this.deviceStatus_table[n].颜色}},name:this.deviceStatus_table[n].设备状态名称,value:[parseInt(a),this.deviceStatus_table[n].开始时间,this.deviceStatus_table[n].结束时间]});wr.clear(),wr.setOption({color:this.deviceStatus_colors,tooltip:{formatter:function(t){return t.value[1].substr(11,5)+"~"+t.value[2].substr(11,5)}},grid:{left:"10px",right:"4%",top:"10%",bottom:"9%",containLabel:!0},legend:{selectedMode:!1,left:"0",textStyle:{color:"#ffffff"}},xAxis:{type:"time",axisLine:{lineStyle:{color:"#ffffff"},show:!0},axisTick:{show:!0},interval:72e5,axisLabel:{formatter:function(t){var e=new Date(t);return a(e.getHours())+":"+a(e.getMinutes());function a(t){return parseInt(t)<10&&(t="0"+t),t}}}},yAxis:{axisLine:{lineStyle:{color:"#ffffff"}},data:e},series:[{name:this.deviceStatus_state[0],type:"bar",data:[]},{name:this.deviceStatus_state[1],type:"bar",data:[]},{name:this.deviceStatus_state[2],type:"bar",data:[]},{name:this.deviceStatus_state[3],type:"bar",data:[]},{type:"custom",renderItem:function(t,e){var a=e.value(0),n=e.coord([e.value(1),a]),r=e.coord([e.value(2),a]),i=18;return{type:"rect",shape:sr["graphic"].clipRectByRect({x:n[0],y:n[1]-i,width:r[0]-n[0],height:1.2*i},{x:t.coordSys.x,y:t.coordSys.y,width:t.coordSys.width,height:t.coordSys.height}),style:e.style()}},encode:{x:[1,2],y:0},data:t}]})},searchChartData444:function(){var t=this;this.myChart4Alarm1=[];var e=[],a=this.CreateData("11","设备管理_设备报警_查询",e);this.ExecDatabase(a).then((function(e){t.myChart4Alarm1=e.data})).then((function(){t.drawDashboard444()}))},drawDashboard444:function(){Sr.setOption({tooltip:{trigger:"item"},legend:{type:"plain",show:!0,textStyle:{color:"#fff",fontSize:"10px"}},series:[{name:"机床报警计数统计",type:"pie",radius:"65%",label:{color:"white"},labelLine:{normal:{length:4,length2:8}},data:this.myChart4Alarm1}]})},searchDevicePartType:function(){var t=this,e=[],a=this.CreateData("11","基础数据_产品型号_机床当前_查询",e);this.ExecDatabase(a).then((function(e){e.data.length>0&&(t.productionType=e.data[0]["产品型号"])}))},searchChartData5Range:function(){var t=this,e=[],a=this.CreateData("11","AA_顶面清洗压力_折线图Range_查询",e);this.ExecDatabase(a).then((function(e){e.data.length>0&&(t.myChart41min=e.data[0]["minValue"],t.myChart41max=e.data[0]["maxValue"]),t.searchChartData5()}))},searchChartData5:function(){var t=this,e=[];this.myChart4X1=[],this.myChart4Y1=[];var a=this.CreateData("11","AA_顶面清洗压力_折线图_查询",e);this.ExecDatabase(a).then((function(e){if(e.data.length>0)for(var a=0;a<e.data.length;a++)t.myChart4X1.push(e.data[a]["采集时间"]),t.myChart4Y1.push(e.data[a].Value);t.drawDashboard5()}))},drawDashboard5:function(){},searchChartData7Range:function(){var t=this,e=[],a=this.CreateData("11","AA_高压油道盲孔去毛刺压力_折线图Range_查询",e);this.ExecDatabase(a).then((function(e){e.data.length>0&&(t.myChart7min=e.data[0]["minValue"],t.myChart7max=e.data[0]["maxValue"]),t.searchChartData7()}))},searchChartData7:function(){var t=this,e=[];this.myChart7X=[],this.myChart7Y=[];var a=this.CreateData("11","AA_高压油道盲孔去毛刺压力_折线图_查询",e);this.ExecDatabase(a).then((function(e){if(e.data.length>0)for(var a=0;a<e.data.length;a++)t.myChart7X.push(e.data[a]["采集时间"]),t.myChart7Y.push(e.data[a].Value);t.drawDashboard7()}))},drawDashboard7:function(){},searchChartData11Range:function(){var t=this,e=[],a=this.CreateData("11","AA_高压油道通孔去毛刺压力_折线图Range_查询",e);this.ExecDatabase(a).then((function(e){e.data.length>0&&(t.myChart11min=e.data[0]["minValue"],t.myChart11max=e.data[0]["maxValue"]),t.searchChartData11()}))},searchChartData11:function(){var t=this,e=[];this.myChart11X=[],this.myChart11Y=[];var a=this.CreateData("11","AA_高压油道通孔去毛刺压力_折线图_查询",e);this.ExecDatabase(a).then((function(e){if(e.data.length>0)for(var a=0;a<e.data.length;a++)t.myChart11X.push(e.data[a]["采集时间"]),t.myChart11Y.push(e.data[a].Value);t.drawDashboard11()}))},drawDashboard11:function(){},drawDashboard9:function(){},searchChartDataParams:function(){var t=this,e=[],a=this.CreateData("11","AB文字展示信息查询_查询",e);this.ExecDatabase(a).then((function(e){e.data.length>0&&(t.otherParams[0]=e.data[0]["paramsValue1"],t.otherParams[1]=e.data[0]["paramsValue2"],t.otherParams[2]=e.data[0]["paramsValue3"],t.otherParams[3]=e.data[0]["paramsValue4"],t.otherParams[4]=e.data[0]["paramsValue5"],t.otherParams[5]=e.data[0]["paramsValue6"],t.otherParams[6]=e.data[0]["paramsValue7"],t.otherParams[7]=e.data[0]["paramsValue8"])}))},searchChartDataParams1:function(){var t=this,e=[],a=this.CreateData("11","定量_查询",e);this.ExecDatabase(a).then((function(e){e.data.length>0&&(t.planData[0]=e.data[0]["paramsValue1"],t.planData[1]=e.data[0]["paramsValue2"],t.planData[2]=e.data[0]["paramsValue3"],t.planData[3]=e.data[0]["paramsValue4"],t.planData[4]=e.data[0]["paramsValue5"],t.planData[5]=e.data[0]["paramsValue6"],t.planData[6]=e.data[0]["paramsValue7"],t.planData[7]=e.data[0]["paramsValue8"])}))},changeCameraState:function(t){this.isShow1!==t&&(this.isShow=t?"inline":"none",this.isShow1=t)},restView:function(){window.editor.cameraControls.resetState(window.editor.cameraState.target,window.editor.cameraState.position,window.editor.cameraState.zoom0)},callOff1:function(){this.dialogFormVisible1=!1},getLogo:function(){var t=this;O.a.get("../../logo.png",{responseType:"arraybuffer"}).then((function(e){t.titlePng="data:image/jpeg;base64,"+btoa(new Uint8Array(e.data).reduce((function(t,e){return t+String.fromCharCode(e)}),""))})),O.a.get("../../MESlogo.png",{responseType:"arraybuffer"}).then((function(e){t.titlePng1="data:image/jpeg;base64,"+btoa(new Uint8Array(e.data).reduce((function(t,e){return t+String.fromCharCode(e)}),""))})),O.a.get("../../logo1.png",{responseType:"arraybuffer"}).then((function(e){t.titlePng2="data:image/jpeg;base64,"+btoa(new Uint8Array(e.data).reduce((function(t,e){return t+String.fromCharCode(e)}),""))}))}}},Tr=_r,Cr=(a("d44d"),a("3127"),Object(o["a"])(Tr,nr,rr,!1,null,"a1488520",null));Cr.options.__file="index.vue";var Ar=Cr.exports;n["default"].use(M["a"]);var Or=[{path:"/",name:"index",component:Ar,meta:{keepAlive:!0}},{path:"/DT",name:"DT",component:ar,meta:{keepAlive:!0}}],Br=new M["a"]({scrollBehavior:function(){return{y:0}},routes:Or}),Dr={state:{routers:Or,addRouters:[]},mutations:{SET_ROUTERS:function(t,e){t.addRouters=e,t.routers=Or.concat(e)}},actions:{GenerateRoutes:function(t,e){var a=t.commit;return new Promise((function(t){var n=e;a("SET_ROUTERS",n),t()}))}}},Mr=Dr,Pr={sidebar:function(t){return t.app.sidebar},device:function(t){return t.app.device},token:function(t){return t.user.token},avatar:function(t){return t.user.avatar},name:function(t){return t.user.name},roles:function(t){return t.user.roles},visitedViews:function(t){return t.tagsView.visitedViews},cachedViews:function(t){return t.tagsView.cachedViews},permission_routers:function(t){return t.permission.routers},addRouters:function(t){return t.permission.addRouters},id:function(t){return t.user.id},account:function(t){return t.user.account}},Ir=Pr;n["default"].use(d["a"]);var kr=new d["a"].Store({modules:{app:v,user:D,tagsView:b,permission:Mr},getters:Ir}),jr=kr;a("2b3d"),a("9861"),a("841c");function Lr(t){var e=Object(L["a"])(t),a={"[object Array]":"array","[object Object]":"object","[object String]":"string - object","[object Number]":"Number - object","[object Boolean]":"Boolean - object"};if(null===t)return"null";if("object"===e){var n=Object.prototype.toString.call(t);return a[n]}return e}function Er(t){var e=[];function a(t,e){if(e=e.replace(/[{()}\-]/g,""),e=e.toLowerCase(),32!==e.length||-1!==e.search(/[^0-9,a-f]/i))n(t);else for(var a=0;a<e.length;a++)t.push(e[a])}function n(t){var e=32;while(e--)t.push("0")}function r(t,e){var a="";switch(e){case"N":return t.toString().replace(/,/g,"");case"D":return a=t.slice(0,8)+"-"+t.slice(8,12)+"-"+t.slice(12,16)+"-"+t.slice(16,20)+"-"+t.slice(20,32),a=a.replace(/,/g,""),a;case"B":return a=r(t,"D"),a="{"+a+"}",a;case"P":return a=r(t,"D"),a="("+a+")",a;default:return new Rr}}"string"===typeof t?a(e,t):n(e),this.Equals=function(t){return!(!t||!t.IsGuid)&&this.ToString()===t.ToString()},this.IsGuid=function(){},this.ToString=function(t){return r(e,"string"===typeof t&&("N"===t||"D"===t||"B"===t||"P"===t)?t:"D")}}function Rr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"D",e="",a=32;while(a--)e+=Math.floor(16*Math.random()).toString(16);return new Er(e).ToString(t)}Er.Empty=new Er;var Vr={install:function(t){t.prototype.exportExcel_NPOI=function(t,e){Fr("".concat(pr,"?param=").concat(t),e)},t.prototype.CreateData=function(t,e,a,n,r){var i=this,o="",s=[];if("7"===t)a.map((function(t){n.map((function(e){var a=e.toString();t[a]||i.$set(t,a,"")}))})),o=a;else if(void 0!==a){for(var c=0;c<a.length;c++)s.push({name:a[c][0],value:a[c][1],type:a[c][2],output:a[c][3]});o=JSON.stringify(s)}var l=[];return l[0]={},l[0].type=t,l[0].name=e,l[0].param=o,l[0].pageSize=n,l[0].pageList=r,l[0].pageList=r,l[0].UserID=this.id,l[0].ModularID=this.$router.currentRoute.path,JSON.stringify(l[0])},t.prototype.CreateData1=function(t,e,a,n,r){var i="",o=[];if(void 0!==a){for(var s=0;s<a.length;s++)o.push({name:a[s][0],value:a[s][1],type:a[s][2],output:a[s][3]});i=JSON.stringify(o)}var c=[];c[0]={},c[0].type=t,c[0].name=e,c[0].param=i,c[0].pageSize=n,c[0].pageList=r;var l=JSON.stringify(c[0]);return l},t.prototype.CreatePost=function(t){var e="",a=[];if(void 0!==t){for(var n=0;n<t.length;n++)a.push({name:t[n][0],value:t[n][1]});e=JSON.stringify(a)}var r=[];r[0]={},r[0].param=e;var i=JSON.stringify(r[0]);return i},t.prototype.addForm=function(t,e){if("string"===Lr(t)){if(this.$refs[t]&&this.$refs[t].resetFields(),"array"===Lr(e)){if(e&&0!==e.length)for(var a=0,n=e.length;a<n;a++)"function"===typeof e[a]?e[a]():e[a]}else"function"===Lr(e)&&e.call(this);this[t]=Object.assign(this.$data[t],this.$options.data()[t])}else console.error("传入参数错误")},t.prototype.editForm=function(t,e,a){if("object"===Lr(t)&&"string"===Lr(e)){this.$refs[e]&&this.$refs[e].resetFields();var n=/^[0-9]+$/;for(var r in this[e])n.lastIndex=0,n.exec(t[r])?this[e][r]=parseInt(t[r]):this[e][r]=t[r];if("array"===Lr(a)){if(a&&0!==a.length)for(var i=0,o=a.length;i<o;i++)"function"===typeof a[i]?a[i]():a[i]}else"function"===Lr(a)&&a.call(this)}else console.error("传入参数错误")},t.prototype.getSelect=function(t,e,a,n){var r=this;"function"===Lr(t)&&"array"===Lr(e)&&"string"===Lr(a)?"array"===Lr(n)?t.apply(void 0,Object(p["a"])(n)).then((function(t){r[a]=[];for(var n=0,i=t.data.length;n<i;n++)2===e.length?r[a].push({label:t.data[n][e[0]],value:t.data[n][e[1]]}):r[a].push({value:t.data[n][e[0]]})})):t(n).then((function(t){r[a]=[];for(var n=0,i=t.data.length;n<i;n++)2===e.length?r[a].push({label:t.data[n][e[0]],value:t.data[n][e[1]]}):r[a].push({value:t.data[n][e[0]]})})):console.error("参数传递错误")},t.prototype.getData=function(t,e,a){var n=this;if("function"===Lr(t)&&"string"===Lr(e))if("undefined"===Lr(a))t(a).then((function(t){var a=t.data;n[e]=a}));else{var r=[];"array"!==Lr(a)?r.push(a):r=a,t.apply(void 0,Object(p["a"])(r)).then((function(t){var a=t.data;n[e]=a}))}else console.error("传入参数错误")},t.prototype.getTable=function(t,e,a){var n=this;t.apply(void 0,Object(p["a"])(e)).then((function(t){var e=t.data.rows;if(n[a[0]]=[],n[a[1]]=0,e&&e.length>0){for(var r=/^\d{4}([-\/.])\d{1,2}\1\d{1,2}/,i=0,o=e.length;i<o;i++)for(var s in e[i])r.lastIndex=0,r.test(e[i][s])&&(e[i][s]=e[i][s].split(" ")[0]);n[a[0]]=e,n[a[1]]=parseInt(t.data.total)}else n[a[0]]=[]})).then((function(){n[a[2]]=!1}))},t.prototype.addTable=function(t,e,a,n){var r=this;"function"===Lr(n)&&"function"===Lr(t)&&"string"===Lr(a)?(console.log(this.$refs[a]),this.$refs[a].validate((function(a){if(console.log(a),!a)return console.error("error submit!!"),!1;t.apply(void 0,Object(p["a"])(e)).then((function(t){"1"===t.data[0].result?(r.$message.success("增加成功"),n.call(r)):r.$message.error("增加失败")}))}))):console.error("参数传递错误")},t.prototype.editTable=function(t,e,a,n){var r=this;"function"===Lr(n)&&"function"===Lr(t)&&"string"===Lr(a)?this.$refs[a].validate((function(a){if(!a)return console.error("error submit!!"),!1;t.apply(void 0,Object(p["a"])(e)).then((function(t){"1"===t.data[0].result?(r.$message.success("修改成功"),n.call(r)):r.$message.error("修改失败")}))})):console.error("参数传递错误")},t.prototype.deleteRow=function(t,e,a){var n=this;"function"===Lr(a)&&"function"===Lr(t)?(this.tableData&&1===this.tableData.length&&this.pageCurrent>1&&this.pageCurrent--,this.$confirm("此操作将永久删除该行, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t(e).then((function(t){"1"===t.data[0].result?(n.$message.success("删除成功"),a.call(n)):n.$message.error("数据占用")}))})).catch((function(){n.$message({type:"info",message:"已取消删除"})}))):console.error("参数传递错误")}}};function Fr(t,e){Nr(t,(function(t,e){Hr(t,e)}),e)}function Nr(t,e,a){var n=new XMLHttpRequest,r=new FormData;r.append("base64",a),n.open("POST",t,!0),n.responseType="blob",n.onload=function(){if(200===n.status){var t=n.getResponseHeader("content-disposition").split("=")[1],a=decodeURIComponent(t);e(n.response,a)}},n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.send(r)}function Hr(t,e){if(window.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(t,e);else{var a=document.createElement("a"),n=document.querySelector("body");a.href=window.URL.createObjectURL(t),a.download=e,a.style.display="none",n.appendChild(a),a.click(),n.removeChild(a),window.URL.revokeObjectURL(a.href)}}var Wr=a("98c9"),zr=a("ec7e"),Ur=a.n(zr),qr=a("a939"),Zr=a.n(qr),Yr={bind:function(t,e){var a=t.querySelector(".el-dialog__header"),n=t.querySelector(".el-dialog");a.style="cursor:move;";var r=n.currentStyle||window.getComputedStyle(n,null);a.onmousedown=function(t){var e,i,o=t.clientX-a.offsetLeft,s=t.clientY-a.offsetTop;r.left.includes("%")?(e=+document.body.clientWidth*(+r.left.replace(/\%/g,"")/100),i=+document.body.clientHeight*(+r.top.replace(/\%/g,"")/100)):(e=+r.left.replace(/\px/g,""),i=+r.top.replace(/\px/g,"")),document.onmousemove=function(t){var a=t.clientX-o,r=t.clientY-s;n.style.left="".concat(a+e,"px"),n.style.top="".concat(r+i,"px")},document.onmouseup=function(t){document.onmousemove=null,document.onmouseup=null}}}},Jr=function(t){t.directive("el-drag-dialog",Yr)};window.Vue&&(window["el-drag-dialog"]=Yr,Vue.use(Jr)),Yr.install=Jr;var Gr=Yr;n["default"].use(Gr),C.a.Dialog.props.closeOnClickModal.default=!1,n["default"].prototype.Guid=Rr,n["default"].prototype.ExecDatabase=function(t){return vr({url:"",method:"post",data:t})},n["default"].use(Zr.a),n["default"].use(Wr["a"]),n["default"].use(Vr),n["default"].use(Ur.a),n["default"].use(C.a),n["default"].prototype.echarts=sr,n["default"].prototype.mqtt=wt.a,n["default"].config.productionTip=!0,n["default"].directive("loadmore",{bind:function(t,e){var a=0,n=0,r=!0,i=t.querySelector(".el-table__body-wrapper");i.addEventListener("scroll",(function(){a=this.scrollTop,r=n<a,n=a;var t=10,i=this.scrollHeight-this.scrollTop-this.clientHeight;i<=t&&r&&e.value()}))}}),new n["default"]({store:jr,router:Br,render:function(t){return t(l)}}).$mount("#app")},6:function(t,e){},7:function(t,e){},8:function(t,e){},"8bc3":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjJJREFUWEfNV9txwkAMlDoJfWQmMCkkoZJAJSGVBCqBVKKwN1pG97B9xGTAPxj7TlrtrR5WufOld/YvjwnAzN5F5EVEnm7E0ElEDqq6K+1VDJjZt4gsb+S4NLNT1XV8mAHwyD99AVBPMdCzBubiunVkogQA56D/pKoLMwOAY0AMQ6ARdO79vajqye/ffH8EvvD9sA1m96q6os0SAOlvAdio6jbSZ2YfYCnSambPIvJ6XrfxtSsHS9tdACJtiBq0IWKwke6xoAQQGGPUcIorMtINgCAQAUDQ4ZIUMlvIgAsY7CWhOSCA+DOARB9pDwYTKPwnOHd4hHaKYyp11M0AxPZ1FiGEtY2OxlKUoIIof7ymQNy4ugEwEiobOZyJsATimjg45VB9Em6RTV0AsoLhBnD2VSULZ53qB/Th2oAW4vFdlQVVyrVoNzPkNUo2Ui6LbICdat1QHciq1YDzsmRngm0AgAbAUtcR9BqLfqb2gC2A7gKQ8n7kavWI3j1dACb8z3o9CwCbERhgXhMNMgTv8Xysi84DMNAlkX5J0OdaYBP8zAIA2ylDzIytG89S3SieDeGYDaDVqhfeG6aiv6oUjzEZe3ysfpymxvZ2M8CBgr/RKFlIQvQjwazQEh/2oz8AHN53Abgs8iGkZRhjFYCgLbPKVZEHcVIzWZ8ZGkrH0o1O0Gg44XLea1HP9MxGNC5sjeWY81q0z6o+vrlqWM0vo3/6MMFxVfPEY36a3YLrXht3Z+AXnS92MOaIk0IAAAAASUVORK5CYII="},a817:function(t,e,a){},ab1d:function(t,e,a){},bccc:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAmJJREFUWEfNl41NAzEMhZ1NYBLoJMAk0EmASSiTAJOYfpEd+dyEXNWTSiQkLj/Oy/PzT4tceZQr3y//E4Cq3ojIs4jcb8DQ99HOQUTeSyn8vxgnDKjqo4i8bnBxz8RTKeUtLiwAqCov/jDEoOUbNvLAyKft8/U7EQH8aD/z2LuNTGQAX2ZgV0o5qCpMYJQBjXvmHY25SqJBe0R033cp5ZYzqqpHe+2buQbAjAGA8SIiP8EVlTr2pMsAiMF9pMhsPQRGdvYwd21jIQJw+jPdzgZM8DK+q5iMoQUAVeURMAVgP5PdUm1mBnoAXuLrzPibz2UAR4oB+OiUG0jmYDSOVQAOpRSoa8MuAFRlruMSfHyi9KQljq4CgHCgDopb/CKyKMQEEBbbftOC0090+ZgCqEpVVQ5h9Iko6CWSDkNExd7ZsnO7xMIUQPO9hRXqrcLKCnVXeMTgNteCuaOKLSW4KYC2oXdherVnzkV853Mhyc014CL76/LgHt92Ir4OCER6OYCUtPyeRYoduGodgKP6u74ORj2vx3vw9Um1S0A8rU81MHP9peubASA8eTVR0quCI6CbACAlA8BrgtO7hp1NANQSa4PXx0w3A3ExAM+UFBrPfN5LzC6fh6FZQNWjntD7AwD8hNI7auWwBUuuky4DLHpD4j1A71Wxw2nCo05Yuc5ijPurvZjoRi1ZrQXWQmVKfS22a1WQoQDlM64XAPRbMlPzqCuKBr25yE3GaD6DWdSZXlteu5oz43qN8Niz6LCqgAc5GyZos0dt+doL2Uei4o8fJq2jdgP/86fZOc+7dO/VGfgFviiAMDxv3mQAAAAASUVORK5CYII="},c0d8:function(t,e,a){"use strict";var n=a("ff1e"),r=a.n(n);r.a},cc5b:function(t,e,a){"use strict";var n=a("a817"),r=a.n(n);r.a},d44d:function(t,e,a){"use strict";var n=a("3a6c"),r=a.n(n);r.a},d499:function(t,e,a){"use strict";var n=a("ab1d"),r=a.n(n);r.a},ff1e:function(t,e,a){}});
//# sourceMappingURL=app.2e897c39.js.map