(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-716c37d6","chunk-6a902a00","chunk-7dac8dce"],{"0007":function(e,t,r){"use strict";var i=r("7a23"),n=r("313e");const a=["id"];var o={__name:"moreLineEcharts",props:{echartsId:{type:String,default:"morelineId"},data:{type:Object,default:{color:[],list:[],xData:[],labelColor:"#000",rotate:0,interval:0,isVertical:!1}}},setup(e){const t=e;function r(e){let t=e.color,r=e.list,i=r.map((e,r)=>({type:"line",name:e.label,data:e.val,itemStyle:{normal:{color:t[r]}},smooth:!0,showSymbol:!1,areaStyle:{normal:{color:new n["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(199, 237, 250,0.5)"},{offset:1,color:"rgba(199, 237, 250,0.2)"}],!1)}}}));o(i)}function o(e){var r=n["b"](document.getElementById(t.echartsId)),i={grid:{top:"20%",right:"6%",left:"2%",bottom:"3%",containLabel:!0},legend:{data:t.data.list.map(e=>e.label),textStyle:{color:t.data.labelColor||"#fff"},icon:"diamond",itemWidth:16,itemHeight:8,itemGap:5},tooltip:{trigger:"axis",axisPointer:{lineStyle:{color:"#ddd"}},backgroundColor:"rgba(255,255,255,1)",padding:[5,10],textStyle:{color:"#7588E4"},extraCssText:"box-shadow: 0 0 5px rgba(0,0,0,0.3)"},xAxis:{type:"category",data:t.data.xData,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{show:!0,color:t.data.labelColor||"#fff",interval:t.data.interval||0,rotate:t.data.rotate||0,formatter:function(e){return t.data.isVertical?e.split("").join("\n"):e}}},yAxis:{type:"value",splitLine:{show:!0,lineStyle:{type:"dashed",color:"rgba(14,95,255,0.5)"}},axisTick:{show:!1},axisLine:{show:!1},axisLabel:{color:t.data.labelColor||"#fff"}},series:e};i&&r.setOption(i),window.addEventListener("resize",(function(){r.resize()}))}return Object(i["watch"])(()=>t.data,e=>{Object(i["nextTick"])(()=>{r(e)})},{immediate:!0,deep:!0}),(t,r)=>(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{style:{height:"100%",width:"100%"},id:e.echartsId},null,8,a))}};const s=o;t["a"]=s},"08c4":function(e,t,r){"use strict";r("6b08")},"0947":function(e,t,r){"use strict";r("bf66")},"0bb9":function(e,t){e.exports="data:image/png;base64,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"},1090:function(e,t,r){"use strict";var i=r("7a23"),n={__name:"Pages",props:{pageSizeArr:{type:Array,default:()=>[10,20,50,100]},background:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},small:{type:Boolean,default:!1},marginTop:{type:Number,default:10},tableHeight:{type:Number},pageConfiger:{type:Object,default:()=>({pageSize:10,currentPage:1,total:0})}},emits:["changeSize","changeNo"],setup(e,{emit:t}){const r=e,n=Object(i["reactive"])({configer:{}}),a=e=>{t("changeSize",e)},o=e=>{t("changeNo",e)};return Object(i["watchEffect"])(()=>{n.configer=r.pageConfiger}),(t,r)=>{const s=Object(i["resolveComponent"])("el-pagination");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:"fenye",style:Object(i["normalizeStyle"])({top:e.tableHeight+10+"px"})},[Object(i["createVNode"])(s,{"current-page":n.configer.currentPage||n.configer.pageNo||n.configer.current||n.configer.pageCurrent||n.configer.pageNum,"page-size":n.configer.pageSize||n.configer.size,"page-sizes":e.pageSizeArr,small:e.small,disabled:e.disabled,background:e.background,layout:"total, sizes, prev, pager, next, jumper",total:n.configer.total,onSizeChange:a,onCurrentChange:o},null,8,["current-page","page-size","page-sizes","small","disabled","background","total"])],4)}}};const a=n;t["a"]=a},"14c9":function(e,t){e.exports="data:image/png;base64,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"},"157b":function(e,t,r){e.exports=r.p+"static/img/xljmtc.48874023.png"},"1d22":function(e,t,r){"use strict";var i=r("7a23"),n=r("7902"),a={__name:"FormMessage",props:{formList:{default:[],type:Array},rules:{default:{},type:Object},labelWidth:{default:"140px",type:String},modelValue:{type:Object,default:{}},inline:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{expose:t,emit:r}){const a=e,o=Object(i["ref"])(),s=Object(i["ref"])({}),l=e=>{o.value.validate(t=>{if(!t)return!1;e(s.value)})},c=(e,t)=>{t&&(s.value[t]=e?e.orgName:"")},u=()=>{o.value.resetFields()};let h=!1;return Object(i["watch"])(()=>s.value,e=>{e&&!h&&r("update:modelValue",e)},{deep:!0}),Object(i["watch"])(()=>a.modelValue,e=>{e&&Object.keys(e).length>0&&(h=!0,s.value={...e},setTimeout(()=>{h=!1},0))},{immediate:!0,deep:!0}),t({submit:l,reset:u}),(e,t)=>{const r=Object(i["resolveComponent"])("el-input"),l=Object(i["resolveComponent"])("el-input-number"),u=Object(i["resolveComponent"])("el-radio"),h=Object(i["resolveComponent"])("el-radio-group"),d=Object(i["resolveComponent"])("el-time-picker"),f=Object(i["resolveComponent"])("el-date-picker"),p=Object(i["resolveComponent"])("el-switch"),m=Object(i["resolveComponent"])("el-form-item"),g=Object(i["resolveComponent"])("el-form");return Object(i["openBlock"])(),Object(i["createBlock"])(g,{ref_key:"elform",ref:o,model:s.value,"label-width":a.labelWidth,rules:a.rules,inline:a.inline,"label-position":"right",disabled:a.disabled},{default:Object(i["withCtx"])(()=>[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(a.formList,(t,a)=>(Object(i["openBlock"])(),Object(i["createBlock"])(m,{style:Object(i["normalizeStyle"])(t.width&&{width:t.width}),prop:t.prop,label:t.label,"label-width":t.labelWidth,key:a},{default:Object(i["withCtx"])(()=>["input"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(n["h"],{key:0,width:"100%",clearable:"",modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,placeholder:"请输入"+t.label,disabled:t.disabled,readonly:t.readonly},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","readonly"])):"textarea"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(r,{key:1,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,type:"textarea",rows:3,placeholder:"请输入"+t.label,disabled:t.disabled},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"])):"inputNumber"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(r,{key:2,type:"number",modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,placeholder:"请输入"+t.label,disabled:t.disabled},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"])):"number"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(l,{key:3,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,style:{width:"100%"},min:t.min||0,max:t.max||1e3,disabled:t.disabled},null,8,["modelValue","onUpdate:modelValue","min","max","disabled"])):"select"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(n["k"],{key:4,filterable:"",multiple:t.multiple,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,dictEnum:t.options,width:"100%",clearable:"",placeholder:"请选择"+t.label,disabled:t.disabled},null,8,["multiple","modelValue","onUpdate:modelValue","dictEnum","placeholder","disabled"])):"department"===t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(n["c"],{key:5,style:{width:"100%"},clearable:"",isAll:t.isAll,onGetDepValue:e=>c(e,t.depMc),multiple:t.multiple,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,placeholder:s.value[t.depMc]?s.value[t.depMc]:"请选择"},null,8,["isAll","onGetDepValue","multiple","modelValue","onUpdate:modelValue","placeholder"])):"upload"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(n["n"],{key:6,width:"100%",modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,isImg:t.isImg,disabled:t.disabled},null,8,["modelValue","onUpdate:modelValue","isImg","disabled"])):"checkbox"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(n["a"],{key:7,width:"100%",clearable:"",modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,checkList:t.options,placeholder:"请选择"+t.label,disabled:t.disabled},null,8,["modelValue","onUpdate:modelValue","checkList","placeholder","disabled"])):"radio"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(h,{key:8,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,disabled:t.disabled},{default:Object(i["withCtx"])(()=>[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(t.options,e=>(Object(i["openBlock"])(),Object(i["createBlock"])(u,{key:e.value,label:e.value},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):"time"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(d,{key:9,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,placeholder:"选择时间",style:{width:"100%"},disabled:t.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):"date"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(f,{key:10,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,type:"date","value-format":"YYYY-MM-DD",placeholder:"请选择日期",style:{width:"100%"},disabled:t.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):"datetime"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(f,{key:11,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"请选择时间",style:{width:"100%"},disabled:t.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):"datetimerange"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(f,{key:12,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,type:"datetimerange",shortcuts:e.shortcuts,"range-separator":"To","value-format":"YYYY-MM-DD HH:mm:ss","start-placeholder":"选择开始时间","end-placeholder":"选择结束时间",style:{width:"100%"},disabled:t.disabled},null,8,["modelValue","onUpdate:modelValue","shortcuts","disabled"])):"daterange"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(f,{key:13,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,type:"daterange","range-separator":"To","value-format":"YYYY-MM-DD","start-placeholder":"选择开始日期","end-placeholder":"选择开始日期",style:{width:"100%"},disabled:t.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):"switch"==t.type?(Object(i["openBlock"])(),Object(i["createBlock"])(p,{key:14,modelValue:s.value[t.prop],"onUpdate:modelValue":e=>s.value[t.prop]=e,class:"ml-2",disabled:t.disabled,style:{"--el-switch-on-color":"#13ce66","--el-switch-off-color":"#ff4949"}},null,8,["modelValue","onUpdate:modelValue","disabled"])):"slot"===t.type?Object(i["renderSlot"])(e.$slots,t.prop,{key:15}):Object(i["createCommentVNode"])("",!0)]),_:2},1032,["style","prop","label","label-width"]))),128))]),_:3},8,["model","label-width","rules","inline","disabled"])}}};const o=a;t["a"]=o},"26b4":function(e,t,r){"use strict";r("cbd0")},"2ae1":function(e,t,r){},"2b3b":function(e,t,r){"use strict";r("d3a3")},"38ac":function(e,t,r){"use strict";r("6f4e")},3985:function(e,t,r){"use strict";r("44e2")},"3db9":function(e,t,r){"use strict";function i(e){var t=new XMLHttpRequest;t.open("get",e.url),t.responseType=e.responseType||"text",e.onprogress&&(t.onprogress=function(t){if(t.lengthComputable){var r=t.loaded/t.total;e.onprogress(r,t.loaded,t.total)}else e.onprogress(null)}),t.onload=function(r){t.status>=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}t["a"]={get:i}},4220:function(e,t,r){"use strict";r.d(t,"h",(function(){return o})),r.d(t,"d",(function(){return s})),r.d(t,"e",(function(){return l})),r.d(t,"g",(function(){return c})),r.d(t,"f",(function(){return u})),r.d(t,"c",(function(){return h})),r.d(t,"i",(function(){return d})),r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p})),r.d(t,"j",(function(){return m}));var i=r("b775");const n="/mosty-api/mosty-base",a="/mosty-api/mosty-gsxt",o=e=>Object(i["a"])({url:n+"/fzmsg/queryYdxxPageList",method:"POST",data:e}),s=e=>Object(i["a"])({url:n+"/fzmsg/queryWdxxDetail",method:"POST",data:e}),l=e=>Object(i["a"])({url:n+"/fzmsg/queryWdxxPageList ",method:"POST",data:e}),c=e=>Object(i["a"])({url:n+"/fzmsg/queryYdxxDetail",method:"POST",data:e}),u=e=>Object(i["a"])({url:n+"/fzmsg/queryXxTj",method:"POST",data:e}),h=e=>Object(i["a"])({url:n+"/fzmsg/qsXx",method:"post",data:e}),d=e=>Object(i["a"])({url:a+"/tbYjxx/sendFqzl",method:"post",data:e}),f=e=>Object(i["a"])({url:a+"/tbGsxtRqfjRy/sendFqzl",method:"post",data:e}),p=e=>Object(i["a"])({url:a+"/qbcj/sendFqzl",method:"post",data:e});function m(e){return Object(i["a"])({url:n+"/minio/file/uploadObj",method:"post",data:e})}},"44e2":function(e,t,r){},5119:function(e,t,r){"use strict";r("bd59")},"52c4":function(e,t,r){"use strict";r("5498")},5498:function(e,t,r){},"56bf":function(e,t,r){},5749:function(e,t,r){e.exports=r.p+"static/img/tjc.2254aa5c.png"},"5c85":function(e,t,r){"use strict";r("a093")},"5cfa":function(e,t,r){"use strict";r("d570")},"615e":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAoCAYAAAALz1FrAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABWZJREFUeNqsV3tQlFUUP7uwwPJQdkNcyBesDBZKqMhgVH8kzRg44ujYaJk5MoO9zGpqpBmZ/KOih9QfZROMj1ILLOnxB40y6TiBvGQMUCJwcVN57rJLwLIQC2znXL77zfftg10azsxv7vv87j3nfOfeT+F0OsFVFAoFK/dXQDAWmxA5iEcRSxELEUOI+4gaxC+Iy6ey4V9hjUw+/zQNFJ5Icn9VqLA4iDiMiAbfYkZ8iPgCMeFKovRAkIBFPaLITwKSRcL8OkTiySwnELgEuhBswOIiQsv7FgbrYL1uBzwSvQViwh8CdeACGJkYgB7bn9BiqoCG3jIYnxzh09eSCVHPZiS5LpqfmwsH9FjUCruCQGUw5CS8C0/FvQEqZYjXI4w6rPBT+xG4eu8rcIJTaj7yoUE0FxLQib7nBOFBD8Dh9KuQpX9nVgKSMJUW9qz+EvJSvsONBUnNd55bivvkJcQ6foJDqRUQH5kuKvpnzAzGwdZZydJid8G+NSekXaTvVWYuDDmi/xsRQx07V30Mm+Pflin4rfMcNPb9DPkZF9D+dugdMcrGNSHREKlmRoCTzS9ATfcZPtSLWEHHeZoTaNXLIHPFIXHxjZ7LYB3rhTZLFdgcJkamVcfA8aZMGcnuxLOQqd/D6jsSC1kwTE6zSCa9WWSubD758SW5UrtC13A7I+i3tyFJD6vHRuiBhyghJSpPRhgZEgsp0VulXVl0kg28lRydJVuwddXLormI4GBaMWtL/TPqsLj5Zw3qaey7ILqLSJbzVmx4kjwlNByApoESyXdUwkxT2v68bF6qbpus/WDEamlzGZFoqBYcEA5BAWrZ5C0Jr6GP9qNf+uBU6zY4svEWc3JpO7B6nCaJ+U2j1snWRaiiZHFBPrFRzTE9Bk7ntNvRjzWmg2Wsm9U7rX/AncEW2Xi8JhnGHTZZ38S0Xdq0E4mJatPOKVR2VzaZL16yIJGV5BcKBpKeYQPzzY9/FUFx83PybGm/I2uSuZpoQ9TqGKyCqNA4cbR75DYrz7QeYCV3/N3hZma+GdPoYW9SsYykw1olbd6ik1zjrbrub2WT6QPMiT8OutCUmZOY6kUyHsJHH6tlPqGsMGORSWjoKZOquUIn+QHxEWWU1oFK6BysBb1mI1t0e6gc9iUfgyeW74SLhvXMP97krdQ69tVXd50G6/h93j1J+lkWxgRZio1dPIwLMhow0kKZzSmCRB95SClcaJ517B4crV7LMrMgZZiFd3OSldhxExEy81Fmwyvrylmy9FeGJ0xQVJ8JXSM3xT0hHkYSI8vCaFsDFq/zUbqMPqnfBCa7wS8CMnFhTYaUAAR9RmmqJyIKkW942zB4DQp+T4LzbW9C/2iHm2K6oIxD16Gk6VkorM1w3dBpQZ/79YuSJ7xInmRew0xaafyMQRuyFBaHJUCoSoPXr5ldvza8hj3IFcSL0g4ZCbJPoH+2Y7WSEpt0jCJGEjXepAGxnfTInlhenkSLhDfVSvBfDMK9bvb5JBJOZBYuM7OfBLPOV3pbJUQcmc7hg8AhzPMaisrZViNRNRbv+SCh8erZJij9MMUHlOS8jFF/oS8F/pBQ/sn3Mpbvhzn9IiGht3qLS1+L0A/zRUJS4qM9LyTldF2IWWWmPe8kfUKm5g7v+98k9JclhYs0CmXzHDbnliDdxvE3LVS4Z1TPfA2mcEw4dgsMlO1lidQh/FnZ8U09PlcSOuFieifI3jYW6CcSmxnoWaMWwAQ3Q2QmJLP76xOtKwHL4e9DZfcNyMXykoc19IjWzeUk9HcbRg9L2UmsMHWpwGsKocizeBpwS/UuziZziD5BBAinp0VTAsYF2HiIu+r8T4ABAP8HFTMQDaZoAAAAAElFTkSuQmCC"},"620a":function(e,t,r){"use strict";(function(e){var i,n=r("3db9"),a={supportWebGL:function(){if(null==i)try{var e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)throw new Error}catch(r){i=!1}return i}};a.Int8Array="undefined"===typeof Int8Array?Array:Int8Array,a.Uint8Array="undefined"===typeof Uint8Array?Array:Uint8Array,a.Uint16Array="undefined"===typeof Uint16Array?Array:Uint16Array,a.Uint32Array="undefined"===typeof Uint32Array?Array:Uint32Array,a.Int16Array="undefined"===typeof Int16Array?Array:Int16Array,a.Float32Array="undefined"===typeof Float32Array?Array:Float32Array,a.Float64Array="undefined"===typeof Float64Array?Array:Float64Array;var o={};"undefined"!==typeof window?o=window:"undefined"!==typeof e&&(o=e),a.requestAnimationFrame=o.requestAnimationFrame||o.msRequestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},a.createCanvas=function(){return document.createElement("canvas")},a.createImage=function(){return new o.Image},a.request={get:n["a"].get},a.addEventListener=function(e,t,r,i){e.addEventListener(t,r,i)},a.removeEventListener=function(e,t,r){e.removeEventListener(t,r)},t["a"]=a}).call(this,r("c8ba"))},"6b08":function(e,t,r){},"6f4e":function(e,t,r){},"752b":function(e,t,r){},7729:function(e,t){e.exports="data:image/png;base64,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"},7995:function(e,t,r){"use strict";var i=r("7a23");const n={class:"dialog-footer"},a=Object(i["createTextVNode"])("取消"),o=Object(i["createTextVNode"])(" 确认 ");var s={__name:"information",props:{modelValue:{type:Boolean,required:!0},title:{type:String,default:"提示"},showFooter:{type:Boolean,default:!0}},emits:["update:modelValue","submit","close"],setup(e,{emit:t}){const r=()=>{t("update:modelValue",!1),t("close")},s=()=>{t("submit")};return(t,l)=>{const c=Object(i["resolveComponent"])("el-button"),u=Object(i["resolveComponent"])("el-dialog");return Object(i["openBlock"])(),Object(i["createBlock"])(u,{class:"dialog-container","model-value":e.modelValue,title:e.title,"before-close":r,"destroy-on-close":!0},Object(i["createSlots"])({default:Object(i["withCtx"])(()=>[Object(i["renderSlot"])(t.$slots,"default")]),_:2},[e.showFooter?{name:"footer",fn:Object(i["withCtx"])(()=>[Object(i["createElementVNode"])("div",n,[Object(i["createVNode"])(c,{onClick:r},{default:Object(i["withCtx"])(()=>[a]),_:1}),Object(i["createVNode"])(c,{type:"primary",onClick:s},{default:Object(i["withCtx"])(()=>[o]),_:1})])])}:void 0]),1032,["model-value","title"])}}},l=(r("5c85"),r("d959")),c=r.n(l);const u=c()(s,[["__scopeId","data-v-1fce1f50"]]);t["a"]=u},"92c1":function(e,t,r){e.exports=r.p+"static/img/car.78c4a90c.png"},"98ce":function(e,t,r){"use strict";r.r(t);var i=r("7a23"),n=r("b893"),a=r("b932"),o=r("c5cb"),s=r("ad28");const l=Object(i["createTextVNode"])("详情");var c={__name:"index",setup(e,{expose:t}){const r=Object(i["reactive"])({tableData:[],keyCount:0,tableConfiger:{rowHieght:61,showSelectType:"null",loading:!1},total:0,pageConfiger:{pageSize:20,pageCurrent:1},tableHeight:143,controlsWidth:52,tableColumn:[{label:"线索名称",prop:"xsMc",width:"70px",showOverflowTooltip:!0},{label:"涉及人数",prop:"sjrs",width:"70px",showOverflowTooltip:!0},{label:"线索内容",prop:"xsNr",width:"120px",showOverflowTooltip:!0},{label:"指向地点",prop:"zxdz",width:"70px",showOverflowTooltip:!0}]}),n=Object(i["ref"])({});Object(i["onMounted"])(()=>{c()});const a=e=>{n.value=e,c()};function c(){let e={...n.value};delete e.dateRange,r.pageConfiger.loading=!0,Object(o["c"])(e,"/mosty-gsxt/qbcj/getRdXs").then(e=>{r.tableData=e||[],r.pageConfiger.loading=!1}).catch(()=>{r.pageConfiger.loading=!1})}return t({init:a}),(e,t)=>{const n=Object(i["resolveComponent"])("el-link");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[(Object(i["openBlock"])(),Object(i["createBlock"])(s["a"],{tableData:r.tableData,tableColumn:r.tableColumn,tableHeight:r.tableHeight,key:r.keyCount,fixed:!1,tableConfiger:r.tableConfiger,controlsWidth:r.controlsWidth},{controls:Object(i["withCtx"])(({row:t})=>[Object(i["createVNode"])(n,{size:"small",type:"primary",onClick:r=>e.addEdit("detail",t)},{default:Object(i["withCtx"])(()=>[l]),_:2},1032,["onClick"])]),_:1},8,["tableData","tableColumn","tableHeight","tableConfiger","controlsWidth"]))])}}},u=(r("38ac"),r("d959")),h=r.n(u);const d=h()(c,[["__scopeId","data-v-43394445"]]);var f=d;const p={key:0},m=Object(i["createTextVNode"])("详情");var g={__name:"index",setup(e,{expose:t}){const r=Object(i["reactive"])({tableData:[],keyCount:0,tableConfiger:{rowHieght:61,showSelectType:"null",loading:!1},total:0,pageConfiger:{pageSize:20,pageCurrent:1},tableHeight:143,controlsWidth:52,tableColumn:[{label:"组织名称",prop:"qtMc",width:"70px",showOverflowTooltip:!0},{label:"涉及人数",prop:"sjrs",width:"70px",showSolt:!0,showOverflowTooltip:!0},{label:"标签",prop:"bqList",width:"50px",showSolt:!0,showOverflowTooltip:!0},{label:"线索数",prop:"xssl",width:"70px",showOverflowTooltip:!0},{label:"指令数",prop:"zlsl",width:"70px",showOverflowTooltip:!0}]}),n=Object(i["ref"])({});Object(i["onMounted"])(()=>{l()});const a=e=>{n.value=e,l()};function l(){let e={...n.value};delete e.dateRange,r.pageConfiger.loading=!0,Object(o["c"])(e,"/mosty-gsxt/tbGsxtZdqt/getRdzz").then(e=>{r.tableData=e||[],r.pageConfiger.loading=!1}).catch(()=>{r.pageConfiger.loading=!1})}return t({init:a}),(e,t)=>{const n=Object(i["resolveComponent"])("el-link");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[(Object(i["openBlock"])(),Object(i["createBlock"])(s["a"],{tableData:r.tableData,tableColumn:r.tableColumn,tableHeight:r.tableHeight,key:r.keyCount,fixed:!1,tableConfiger:r.tableConfiger,controlsWidth:r.controlsWidth},{sjrs:Object(i["withCtx"])(({row:e})=>[Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.zdryList?e.zdryList.length:0),1)]),bqList:Object(i["withCtx"])(({row:e})=>[e.bqList?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",p,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.bqList,(e,t)=>(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",{key:t},Object(i["toDisplayString"])(e.bqMc)+"、",1))),128))])):Object(i["createCommentVNode"])("",!0)]),controls:Object(i["withCtx"])(({row:t})=>[Object(i["createVNode"])(n,{size:"small",type:"primary",onClick:r=>e.addEdit("detail",t)},{default:Object(i["withCtx"])(()=>[m]),_:2},1032,["onClick"])]),_:1},8,["tableData","tableColumn","tableHeight","tableConfiger","controlsWidth"]))])}}};r("0947");const v=h()(g,[["__scopeId","data-v-283f7c3a"]]);var _=v;const y={class:"ww100 hh100"},x={key:0},b=Object(i["createTextVNode"])("; "),T=Object(i["createTextVNode"])("详情");var w={__name:"index",setup(e,{expose:t}){const r=Object(i["reactive"])({tableData:[],keyCount:0,tableConfiger:{rowHieght:61,showSelectType:"null",loading:!1},total:0,pageConfiger:{pageSize:20,pageCurrent:1},tableHeight:143,controlsWidth:52,tableColumn:[{label:"姓名",prop:"ryXm",width:"70px",showOverflowTooltip:!0},{label:"身份证",prop:"rySfzh",width:"70px",showOverflowTooltip:!0},{label:"标签",prop:"bqList",width:"50px",showSolt:!0,showOverflowTooltip:!0},{label:"线索数",prop:"xssl",width:"70px",showOverflowTooltip:!0},{label:"指令数",prop:"zlsl",width:"70px",showOverflowTooltip:!0}]}),n=Object(i["ref"])({});Object(i["onMounted"])(()=>{l()});const a=e=>{n.value=e,l()};function l(){let e={...n.value};delete e.dateRange,r.pageConfiger.loading=!0,Object(o["c"])(e,"/mosty-gsxt/tbGsxtZdry/getRdRy").then(e=>{r.tableData=e||[],r.pageConfiger.loading=!1}).catch(()=>{r.pageConfiger.loading=!1})}return t({init:a}),(e,t)=>{const n=Object(i["resolveComponent"])("el-link");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",y,[(Object(i["openBlock"])(),Object(i["createBlock"])(s["a"],{tableData:r.tableData,tableColumn:r.tableColumn,tableHeight:r.tableHeight,key:r.keyCount,fixed:!1,tableConfiger:r.tableConfiger,controlsWidth:r.controlsWidth},{bqList:Object(i["withCtx"])(({row:e})=>[e.bqList?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",x,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.bqList,e=>(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",{key:e},Object(i["toDisplayString"])(e.bqMc),1))),128)),b])):Object(i["createCommentVNode"])("",!0)]),controls:Object(i["withCtx"])(({row:t})=>[Object(i["createVNode"])(n,{size:"small",type:"primary",onClick:r=>e.addEdit("detail",t)},{default:Object(i["withCtx"])(()=>[T]),_:2},1032,["onClick"])]),_:1},8,["tableData","tableColumn","tableHeight","tableConfiger","controlsWidth"]))])}}};r("9c28");const S=h()(w,[["__scopeId","data-v-b07a6e6e"]]);var E=S;const A=Object(i["createTextVNode"])("详情");var C={__name:"index",setup(e,{expose:t}){const r=Object(i["reactive"])({tableData:[],keyCount:0,tableConfiger:{rowHieght:61,showSelectType:"null",loading:!1},total:0,pageConfiger:{pageSize:20,pageCurrent:1},tableHeight:143,controlsWidth:52,tableColumn:[{label:"号码类型",prop:"hmlx",width:"70px",showOverflowTooltip:!0},{label:"号码",prop:"hm",width:"120px",showOverflowTooltip:!0},{label:"线索数",prop:"glxss",width:"70px",showOverflowTooltip:!0},{label:"指令数",prop:"glzls",width:"70px",showOverflowTooltip:!0}]}),n=Object(i["ref"])({});Object(i["onMounted"])(()=>{l()});const a=e=>{n.value=e,l()};function l(){let e={...n.value};delete e.dateRange,r.pageConfiger.loading=!0,Object(o["c"])(e,"/mosty-gsxt/tbGsxtZdqt/getRdhm").then(e=>{r.tableData=e||[],r.pageConfiger.loading=!1}).catch(()=>{r.pageConfiger.loading=!1})}return t({init:a}),(e,t)=>{const n=Object(i["resolveComponent"])("el-link");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[(Object(i["openBlock"])(),Object(i["createBlock"])(s["a"],{tableData:r.tableData,tableColumn:r.tableColumn,tableHeight:r.tableHeight,key:r.keyCount,fixed:!1,tableConfiger:r.tableConfiger,controlsWidth:r.controlsWidth},{controls:Object(i["withCtx"])(({row:t})=>[Object(i["createVNode"])(n,{size:"small",type:"primary",onClick:r=>e.addEdit("detail",t)},{default:Object(i["withCtx"])(()=>[A]),_:2},1032,["onClick"])]),_:1},8,["tableData","tableColumn","tableHeight","tableConfiger","controlsWidth"]))])}}};r("f5c8");const O=h()(C,[["__scopeId","data-v-d2f576e8"]]);var M=O,D=r("e767");const L={class:"comom-cnt"};var N={__name:"index",setup(e,{expose:t}){const r=Object(i["ref"])(!1),a=Object(i["ref"])([]),s=Object(i["ref"])({});Object(i["onMounted"])(()=>{c()});const l=e=>{s.value=e,c()};function c(){let e={...s.value};delete e.dateRange,r.value=!0,Object(o["c"])(e,"/mosty-gsxt/tbGsxtZdqt/getSqflTj").then(e=>{r.value=!1;let t=e||[];a.value=t.map(e=>{let t=Object(n["d"])(),r=Object(n["a"])(t,.5);return{label:e.zdmc,value:e.dm,color:[t,r]}})}).catch(()=>{r.value=!1})}return t({init:l}),(e,t)=>{const n=Object(i["resolveDirective"])("loading");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",L,[Object(i["createVNode"])(D["a"],{echartsId:"zqflEcharts",color:"#333",data:a.value},null,8,["data"])])),[[n,r.value]])}}};r("cac2");const R=h()(N,[["__scopeId","data-v-1cf1d432"]]);var P=R;const I={class:"box-zl"};var B={__name:"index",setup(e,{expose:t}){const r=Object(i["ref"])([{label:"线索数量",num:0,type:"xs"},{label:"线索转指令数量",num:0,type:"zlxx"},{label:"关联群体数量",num:0,type:"zdqt"},{label:"关联人员数量",num:0,type:"zdry"}]),n=Object(i["ref"])(!1),a=Object(i["ref"])({});Object(i["onMounted"])(()=>{l()});const s=e=>{a.value=e,l()};function l(){let e={...a.value};delete e.dateRange,n.value=!0,Object(o["d"])(e,"/mosty-gsxt/qbcj/getXscjTjForZs").then(e=>{for(let t in e){let i=r.value.findIndex(e=>e.type==t);-1!=i&&(r.value[i].num=e[t])}n.value=!1}).catch(()=>{n.value=!1})}return t({init:s}),(e,t)=>{const a=Object(i["resolveDirective"])("loading");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("ul",I,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(r.value,(e,t)=>(Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{class:"items",key:t},[Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.num),1),Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.label),1)]))),128))])),[[a,n.value]])}}};r("26b4");const j=h()(B,[["__scopeId","data-v-7ffc6ca3"]]);var z=j,F=r("0007");const V={class:"comom-cnt"};var k={__name:"index",setup(e,{expose:t}){const r=Object(i["reactive"])({xData:[],color:["#0386FB","#00FFFF"],labelColor:"#333",list:[{label:"",val:[0,0,10,0,0,0,0]}]}),n=Object(i["ref"])(!1),a=Object(i["ref"])({});Object(i["onMounted"])(()=>{l()});const s=e=>{a.value=e,l()};function l(){let e={...a.value};delete e.dateRange,n.value=!0,Object(o["d"])(e,"/mosty-gsxt/qbcj/getXscjTjByXslx").then(e=>{n.value=!1;let t=e||[];r.xData=t.map(e=>e.zdmc),r.list[0].val=t.map(e=>e.count)}).catch(()=>{n.value=!1})}return t({init:s}),(e,t)=>{const a=Object(i["resolveDirective"])("loading");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",V,[Object(i["createVNode"])(F["a"],{echartsId:"qbsbEcharts111",data:r},null,8,["data"])])),[[a,n.value]])}}};r("a1ba");const U=h()(k,[["__scopeId","data-v-1113afdc"]]);var G=U,H=r("2d16");const W=e=>(Object(i["pushScopeId"])("data-v-4d577da3"),e=e(),Object(i["popScopeId"])(),e),X={class:"container"},q={class:"header flex just-between"},Z=W(()=>Object(i["createElementVNode"])("span",null,"情报研判分析",-1)),Y={class:"seachsBox"},K={class:"flex align-center"},Q=["onClick"],J={class:"contant"},$={class:"contant-left aside"},ee={class:"model"},te=W(()=>Object(i["createElementVNode"])("div",{class:"modelTitle"},"热点线索",-1)),re={class:"cnt"},ie={class:"model"},ne=W(()=>Object(i["createElementVNode"])("div",{class:"modelTitle"},"热点组织",-1)),ae={class:"cnt"},oe={class:"model"},se=W(()=>Object(i["createElementVNode"])("div",{class:"modelTitle"},"热点人员",-1)),le={class:"cnt"},ce={class:"model"},ue=W(()=>Object(i["createElementVNode"])("div",{class:"modelTitle"},"热点号码",-1)),he={class:"cnt"},de={class:"map"},fe=W(()=>Object(i["createElementVNode"])("ul",{class:"btns"},[Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("span",null,"热点集访单位")]),Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("span",null,"点位图")]),Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("span",null,"指令分布")])],-1)),pe={class:"contant-right aside"},me={class:"model"},ge=W(()=>Object(i["createElementVNode"])("div",{class:"modelTitle"},"诉求分类",-1)),ve={class:"cnt"},_e={class:"model"},ye=W(()=>Object(i["createElementVNode"])("div",{class:"modelTitle"},"重点线索分类",-1)),xe={class:"cnt"},be={class:"model"},Te=W(()=>Object(i["createElementVNode"])("div",{class:"modelTitle"},"指令次数",-1)),we={class:"cnt"};var Se={__name:"index",emits:["close"],setup(e,{emit:t}){const{proxy:r}=Object(i["getCurrentInstance"])(),{SGXTQTSQLX:o}=r.$dict("SGXTQTSQLX"),s=Object(i["ref"])({}),l=Object(i["ref"])(-1),c=Object(i["reactive"])([{label:"今天",value:"10"},{label:"本周",value:"20"},{label:"本月",value:"30"},{label:"本季度",value:"40"},{label:"本年",value:"50"}]),u=Object(i["reactive"])([{label:"所属部门",prop:"ssbmdm",placeholder:"请选择",showType:"department"},{label:"数据周期",prop:"sjzq",placeholder:"请选择",showType:"defaultSlot"},{label:"指向地点",prop:"zxdz",placeholder:"请输入",showType:"input"},{label:"诉求类型",prop:"qtsq",placeholder:"请选择",showType:"select",options:o}]),h=Object(i["ref"])(),d=Object(i["ref"])(),p=Object(i["ref"])(),m=Object(i["ref"])(),g=Object(i["ref"])(),v=Object(i["ref"])(),y=Object(i["ref"])(),x=e=>{switch(l.value=e,e){case 0:s.value.dateRange=Object(n["f"])("天");break;case 1:s.value.dateRange=Object(n["f"])("本周");break;case 2:s.value.dateRange=Object(n["f"])("本月");break;case 3:s.value.dateRange=Object(n["f"])("本季度");break;case 4:s.value.dateRange=Object(n["f"])("本年");break}s.value.hskssj=s.value.dateRange[0]+" 00:00:00",s.value.hsjssj=s.value.dateRange[1]+" 23:59:59"},b=e=>{l.value=-1,e&&(s.value.hskssj=e[0]+" 00:00:00",s.value.hsjssj=e[1]+" 23:59:59",e[0]==Object(n["f"])("天")[0]&&e[1]==Object(n["f"])("天")[1]&&(l.value=0),e[0]==Object(n["f"])("本周")[0]&&e[1]==Object(n["f"])("本月")[1]&&(l.value=1),e[0]==Object(n["f"])("本月")[0]&&e[1]==Object(n["f"])("本月")[1]&&(l.value=2),e[0]==Object(n["f"])("本季度")[0]&&e[1]==Object(n["f"])("本季度")[1]&&(l.value=3),e[0]==Object(n["f"])("本年")[0]&&e[1]==Object(n["f"])("本年")[1]&&(l.value=4))},T=e=>{s.value={...s.value,...e},S()},w=e=>{s.value={},l.value=-1,s.value.dateRange="",s.value.hskssj="",s.value.hsjssj="",S()},S=()=>{h.value.init(s.value),d.value.init(s.value),p.value.init(s.value),m.value.init(s.value),g.value.init(s.value),v.value.init(s.value),y.value.init(s.value)};function A(){t("close")}return(e,t)=>{const r=Object(i["resolveComponent"])("Close"),n=Object(i["resolveComponent"])("el-icon"),o=Object(i["resolveComponent"])("el-date-picker");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",X,[Object(i["createElementVNode"])("div",q,[Z,Object(i["createElementVNode"])("span",{class:"pointer",onClick:A},[Object(i["createVNode"])(n,null,{default:Object(i["withCtx"])(()=>[Object(i["createVNode"])(r)]),_:1})])]),Object(i["createElementVNode"])("div",Y,[Object(i["createVNode"])(H["a"],{searchArr:u,onSubmit:T,onReset:w},{defaultSlot:Object(i["withCtx"])(()=>[Object(i["createElementVNode"])("div",K,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(c,(e,t)=>(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",{class:Object(i["normalizeClass"])(["marks",l.value==t?"activeBtn":""]),onClick:e=>x(t),key:t},Object(i["toDisplayString"])(e.label),11,Q))),128)),Object(i["createVNode"])(o,{onChange:b,modelValue:s.value.dateRange,"onUpdate:modelValue":t[0]||(t[0]=e=>s.value.dateRange=e),type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD"},null,8,["modelValue"])])]),_:1},8,["searchArr"])]),Object(i["createElementVNode"])("div",J,[Object(i["createElementVNode"])("div",$,[Object(i["createElementVNode"])("div",ee,[te,Object(i["createElementVNode"])("div",re,[Object(i["createVNode"])(f,{ref_key:"RedRdxs",ref:h},null,512)])]),Object(i["createElementVNode"])("div",ie,[ne,Object(i["createElementVNode"])("div",ae,[Object(i["createVNode"])(_,{ref_key:"RedRdzz",ref:d},null,512)])]),Object(i["createElementVNode"])("div",oe,[se,Object(i["createElementVNode"])("div",le,[Object(i["createVNode"])(E,{ref_key:"RedRdry",ref:p},null,512)])]),Object(i["createElementVNode"])("div",ce,[ue,Object(i["createElementVNode"])("div",he,[Object(i["createVNode"])(M,{ref_key:"RedRdhm",ref:m},null,512)])])]),Object(i["createElementVNode"])("div",de,[Object(i["createVNode"])(a["a"]),fe]),Object(i["createElementVNode"])("div",pe,[Object(i["createElementVNode"])("div",me,[ge,Object(i["createElementVNode"])("div",ve,[Object(i["createVNode"])(P,{ref_key:"RedSqfl",ref:g},null,512)])]),Object(i["createElementVNode"])("div",_e,[ye,Object(i["createElementVNode"])("div",xe,[Object(i["createVNode"])(G,{ref_key:"RedZdxsfl",ref:y},null,512)])]),Object(i["createElementVNode"])("div",be,[Te,Object(i["createElementVNode"])("div",we,[Object(i["createVNode"])(z,{ref_key:"RedZlcs",ref:v},null,512)])])])])])}}};r("cb94");const Ee=h()(Se,[["__scopeId","data-v-4d577da3"]]);var Ae=Ee,Ce=r("2e9d"),Oe=r("1090"),Me=r("7902"),De=r("1d22");const Le=e=>(Object(i["pushScopeId"])("data-v-4df5353a"),e=e(),Object(i["popScopeId"])(),e),Ne={key:0,class:"dialog"},Re={class:"head_box"},Pe=Le(()=>Object(i["createElementVNode"])("span",{class:"title"},"人力情报信息采集流转详情",-1)),Ie=Object(i["createTextVNode"])("关闭"),Be={class:"form_cnt"},je={style:{width:"100%",height:"10px"},class:"mb20"},ze=Object(i["createTextVNode"])("基础信息"),Fe={style:{width:"100%",height:"10px"},class:"mb20"},Ve=Object(i["createTextVNode"])("线索内容"),ke={style:{width:"100%","padding-left":"50px"}},Ue=Le(()=>Object(i["createElementVNode"])("div",null,[Object(i["createTextVNode"])("上传附件:"),Object(i["createElementVNode"])("span",{class:"f12"},"(可附电子表格、Word文档、图像、音视频文件)")],-1)),Ge=Le(()=>Object(i["createElementVNode"])("span",{class:"mr20"},"相关人员",-1)),He={key:0};var We={__name:"addForm",props:{dic:Object},emits:["change"],setup(e,{expose:t,emit:r}){const n=e,{proxy:a}=Object(i["getCurrentInstance"])(),l=Object(i["ref"])(!1),c=Object(i["reactive"])({xsMc:[{required:!0,message:"请输入线索名称",trigger:"blur"}],xlLx:[{required:!0,message:"请选择线索类型",trigger:"change"}],qbLy:[{required:!0,message:"请选择情报来源",trigger:"change"}]}),u=Object(i["ref"])([{prop:"gapdive",type:"slot",width:"100%"},{label:"线索名称",prop:"xsMc",type:"input"},{label:"线索类型",prop:"xlLx",type:"select",options:n.dic.D_GS_XS_LX},{label:"情报来源",prop:"qbLy",type:"select",options:n.dic.D_GS_XS_LY},{label:"指向开始时间",prop:"zxkssj",type:"datetime"},{label:"指向结束时间",prop:"zxjssj",type:"datetime"},{label:"指向地点",prop:"zxdz",type:"input"},{label:"所属专题",prop:"sszt",type:"select",options:n.dic.D_BZ_SSZT},{prop:"gapline",type:"slot",width:"100%"},{prop:"scfj",type:"slot",width:"100%"},{label:"线索内容",prop:"xsNr",type:"textarea",width:"100%"},{label:"群体类型",prop:"qtlx",type:"select",options:n.dic.D_GS_XS_QTLX},{label:"群体名称",prop:"qtmc",type:"input"},{label:"涉及人数",prop:"sjrs",type:"inputNumber"},{label:"线索报送单位",prop:"ssbmdm",type:"department"}]),h=Object(i["ref"])(),d=Object(i["ref"])({}),f=Object(i["ref"])(!1),p=Object(i["ref"])(),m=Object(i["ref"])(""),g=Object(i["reactive"])({tableData:[],keyCount:0,tableConfiger:{rowHieght:61,showSelectType:"checkBox",loading:!1,haveControls:!1},controlsWidth:220,tableColumn:[{label:"姓名",prop:"xm"},{label:"性别",prop:"xb",showSolt:!0},{label:"身份证号",prop:"sfzh"},{label:"户籍地",prop:"hjdz"},{label:"户籍地派出所",prop:"hjdpcs"},{label:"标签",prop:"bqList",showSolt:!0}]});Object(i["onMounted"])(()=>{x()});const v=(e,t)=>{h.value=[],x(),l.value=!0,m.value="add"==e?"新增":"info"==e?"详情":"编辑",t&&_(t.id)},_=e=>{Object(o["c"])({id:e},"/mosty-gsxt/qbcj/selectByid").then(e=>{h.value=e.ossList||[],d.value=e,g.tableData=e.ryList||[]})},y=()=>{h.value=[],d.value={},l.value=!1,f.value=!1},x=()=>{g.tableHeight=window.innerHeight-720,window.onresize=function(){x()}};return t({init:v}),(e,t)=>{const r=Object(i["resolveComponent"])("el-button"),a=Object(i["resolveComponent"])("el-divider"),o=Object(i["resolveComponent"])("DictTag"),f=Object(i["resolveComponent"])("el-tag");return l.value?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ne,[Object(i["createElementVNode"])("div",Re,[Pe,Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{onClick:y},{default:Object(i["withCtx"])(()=>[Ie]),_:1})])]),Object(i["createElementVNode"])("div",Be,[Object(i["createVNode"])(De["a"],{disabled:"",modelValue:d.value,"onUpdate:modelValue":t[1]||(t[1]=e=>d.value=e),formList:u.value,ref_key:"elform",ref:p,rules:c},{gapdive:Object(i["withCtx"])(()=>[Object(i["createElementVNode"])("div",je,[Object(i["createVNode"])(a,{"content-position":"left"},{default:Object(i["withCtx"])(()=>[ze]),_:1})])]),gapline:Object(i["withCtx"])(()=>[Object(i["createElementVNode"])("div",Fe,[Object(i["createVNode"])(a,{"content-position":"left"},{default:Object(i["withCtx"])(()=>[Ve]),_:1})])]),scfj:Object(i["withCtx"])(()=>[Object(i["createElementVNode"])("div",ke,[Ue,Object(i["createVNode"])(Me["n"],{showBtn:!0,isAll:!0,isImg:!1,limit:10,modelValue:h.value,"onUpdate:modelValue":t[0]||(t[0]=e=>h.value=e)},null,8,["modelValue"])])]),_:1},8,["modelValue","formList","rules"]),Object(i["createVNode"])(a,{"content-position":"left"},{default:Object(i["withCtx"])(()=>[Ge]),_:1}),(Object(i["openBlock"])(),Object(i["createBlock"])(s["a"],{tableData:g.tableData,tableColumn:g.tableColumn,tableHeight:g.tableHeight,key:g.keyCount,tableConfiger:g.tableConfiger,controlsWidth:g.controlsWidth},{xb:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{value:e.xb,tag:!1,options:n.dic.D_BZ_XB},null,8,["value","options"])]),bqList:Object(i["withCtx"])(({row:e})=>[e.bqList?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",He,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.bqList,(e,t)=>(Object(i["openBlock"])(),Object(i["createBlock"])(f,{type:"success",key:t},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.bqMc),1)]),_:2},1024))),128))])):Object(i["createCommentVNode"])("",!0)]),_:1},8,["tableData","tableColumn","tableHeight","tableConfiger","controlsWidth"]))])])):Object(i["createCommentVNode"])("",!0)}}};r("52c4");const Xe=h()(We,[["__scopeId","data-v-4df5353a"]]);var qe=Xe,Ze=r("6605");const Ye=e=>(Object(i["pushScopeId"])("data-v-3bb037b8"),e=e(),Object(i["popScopeId"])(),e),Ke={key:0,class:"dialog"},Qe={class:"head_box"},Je=Ye(()=>Object(i["createElementVNode"])("span",{class:"title"},"转为指令",-1)),$e=Object(i["createTextVNode"])("保存"),et=Object(i["createTextVNode"])("关闭"),tt={class:"form_cnt"};var rt={__name:"zlForm",props:{dic:Object},emits:["updateDate"],setup(e,{expose:t,emit:r}){const n=e,a=Object(Ze["d"])(),{proxy:s}=Object(i["getCurrentInstance"])(),l=Object(i["ref"])(!1),c=Object(i["reactive"])({zlbt:[{required:!0,message:"请输入指令标题",trigger:"blur"}],zllx:[{required:!0,message:"请选择指令类型",trigger:"change"}],zldj:[{required:!0,message:"请选择指令等级",trigger:"change"}],jssj:[{required:!0,message:"请选择反馈结束时间",trigger:"change"}],zllxr:[{required:!0,message:"请输入联系人",trigger:"blur"}],zllxdh:[{required:!0,message:"请输入联系电话",trigger:"blur"}],zsdw:[{required:!0,message:"请选择主送单位",trigger:"change"}],csdw:[{required:!0,message:"请选择抄送单位",trigger:"change"}],zlnr:[{required:!0,message:"请输入指令内容",trigger:"blur"}]}),u=Object(i["ref"])([{label:"线索名称",prop:"glxs",type:"input",disabled:!0},{label:"指令标题",prop:"zlbt",type:"input"},{label:"指令类型",prop:"zllx",type:"select",options:n.dic.D_GS_XS_ZLLX},{label:"指令等级",prop:"zldj",type:"select",options:n.dic.D_GS_ZDQT_FXDJ},{label:"反馈结束时间",prop:"jssj",type:"datetime"},{label:"联系人",prop:"zllxr",type:"input"},{label:"联系电话",prop:"zllxdh",type:"input"},{label:"主送单位",prop:"zsdw",type:"department"},{label:"抄送单位",prop:"csdw",type:"department"},{label:"指令内容",prop:"zlnr",type:"textarea",width:"100%"},{label:"附件",prop:"fjzd",type:"upload",width:"100%"}]),h=Object(i["ref"])({}),d=Object(i["ref"])(!1),f=Object(i["ref"])();Object(i["onMounted"])(()=>{});const p=e=>{h.value.fjzd=null,l.value=!0,h.value.glxs=e.xsMc,h.value.glxsid=e.id},m=()=>{f.value.submit(e=>{let t={...e};t.fjzd=t.fjzd?t.fjzd.join(","):"",d.value=!0,Object(o["d"])(t,"/mosty-gsxt/zlxx/add").then(e=>{d.value=!1,s.$message({type:"success",message:"转发成功"}),a.push("/InstructionInformation")}).catch(()=>{d.value=!1})})},g=()=>{h.value={},l.value=!1,d.value=!1};return t({init:p}),(e,t)=>{const r=Object(i["resolveComponent"])("el-button");return l.value?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ke,[Object(i["createElementVNode"])("div",Qe,[Je,Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{type:"primary",size:"small",loading:d.value,onClick:m},{default:Object(i["withCtx"])(()=>[$e]),_:1},8,["loading"]),Object(i["createVNode"])(r,{size:"small",onClick:g},{default:Object(i["withCtx"])(()=>[et]),_:1})])]),Object(i["createElementVNode"])("div",tt,[Object(i["createVNode"])(De["a"],{modelValue:h.value,"onUpdate:modelValue":t[0]||(t[0]=e=>h.value=e),formList:u.value,ref_key:"elform",ref:f,rules:c},null,8,["modelValue","formList","rules"])])])):Object(i["createCommentVNode"])("",!0)}}};r("5119");const it=h()(rt,[["__scopeId","data-v-3bb037b8"]]);var nt=it;const at={style:{width:"100%"}};var ot={__name:"hbDetail",props:{modelValue:{type:Boolean,default:!1},dic:{type:Object,default:{}},id:{type:String,default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const r=e,n=Object(i["reactive"])({tableData:[],keyCount:0,tableConfiger:{rowHieght:61,showSelectType:"null",loading:!1,haveControls:!1},tableHeight:600,tableColumn:[{label:"线索编号",prop:"xsBh"},{label:"线索名称",prop:"xsMc"},{label:"线索来源",prop:"qbLy",showSolt:!0},{label:"开始时间",prop:"zxkssj"},{label:"截至时间",prop:"zxjssj"},{label:"指向地点",prop:"zxdz"},{label:"线索内容",prop:"xsNr"},{label:"群体类型",prop:"qtlx",showSolt:!0},{label:"群体名称",prop:"qtmc"},{label:"上报单位",prop:"ssbm"},{label:"上报时间",prop:"sxsbsj"},{label:"涉及人数",prop:"sjrs"},{label:"附件",prop:"fjdz",showSolt:!0},{label:"处置状态",prop:"czzt",showSolt:!0},{label:"状态",prop:"shzt",showSolt:!0}]}),a=()=>{n.tableConfiger.loading=!0,Object(o["c"])({hcxsid:r.id},"/mosty-gsxt/qbcj/getXshbXq").then(e=>{n.tableData=e||[],n.tableConfiger.loading=!1}).catch(()=>{n.tableConfiger.loading=!1})},l=()=>{n.tableData=[],t("update:modelValue",!1)};return Object(i["watch"])(()=>r.modelValue,e=>{e&&a()},{immediate:!0,deep:!0}),(t,a)=>{const o=Object(i["resolveComponent"])("DictTag"),c=Object(i["resolveComponent"])("el-dialog");return Object(i["openBlock"])(),Object(i["createBlock"])(c,{modelValue:e.modelValue,"onUpdate:modelValue":a[0]||(a[0]=e=>Object(i["isRef"])(modelValue)?modelValue.value=e:null),title:"合并详情",width:"1500px",onClose:l},{default:Object(i["withCtx"])(()=>[Object(i["createElementVNode"])("div",at,[(Object(i["openBlock"])(),Object(i["createBlock"])(s["a"],{tableData:n.tableData,tableColumn:n.tableColumn,tableHeight:n.tableHeight,key:n.keyCount,tableConfiger:n.tableConfiger,controlsWidth:n.controlsWidth},{xlLx:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.xlLx,options:r.dic.D_GS_XS_LX},null,8,["value","options"])]),qbLy:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.qbLy,options:r.dic.D_GS_XS_LY},null,8,["value","options"])]),czzt:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.czzt,options:r.dic.D_GS_XS_CZZT},null,8,["value","options"])]),shzt:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.shzt,options:r.dic.D_BZ_XSSHZT},null,8,["value","options"])]),qtlx:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.qtlx,options:r.dic.D_GS_XS_QTLX},null,8,["value","options"])]),_:1},8,["tableData","tableColumn","tableHeight","tableConfiger","controlsWidth"]))])]),_:1},8,["modelValue"])}}};const st=ot;var lt=st;const ct=e=>(Object(i["pushScopeId"])("data-v-44bf595e"),e=e(),Object(i["popScopeId"])(),e),ut={key:0,class:"dialog"},ht={class:"head_box"},dt=ct(()=>Object(i["createElementVNode"])("span",{class:"title"},"线索合并",-1)),ft=Object(i["createTextVNode"])("关闭"),pt={class:"form_cnt"},mt={class:"top hh48"},gt={class:"flex nowrap align-center"},vt=ct(()=>Object(i["createElementVNode"])("span",null,"所属部门:",-1)),_t={class:"ml20 mr10"},yt=Object(i["createTextVNode"])("数据周期:"),xt=Object(i["createTextVNode"])("查询"),bt=Object(i["createTextVNode"])("重置"),Tt=ct(()=>Object(i["createElementVNode"])("h3",null,"串并线索",-1)),wt=Object(i["createTextVNode"])("详情"),St={class:"flex just-end"},Et={class:"bottom hh48"},At=ct(()=>Object(i["createElementVNode"])("h3",null,"来源线索",-1)),Ct={class:"flex align-center mb10"},Ot=ct(()=>Object(i["createElementVNode"])("span",null,"线索标题:",-1)),Mt=Object(i["createTextVNode"])("查询"),Dt=Object(i["createTextVNode"])("自动合并"),Lt=Object(i["createTextVNode"])("手动合并");var Nt={__name:"hbForm",props:{dic:Object},emits:["change"],setup(e,{expose:t,emit:r}){const a=e,l=Object(i["ref"])(!1),c=Object(i["ref"])(""),u=Object(i["ref"])("本周"),h=Object(i["ref"])(["本周","本月","本季度","本年"]),{proxy:d}=Object(i["getCurrentInstance"])(),f=Object(i["ref"])(!1),p=Object(i["ref"])([]),m=Object(i["ref"])({times:Object(n["f"])("本周")}),g=Object(i["ref"])(""),v=Object(i["ref"])(!1),_=Object(i["reactive"])({tableData_hbh:[],tableData_hbq:[],keyCount:0,tableConfiger:{rowHieght:61,showSelectType:"checkBox",loading:!1,haveControls:!1},tableConfiger1:{rowHieght:61,showSelectType:"null",loading:!1},controlsWidth:100,tableColumn:[{label:"线索编号",prop:"xsBh"},{label:"线索名称",prop:"xsMc"},{label:"线索来源",prop:"qbLy",showSolt:!0},{label:"开始时间",prop:"zxkssj"},{label:"截至时间",prop:"zxjssj"},{label:"指向地点",prop:"zxdz"},{label:"线索内容",prop:"xsNr"},{label:"群体类型",prop:"qtlx",showSolt:!0},{label:"群体名称",prop:"qtmc"},{label:"上报单位",prop:"ssbm"},{label:"上报时间",prop:"sxsbsj"},{label:"涉及人数",prop:"sjrs"},{label:"附件",prop:"fjdz",showSolt:!0},{label:"处置状态",prop:"czzt",showSolt:!0},{label:"状态",prop:"shzt",showSolt:!0}]}),y=Object(i["reactive"])({pageCurrent:1,pageSize:10,total:0});Object(i["onMounted"])(()=>{R()});const x=()=>{f.value=!0,b(),A(),R()},b=()=>{Object(o["c"])({xsMc:g.value},"/mosty-gsxt/qbcj/getXshbFxcx").then(e=>{_.tableData_hbq=e||[]})},T=()=>{d.$confirm("是否确定要合并?","警告",{type:"warning"}).then(()=>{Object(o["d"])({xsMc:g.value},"/mosty-gsxt/qbcj/getXshbZdhb").then(e=>{d.$message({type:"success",message:"合并成功"}),b(),A()})})},w=()=>{if(p.value.length<2)return d.$message({type:"warning",message:"请先选择需要合并的数据,并且至少选择 2 条数据。"});d.$confirm("是否确定要合并?","警告",{type:"warning"}).then(()=>{Object(o["d"])(p.value,"/mosty-gsxt/qbcj/getXshbSdhb").then(e=>{d.$message({type:"success",message:"合并成功"}),b(),A()})})},S=()=>{u.value="本周",m.value={times:Object(n["f"])("本周")},y.pageCurrent=1,A()},E=()=>{y.pageCurrent=1,A()},A=()=>{let e={sfhb:1,...y,...m.value};e.times&&e.times.length>0&&(e.startTime=m.value.times[0],e.endTime=m.value.times[1]),delete e.times,_.tableConfiger.tableConfiger1=!0,Object(o["c"])(e,"/mosty-gsxt/qbcj/selectPage").then(e=>{console.log(e),_.tableConfiger.tableConfiger1=!1,_.tableData_hbh=e.records||[],y.total=e.total}).catch(()=>{_.tableConfiger.tableConfiger1=!1})},C=e=>{c.value=e.id,l.value=!0},O=e=>{y.pageCurrent=e,A()},M=e=>{y.pageSize=e,A()},D=e=>{switch(u.value=e,e){case"本周":m.value.times=Object(n["f"])("本周");break;case"本月":m.value.times=Object(n["f"])("本月");break;case"本季度":m.value.times=Object(n["f"])("本季度");break;case"本年":m.value.times=Object(n["f"])("本年");break}},L=e=>{Array.isArray(e)&&(p.value=e.map(e=>e.id))},N=()=>{u.value="本周",m.value={times:Object(n["f"])("本周")},g.value="",p.value=[],y.pageCurrent=1,f.value=!1,v.value=!1},R=()=>{_.tableHeight=window.innerHeight-660,_.tableHeight1=window.innerHeight-695,window.onresize=function(){R()}};return t({init:x}),(e,t)=>{const r=Object(i["resolveComponent"])("el-button"),n=Object(i["resolveComponent"])("el-date-picker"),o=Object(i["resolveComponent"])("DictTag"),d=Object(i["resolveComponent"])("el-link"),p=Object(i["resolveComponent"])("el-input");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[f.value?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ut,[Object(i["createElementVNode"])("div",ht,[dt,Object(i["createVNode"])(r,{onClick:N},{default:Object(i["withCtx"])(()=>[ft]),_:1})]),Object(i["createElementVNode"])("div",pt,[Object(i["createElementVNode"])("div",mt,[Object(i["createElementVNode"])("div",gt,[vt,Object(i["createVNode"])(Me["c"],{width:"300px",clearable:"",modelValue:m.value.ssbmdm,"onUpdate:modelValue":t[0]||(t[0]=e=>m.value.ssbmdm=e)},null,8,["modelValue"]),Object(i["createElementVNode"])("div",_t,[yt,(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(h.value,e=>(Object(i["openBlock"])(),Object(i["createBlock"])(r,{onClick:t=>D(e),key:e,type:u.value==e?"primary":"",size:"small"},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e),1)]),_:2},1032,["onClick","type"]))),128))]),Object(i["createVNode"])(n,{modelValue:m.value.times,"onUpdate:modelValue":t[1]||(t[1]=e=>m.value.times=e),type:"daterange","range-separator":"To","value-format":"YYYY-MM-DD","start-placeholder":"选择开始时间","end-placeholder":"选择结束时间"},null,8,["modelValue"]),Object(i["createVNode"])(r,{class:"ml10 mr20",type:"primary",size:"small",onClick:E},{default:Object(i["withCtx"])(()=>[xt]),_:1}),Object(i["createVNode"])(r,{type:"primary",size:"small",onClick:S},{default:Object(i["withCtx"])(()=>[bt]),_:1})]),Tt,(Object(i["openBlock"])(),Object(i["createBlock"])(s["a"],{tableData:_.tableData_hbh,tableColumn:_.tableColumn,tableHeight:_.tableHeight1,key:_.keyCount,tableConfiger:_.tableConfiger1,controlsWidth:_.controlsWidth},{xlLx:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.xlLx,options:a.dic.D_GS_XS_LX},null,8,["value","options"])]),qbLy:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.qbLy,options:a.dic.D_GS_XS_LY},null,8,["value","options"])]),czzt:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.czzt,options:a.dic.D_GS_XS_CZZT},null,8,["value","options"])]),shzt:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.shzt,options:a.dic.D_BZ_XSSHZT},null,8,["value","options"])]),qtlx:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.qtlx,options:a.dic.D_GS_XS_QTLX},null,8,["value","options"])]),controls:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(d,{size:"small",type:"primary",onClick:t=>C(e)},{default:Object(i["withCtx"])(()=>[wt]),_:2},1032,["onClick"])]),_:1},8,["tableData","tableColumn","tableHeight","tableConfiger","controlsWidth"])),Object(i["createElementVNode"])("div",St,[Object(i["createVNode"])(Oe["a"],{onChangeNo:O,onChangeSize:M,tableHeight:_.tableHeight1,pageConfiger:{...y}},null,8,["tableHeight","pageConfiger"])])]),Object(i["createElementVNode"])("div",Et,[At,Object(i["createElementVNode"])("div",Ct,[Ot,Object(i["createVNode"])(p,{style:{width:"300px"},placeholder:"请输入标题",clearable:"",modelValue:g.value,"onUpdate:modelValue":t[2]||(t[2]=e=>g.value=e)},null,8,["modelValue"]),Object(i["createVNode"])(r,{class:"ml10 mr20",type:"primary",size:"small"},{default:Object(i["withCtx"])(()=>[Mt]),_:1}),Object(i["createVNode"])(r,{class:"mr10",type:"primary",size:"small",onClick:T},{default:Object(i["withCtx"])(()=>[Dt]),_:1}),Object(i["createVNode"])(r,{type:"primary",size:"small",onClick:w},{default:Object(i["withCtx"])(()=>[Lt]),_:1})]),(Object(i["openBlock"])(),Object(i["createBlock"])(s["a"],{tableData:_.tableData_hbq,tableColumn:_.tableColumn,tableHeight:_.tableHeight,key:_.keyCount,tableConfiger:_.tableConfiger,controlsWidth:_.controlsWidth,onChooseData:L},{xlLx:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.xlLx,options:a.dic.D_GS_XS_LX},null,8,["value","options"])]),qbLy:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.qbLy,options:a.dic.D_GS_XS_LY},null,8,["value","options"])]),czzt:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.czzt,options:a.dic.D_GS_XS_CZZT},null,8,["value","options"])]),shzt:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.shzt,options:a.dic.D_BZ_XSSHZT},null,8,["value","options"])]),qtlx:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(o,{tag:!1,value:e.qtlx,options:a.dic.D_GS_XS_QTLX},null,8,["value","options"])]),_:1},8,["tableData","tableColumn","tableHeight","tableConfiger","controlsWidth"]))])])])):Object(i["createCommentVNode"])("",!0),Object(i["createVNode"])(lt,{modelValue:l.value,"onUpdate:modelValue":t[3]||(t[3]=e=>l.value=e),id:c.value},null,8,["modelValue","id"])],64)}}};r("3985");const Rt=h()(Nt,[["__scopeId","data-v-44bf595e"]]);var Pt=Rt,It=r("7995"),Bt=r("d7c3");const jt={class:"titleBox"},zt=Object(i["createTextVNode"])("情报研判分析"),Ft=Object(i["createTextVNode"])("线索串联"),Vt={class:"tabBox"},kt=Object(i["createTextVNode"])(" 至 "),Ut=Object(i["createTextVNode"])("下发指令"),Gt=Object(i["createTextVNode"])("转为指令"),Ht=Object(i["createTextVNode"])("详情");var Wt={__name:"index",setup(e){const{proxy:t}=Object(i["getCurrentInstance"])(),{D_GS_ZDQT_FXDJ:r,D_GS_XS_ZLLX:n,D_GS_XS_CZZT:a,D_GS_XS_LY:l,D_BZ_SSZT:c,D_BZ_SF:u,D_GS_XS_LX:h,D_GS_XS_QTLX:d,D_BZ_XB:f,D_BZ_XSSHZT:p}=t.$dict("D_GS_ZDQT_FXDJ","D_GS_XS_ZLLX","D_GS_XS_CZZT","D_GS_XS_LY","D_BZ_SSZT","D_BZ_SF","D_GS_XS_LX","D_GS_XS_QTLX","D_BZ_XB","D_BZ_XSSHZT"),m=Object(i["ref"])(),g=Object(i["ref"])(),v=Object(i["ref"])(!1),_=Object(i["ref"])(!1),y=Object(i["ref"])(!1),x=Object(i["ref"])(),b=Object(i["ref"])([{label:"线索名称",prop:"xsMc",placeholder:"请输入线索名称",showType:"input"},{label:"内容关键字",prop:"xsNr",placeholder:"请输入语义关键字",showType:"input"},{label:"线索类型",prop:"xlLx",placeholder:"请选择线索类型",showType:"select",options:h},{label:"线索来源",prop:"qbLy",placeholder:"请选择线索来源",showType:"select",options:l},{label:"指向地点",prop:"zxdz",placeholder:"请输入指向地点",showType:"input"}]),T=Object(i["reactive"])({tableData:[],keyCount:0,tableConfiger:{rowHieght:61,showSelectType:"checkBox",loading:!1},total:0,pageConfiger:{pageSize:20,pageCurrent:1},controlsWidth:150,tableColumn:[{label:"线索编号",prop:"xsBh"},{label:"线索名称",prop:"xsMc"},{label:"线索类型",prop:"xlLx",showSolt:!0},{label:"线索来源",prop:"qbLy",showSolt:!0},{label:"指向时间",prop:"zxkssj",showSolt:!0,showOverflowTooltip:!0},{label:"上报时间",prop:"sxsbsj",showOverflowTooltip:!0},{label:"指向地点",prop:"zxdz"},{label:"线索内容",prop:"xsNr",showOverflowTooltip:!0},{label:"处置状态",prop:"czzt",showSolt:!0},{label:"附件",prop:"fjdz",showSolt:!0},{label:"审核状态",prop:"shzt",showSolt:!0}]}),w=Object(i["ref"])({});Object(i["onMounted"])(()=>{C(),L()});const S=e=>{w.value={...e},T.pageConfiger.pageCurrent=1,C()},E=e=>{T.pageConfiger.pageCurrent=e,C()},A=e=>{T.pageConfiger.pageSize=e,C()},C=()=>{T.tableConfiger.loading=!0;let e={...T.pageConfiger,...w.value};Object(o["c"])(e,"/mosty-gsxt/qbcj/selectPage").then(e=>{T.tableData=e.records||[],T.total=e.total,T.tableConfiger.loading=!1}).catch(()=>{T.tableConfiger.loading=!1})},O=e=>{v.value=!0,setTimeout(()=>{y.value.init(e)},500)},M=(e,t)=>{v.value=!0,setTimeout(()=>{m.value.init(e,t)},500)},D=()=>{x.value.init()},L=()=>{T.tableHeight=window.innerHeight-g.value.offsetHeight-250,window.onresize=function(){L()}},N=Object(i["ref"])(!1),R=Object(i["ref"])(),P=Object(i["ref"])(),I=()=>{N.value=!1},B=e=>{N.value=!0,R.value=e},j=()=>{P.value.getsendFqzl()},z=()=>{P.value.close()},F={title:"xsMc",instructionContent:"xsNr"};return(e,t)=>{const o=Object(i["resolveComponent"])("el-button"),w=Object(i["resolveComponent"])("DictTag"),C=Object(i["resolveComponent"])("el-link");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",jt,[Object(i["createVNode"])(Ce["a"],{title:"人力情报信息采集流转"},{default:Object(i["withCtx"])(()=>[Object(i["createVNode"])(o,{type:"primary",onClick:t[0]||(t[0]=e=>_.value=!0)},{default:Object(i["withCtx"])(()=>[zt]),_:1}),Object(i["createVNode"])(o,{type:"primary",onClick:D},{default:Object(i["withCtx"])(()=>[Ft]),_:1})]),_:1})]),Object(i["createElementVNode"])("div",{ref_key:"searchBox",ref:g},[(Object(i["openBlock"])(),Object(i["createBlock"])(H["a"],{searchArr:b.value,onSubmit:S,key:T.keyCount},null,8,["searchArr"]))],512),Object(i["createElementVNode"])("div",Vt,[(Object(i["openBlock"])(),Object(i["createBlock"])(s["a"],{tableData:T.tableData,tableColumn:T.tableColumn,tableHeight:T.tableHeight,key:T.keyCount,tableConfiger:T.tableConfiger,controlsWidth:T.controlsWidth},{xlLx:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(w,{tag:!1,value:e.xlLx,options:Object(i["unref"])(h)},null,8,["value","options"])]),qbLy:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(w,{tag:!1,value:e.qbLy,options:Object(i["unref"])(l)},null,8,["value","options"])]),czzt:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(w,{tag:!1,value:e.czzt,options:Object(i["unref"])(a)},null,8,["value","options"])]),shzt:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(w,{tag:!1,value:e.shzt,options:Object(i["unref"])(p)},null,8,["value","options"])]),zxkssj:Object(i["withCtx"])(({row:e})=>[Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.zxkssj),1),kt,Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.zxjssj),1)]),controls:Object(i["withCtx"])(({row:e})=>[Object(i["createVNode"])(C,{size:"small",type:"primary",onClick:t=>B(e)},{default:Object(i["withCtx"])(()=>[Ut]),_:2},1032,["onClick"]),Object(i["createVNode"])(C,{size:"small",type:"primary",onClick:t=>O(e)},{default:Object(i["withCtx"])(()=>[Gt]),_:2},1032,["onClick"]),Object(i["createVNode"])(C,{size:"small",type:"primary",onClick:t=>M("detail",e)},{default:Object(i["withCtx"])(()=>[Ht]),_:2},1032,["onClick"])]),_:1},8,["tableData","tableColumn","tableHeight","tableConfiger","controlsWidth"])),Object(i["createVNode"])(Oe["a"],{onChangeNo:E,onChangeSize:A,tableHeight:T.tableHeight,pageConfiger:{...T.pageConfiger,total:T.total}},null,8,["tableHeight","pageConfiger"])]),v.value?(Object(i["openBlock"])(),Object(i["createBlock"])(qe,{key:0,ref_key:"detailDiloag",ref:m,dic:{D_BZ_SF:Object(i["unref"])(u),D_BZ_XB:Object(i["unref"])(f),D_GS_XS_LY:Object(i["unref"])(l),D_BZ_SSZT:Object(i["unref"])(c),D_GS_XS_LX:Object(i["unref"])(h),D_GS_XS_QTLX:Object(i["unref"])(d)}},null,8,["dic"])):Object(i["createCommentVNode"])("",!0),v.value?(Object(i["openBlock"])(),Object(i["createBlock"])(nt,{key:1,ref_key:"zlDialog",ref:y,dic:{D_GS_XS_ZLLX:Object(i["unref"])(n),D_GS_ZDQT_FXDJ:Object(i["unref"])(r)}},null,8,["dic"])):Object(i["createCommentVNode"])("",!0),Object(i["createVNode"])(Pt,{ref_key:"isShowhB",ref:x,dic:{D_GS_XS_LX:Object(i["unref"])(h),D_GS_XS_LY:Object(i["unref"])(l),D_GS_XS_CZZT:Object(i["unref"])(a),D_BZ_XSSHZT:Object(i["unref"])(p),D_GS_XS_QTLX:Object(i["unref"])(d)}},null,8,["dic"]),(Object(i["openBlock"])(),Object(i["createBlock"])(i["Teleport"],{to:"#app"},[_.value?(Object(i["openBlock"])(),Object(i["createBlock"])(Ae,{key:0,onClose:t[1]||(t[1]=e=>_.value=!1)})):Object(i["createCommentVNode"])("",!0)]))]),Object(i["createVNode"])(It["a"],{modelValue:N.value,"onUpdate:modelValue":t[2]||(t[2]=e=>N.value=e),title:"发送指令",onSubmit:j,onClose:z},{default:Object(i["withCtx"])(()=>[Object(i["createVNode"])(Bt["a"],{ref_key:"semdFqzlRef",ref:P,itemData:R.value,onHandleClose:I,identification:"qbcj",tacitly:F},null,8,["itemData"])]),_:1},8,["modelValue"])],64)}}};r("08c4");const Xt=Wt;t["default"]=Xt},"9c28":function(e,t,r){"use strict";r("d3e1")},a093:function(e,t,r){},a1ba:function(e,t,r){"use strict";r("752b")},ad28:function(e,t,r){"use strict";var i=r("7a23"),n={__name:"MyTable",props:{tableConfiger:{type:Object,default:()=>{}},tableData:{type:Array,default:()=>[]},tableColumn:{type:Array,default:()=>[]},controlsWidth:{type:Number,default:180},tableHeight:{type:Number||String},treePros:{type:Object,default:{children:"children",hasChildren:"hasChildren"}},fixed:{type:String,default:"right"}},emits:["chooseData"],setup(e,{emit:t}){const r=e,n=Object(i["ref"])(),a=Object(i["ref"])();let o=Object(i["reactive"])({showSelectType:null,showIndex:!0,rowKey:null,border:!0,defaultExpandAll:!1,loading:!1,align:"center",haveControls:!0,controls:"操作",stripe:!1,lazy:!0,portUrl:"",defaultSelectKeys:[],radioChoose:"",rowHeight:"41"});Object(i["watchEffect"])(()=>{o={...o,...r.tableConfiger},c()}),Object(i["onMounted"])(()=>{c()});const s=e=>{if("radio"===o.showSelectType&&e.length>1){let r=e.shift();n.value.toggleRowSelection(r,!1),a.value=e,t("chooseData",e)}else t("chooseData",e)},l=(e,t,r)=>{setTimeout(()=>{r([{id:31,date:"2016-05-01",name:"wangxiaohu",address:"No. 189, Grove St, Los Angeles"},{id:32,date:"2016-05-01",name:"wangxiaohu",address:"No. 189, Grove St, Los Angeles"}])},1e3)};function c(){Object(i["nextTick"])(()=>{var e,t;(null===(e=r.tableConfiger.defaultSelectKeys)||void 0===e?void 0:e.length)>0&&"checkBox"===r.tableConfiger.showSelectType?r.tableData.forEach(e=>{r.tableConfiger.defaultSelectKeys.findIndex(t=>t===e[r.tableConfiger.rowKey])>-1&&n.value.toggleRowSelection(e,!0)}):r.tableConfiger.defaultSelectKeys&&(null===(t=r.tableConfiger.defaultSelectKeys)||void 0===t?void 0:t.length)>0&&"radio"===r.tableConfiger.showSelectType&&(o.radioChoose=r.tableConfiger.defaultSelectKeys[0])})}return(t,r)=>{const a=Object(i["resolveComponent"])("el-table-column"),c=Object(i["resolveComponent"])("el-table"),u=Object(i["resolveDirective"])("loading");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{style:{width:"100%"},class:Object(i["normalizeClass"])("radio"===Object(i["unref"])(o).showSelectType?"tabBoxRadio":"")},[Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createBlock"])(c,{ref_key:"multipleTableRef",ref:n,data:e.tableData,onSelectionChange:s,"row-key":Object(i["unref"])(o).rowKey,border:Object(i["unref"])(o).border,"default-expand-all":Object(i["unref"])(o).defaultExpandAll,stripe:Object(i["unref"])(o).stripe,height:e.tableHeight,lazy:Object(i["unref"])(o).lazy,load:l,"tree-props":e.treePros,style:{width:"100%"},"header-cell-class-name":()=>"HeadBgColor","highlight-current-row":"radio"===Object(i["unref"])(o).showSelectType,"row-style":{height:"auto"===Object(i["unref"])(o).rowHeight?Object(i["unref"])(o).rowHeight:Object(i["unref"])(o).rowHeight+"px"}},{default:Object(i["withCtx"])(()=>{var r,n;return[Object(i["unref"])(o).showSelectType?(Object(i["openBlock"])(),Object(i["createBlock"])(a,{key:0,style:{width:"55px"},type:"selection",width:"55",class:Object(i["normalizeClass"])("radio"===Object(i["unref"])(o).showSelectType?"tabBoxRadio":"")},null,8,["class"])):Object(i["createCommentVNode"])("",!0),Object(i["unref"])(o).showIndex?(Object(i["openBlock"])(),Object(i["createBlock"])(a,{key:1,type:"index",label:"序号",width:"60",align:null===(r=Object(i["unref"])(o))||void 0===r?void 0:r.align},null,8,["align"])):Object(i["createCommentVNode"])("",!0),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.tableColumn,(e,r)=>{var n;return Object(i["openBlock"])(),Object(i["createBlock"])(a,{align:null===(n=Object(i["unref"])(o))||void 0===n?void 0:n.align,prop:e.prop,key:r,label:e.label,width:e.width,style:{width:"100%","font-size":"14px"},"show-overflow-tooltip":e.showOverflowTooltip||!1,sortable:e.sortable||!1},Object(i["createSlots"])({_:2},[e.showSolt?{name:"default",fn:Object(i["withCtx"])(r=>[Object(i["renderSlot"])(t.$slots,e.prop,Object(i["normalizeProps"])(Object(i["guardReactiveProps"])(r)))])}:{name:"default",fn:Object(i["withCtx"])(({row:t})=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(t[e.prop]),1)])}]),1032,["align","prop","label","width","show-overflow-tooltip","sortable"])}),128)),Object(i["unref"])(o).haveControls?(Object(i["openBlock"])(),Object(i["createBlock"])(a,{key:2,fixed:e.fixed,label:Object(i["unref"])(o).controls,width:e.controlsWidth,align:null===(n=Object(i["unref"])(o))||void 0===n?void 0:n.align},{default:Object(i["withCtx"])(e=>[Object(i["renderSlot"])(t.$slots,"controls",Object(i["normalizeProps"])(Object(i["guardReactiveProps"])(e)))]),_:3},8,["fixed","label","width","align"])):Object(i["createCommentVNode"])("",!0)]}),_:3},8,["data","row-key","border","default-expand-all","stripe","height","lazy","tree-props","header-cell-class-name","highlight-current-row","row-style"])),[[u,e.tableConfiger.loading]])],2)}}};r("b9a2");const a=n;t["a"]=a},b47a:function(e,t,r){},b932:function(e,t,r){"use strict";var i=r("7a23"),n=(r("caad"),r("986e"));function a(e){let t=this;t.mMap=e,t._self={},t._CustomDraw=null,t.polygonGeo=null,t.idsBox={},t.isCheck=!1,a.prototype.setMapCenter=(t,r)=>{e.mapboxGLMap.setCenter(t),e.mapboxGLMap.setZoom(r)},a.prototype.showPoint=r=>{let{coords:i,icon:n,flag:a,iconH:o}=r;if(!i)return;t._self[a]||(t._self[a]=[]);let s=i.map((e,t)=>{let r=e.kfdMc||e.wzBc||e.gajgmc||e.xm||e.jczmc,i={position:[e.jd,e.wd],userData:{deviceSn:"text"+t,area:r},id:e.id,text:r,data:e};if(e.jd&&e.wd)return i});const l=e.createdPoint(s,{image:n,scale:1,highlightImage:o||n,labelOption:{pixelOffset:[0,-2],allShow:!1,fontSize:"18px",fontWeight:600,fontColor:"#000000"}});t._self[a].push(l),l.addEventListener("click",e=>{let r=e.data?JSON.parse(e.data):{};t.openInfoDetail(a,[r])})},a.prototype.makerSki=r=>{let{coords:i,icon:n,flag:a,showTitle:o}=r;i&&(t._self[a]||(t._self[a]=[]),t.idsBox[a]||(t.idsBox[a]=[]),"rx"==a?t.handlePolice(i,n,a,o):i.forEach(r=>{let i=document.createElement("img");i.src=r.icon||n,i.style.width="kfd"==a?"32px":"25px",a.includes("jczMap_")&&(i.style.width="45px"),o&&t.makerShowTitle(r,[r.jd,r.wd],a);const s=e.Marker(i,[r.jd,r.wd],{anchor:"bottom",offset:[0,0]});i.addEventListener("click",()=>{t.openInfoDetail(a,r)}),t._self[a].push(s),t.idsBox[a].push(r.id)}))},a.prototype.handlePolice=(i,n,a,o)=>{i.forEach(i=>{let n=document.createElement("img"),s=r("dab1");switch(i.lx){case"01":s=r("0bb9");break;case"02":s=r("14c9");break;case"03":s=r("7729");break;default:s=r("0bb9");break}1==i.zzlx&&(s=r("dd70"));let l=i.cllx?i.cllx.split(","):[];(l.includes("03")||l.includes("04"))&&"02"==i.lx&&(s=r("157b")),(l.includes("03")||l.includes("04"))&&"01"==i.lx&&(s=r("5749")),(l.includes("08")||l.includes("06"))&&(s=r("e88d")),n.src=s;let c=l.includes("03")||l.includes("08");o&&t.makerShowTitle(i,[i.jd,i.wd],a),t.shouIcon(i,[i.jd,i.wd]);let u=c?[-10,0]:[0,0];l.includes("08")&&(u=[-12,-10]);const h=e.Marker(n,[i.jd,i.wd],{anchor:"bottom",offset:u});n.addEventListener("click",()=>{t.openInfoDetail(a,i)}),t._self[a].push(h),t.idsBox[a].push(i.id)})},a.prototype.makerShowTitle=(r,i,n,a)=>{let o="rx"==n?"rxTitle":"Title",s=n+o;t._self[s]||(t._self[s]=[]);let l=r.jzMc?r.jzMc:r.fzrXm+"警组";"sbwz_car"!=n&&"sbwz_sb"!=n&&"sbwz_zfjly"!=n||(l=r.sbmc),"gapText"==n&&(l=a);const c=document.createElement("div");c.className="makerTitle","sbwz_car"!=n&&"sbwz_sb"!=n&&"sbwz_zfjly"!=n||(c.className="makerTitlezb"),"rx"==n&&("0"==r.xfzt?c.classList.add("makerTitleLine"):"1"==r.xfzt?c.classList.add("makerTitlecj"):c.classList.add("makerTitleUnLine")),"gapText"==n&&(c.className="makerTitleGapText"),c.innerHTML=l;const u=e.Marker(c,i,{anchor:"bottom",offset:[0,-50]});t._self[s].push(u)},a.prototype.shouIcon=(i,n)=>{t._self.gpsZb||(t._self.gpsZb=[]);var a=r("bb77"),o=r("d8f9"),s=r("92c1");let l="string"==typeof i.jyqx?JSON.parse(i.jyqx):i.jyqx?i.jyqx:[],c="string"==typeof i.txzb?JSON.parse(i.txzb):i.txzb?i.txzb:[],u="string"==typeof i.pbcl?JSON.parse(i.pbcl):i.pbcl?i.pbcl:[],h=[],d=!!(u&&u.length>0),f=!!(c&&c.length>0),p=!!(l&&l.length>0);if(f){let t=document.createElement("img");t.style.width="15px",t.src=o;const r=e.Marker(t,n,{anchor:"bottom",offset:[20,-26]});h.push(r)}if(p){let t=document.createElement("img");t.style.width="15px",t.src=a;const r=e.Marker(t,n,{anchor:"bottom",offset:[20,-10]});h.push(r)}if(d){let t=document.createElement("img");t.style.width="20px",t.src=s;const r=e.Marker(t,n,{anchor:"bottom",offset:[20,2]});h.push(r)}t._self.gpsZb[i.id]=h},a.prototype.zdySquire=r=>{let{points:i,flag:n,distance:a}=r;t._self[n]||(t._self[n]=[]);let o="距离:"+a;const s=document.createElement("div");s.className="makerTitle","distance"==n&&(s.className="makerTitleDistance"),s.innerHTML=o;const l=e.Marker(s,i,{anchor:"bottom",offset:[0,-76]});t._self[n].push(l)},a.prototype.diffusionCircle=r=>{let{coords:i,flag:n,isClear:a}=r;t._self[n]||(t._self[n]={}),a&&t._self[n].destroy();let o=[{position:i}];t._self[n]=e.DiffuseCircle(o,{radius:10,color:"rgba(81,217,254)",duration:30,speed:4})},a.prototype.aggregateScatteringPoint=r=>{let{coords:i,icon:n,flag:a,isclear:o,scale:s,fontColor:l}=r,c=i.map(e=>(e.lng=e.jd,e.lat=e.wd,e));t._self[a]||(t._self[a]=[]),o&&t.removeElement(a);let u=e.clusterLayer(c,{id:a,size:18,pixelRange:60,gradient:{1:n,10:n,100:n,1e3:n},fontSize:14,fontColor:l||"#001022",style:"custom",image:n,scale:s||1,fontFamily:["Microsoft YaHei"]});t._self[a].push(u),u.addEventListener("click",e=>{t.openInfoDetail(a,[e])}),u.addEventListener("clusterClick",e=>{t.openInfoDetail(a,e)})},a.prototype.showHeatDrawing=r=>{let{coords:i,flag:n,isclear:a,color:o}=r;t._self[n]||(t._self[n]=[]),a&&t.removeElement(n);let s={type:"FeatureCollection",features:[]};for(let e=0;e10&&t.count<=50?1.6:1.9,o={properties:{mag:a},type:"Feature",geometry:{type:"Point",coordinates:[r,n,.1]}};s.features.push(o)}let l={0:"rgba(23,102,172,0)",.5:"rgb(209,229,240)",1:"rgb(178,24,43)"};o&&(l={0:o[0],.5:o[1],1:o[2]});let c=e.HeatMap(s,{colors:l});t._self[n].push(c)},a.prototype.removeAll=()=>{for(let e in t._self)if("rx"!=e&&"gpsZb"!=e&&!e.includes("rxTitle")){let r=t._self[e];for(let e=0;e{if("gpsZb"==e)for(let r in t._self.gpsZb){let e=t._self.gpsZb[r];if(e&&e.length>0){for(let t in e)e[t].destroy();t._self.gpsZb[r]=[]}}if("rx"==e&&(t.idsBox[e]=[]),!t._self[e])return!1;if("gpsZb"!==e){for(let n=0;n{if(!t.idsBox[e])return!1;let i=t.idsBox[e];i.forEach((i,n)=>{if(i==r&&(t.idsBox[e].splice(n,1),t._self[e][n]&&t._self[e][n].destroy(),t._self[e].splice(n,1),"rx"==e)){let i=e+"rxTitle";t._self[i][n]&&t._self[i][n].destroy(),t._self[i].splice(n,1),t.removeGpsZbOverlayById(r)}})},a.prototype.removeGpsZbOverlayById=e=>{if(t._self.gpsZb[e])try{let r=t._self.gpsZb[e];r&&(r.forEach(e=>{e.destroy()}),delete t._self.gpsZb[e])}catch(r){}},a.prototype.Drawplot=r=>{const{point:i,line:n,polygon:a,circle:o,rectangle:s,geoJson:l,remove:c,enableEdit:u}=e.draw({lineWidth:2,lineColor:"rgba(233,168,32,1)",fillColor:"rgba(233,168,32,0.5)",color:"rgba(233,168,32,1)",pixelSzie:0});t._CustomDraw={point:i,line:n,polygon:a,circle:o,rectangle:s,geoJson:l,remove:c,enableEdit:u}},a.prototype.plot=(e,r)=>{let{flag:i,color:n,linecolor:a,type:o,coords:s}=e;switch(t._self[i]||(t._self[i]=[]),e.isclear&&t.removePlot(i),!e.isclear||"polygon"!=e.type&&"line"!=e.type||t.removeEara(i),o){case"point":t._CustomDraw.point(e=>{t.handlePlot(e,o,i,r)});break;case"rectangle":t._CustomDraw.rectangle(e=>{t.handlePlot(e,o,i,r)});break;case"circle":t._CustomDraw.circle(e=>{t.handlePlot(e,o,i,r)});break;case"polygon":t._CustomDraw.polygon(e=>{t.handlePlot(e,o,i,r)},{fillColor:n||"rgba(233,168,32,0.5)",lineColor:a||"rgba(233,168,32,1)"});break;case"line":t._CustomDraw.line(e=>{t.handlePlot(e,o,i,r)});break;case"geoJson":let e={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Polygon",coordinates:s},id:i,properties:{fillColor:n||"rgba(233,168,32,1)",lineColor:a||"rgba(233,168,32,1)"}}]};t._CustomDraw.geoJson(e,e=>{t.handlePlot(e,o,i,r)});break}},a.prototype.handlePlot=(e,r,i,n)=>{t._self[i].push(e.id);let a=e.positionData;n(a,r,i,e)},a.prototype.removePlot=e=>{if(!t._self[e])return!1;t._self[e].forEach(e=>{t._CustomDraw.remove(e)})},a.prototype.removeEara=e=>{t._CustomDraw.remove(e),t.removePlot(e)},a.prototype.createLine=r=>{let{type:i,coords:n,isclear:a,flag:o,color:s,width:l}=r;if(!n)return!1;t._self[o]||(t._self[o]=[]),a&&t.removeElement(o);let c=n.map((e,t)=>({position:e.coords[0],text:"",id:t,userData:{name:e.text}})),u=e.createLine(c,{color:s||"rgba(20, 237, 245,1)",width:l||8,type:i,highlightColor:"red",labelOption:{pixelOffset:[0,-1],allShow:!1,type:"text",fontColor:"rgba(20, 237, 245,1)"}});t._self[o].push(u)},a.prototype.echoPlane=r=>{let{type:i,coords:a,fontColor:o,fontSize:s,text:l="",radius:c=0,isclear:u,flag:h,id:d=1,color:f,linecolor:p}=r;if(!a)return;u&&t.removeElement(h),t._self[h]||(t._self[h]=[]);let m,g=f||"rgba(29,237,245,0.6)",v=p||"rgba(29,237,245,0.6)",_={color:g,outLineColor:v,outLineWidth:2,highlightColor:"rgba(255,0,0,0.5)",labelOption:{pixelOffset:[0,0],allShow:!0,fontColor:o||"#ffffff",fontSize:s||"12px"}};if("circle"==i){let t=[{center:a,radius:c,text:l,id:d}];m=e.createCircle(t,_)}"rectangle"==i&&(m=e.createRectangle(a,_)),"polygon"==i&&(m=e.createPolygon(a,_)),t._self[h].push(m),m.addEventListener("click",e=>{"xfq"==h&&(m.highlight(e.id),n["a"].emit("showXFQinfo",e),e.id==t.lightHeight&&(t.isCheck=!t.isCheck,t.isCheck?(m.highlight(0),n["a"].emit("showXFQinfo",null)):n["a"].emit("showXFQinfo",e)),t.lightHeight=e.id),"zdxl_fzyc"==h&&n["a"].emit("showFzycInfo",{info:e,type:!0})})},a.prototype.gapText=e=>{let{points:r,text:i,flag:n}=e;t.makerShowTitle({},r,n,i)},a.prototype.displayLineAnimation=i=>{let{coords:n,isClear:a,flag:s}=i;if(!n)return;t._self[s]||(t._self[s]=[]),a&&t._self[s]&&t.removeElement(s);let l=o().slice(3,5);const c=[{position:n,text:"实线",id:l,userData:{name:"测试1"}}],u=e.trajectoryRealtime(c,{color:"#28F",width:8,image:"images/car.png",speed:80,imageWidth:20,imageHeight:40,isShowLine:!1,isAgain:!1,traveledColor:"#32b1fb"});u.start(),u.on("length",e=>{let i={flag:s};if(e&&0==e[0].percent){i.icon=r("615e");let n=e[0].position[0];i.coords=[{jd:n[0],wd:n[1]}],t.makerSki(i)}if(e&&99==e[0].percent){let n=e[0].position.length,a=e[0].position[n-1];i.coords=[{jd:a[0],wd:a[1]}],i.icon=r("bfe1"),t.makerSki(i)}}),t._self[s].push(u)},a.prototype.removeTrajectory=e=>{t._self[e]&&(t._self[e].destroy(),t._self[e]=null)},a.prototype.createBoundarys=r=>{let{data:i}=r;if(!i)return!1;t.polygonGeo&&t.removeBj(),t.polygonGeo=e.createPolygon(i,{color:"rgba(20,237,245,0.3)",outLineColor:"#cf1010",outLineWidth:6,highlightColor:"red",type:"solid",labelOption:{pixelOffset:[2,0],allShow:!1,fontColor:"#ffffff"}}),t.polygonGeo.flyTo()},a.prototype.removeBj=e=>{t.polygonGeo.destroy()},a.prototype.openInfoDetail=(e,t)=>{switch(e){case"home_yj_map":console.log(t),n["a"].emit("showHomeYJ",t);break;case"home_yj_detail":console.log(t),n["a"].emit("showHomeWarning",t);break}}}function o(){for(var e=[],t="0123456789abcdefghijklmnopqrstuvwxyz",r=0;r<32;r++)e[r]=t.substr(Math.floor(16*Math.random()),1);e[14]="4",e[19]=t.substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23];let i=e.join("");return i}var s=r("5d2d");const l=["id"],c={key:0,class:"changeMap_box"},u={class:"zoomTargetBox"};var h={__name:"index",props:{mapid:{type:String,default:"mapDiv"},isShow:{type:Boolean,default:!1},isShowMvt:{type:Boolean,default:!1},isShowZoom:{type:Boolean,default:!1},isShowDraw:{type:Boolean,default:!1}},setup(e){const t=e,r=Object(i["ref"])(!0),o=(Object(i["ref"])(null),Object(i["ref"])(null)),h=Object(i["ref"])(6);try{Object(s["a"])("deptId")[0].deptCode}catch(g){}let d;Object(i["onMounted"])(()=>{n["a"].on("followUp",e=>{let t=document.getElementsByClassName("changeMap_box");t&&(t[0].style.right=e?"398px":"4px",t[0].style.transition="0.5s")}),d=new EliMap({id:t.mapid,crs:"EPSG:4490",style:{glyphs:"./fonts/{fontstack}/{range}.pbf",center:[94.36057012,29.64276831],zoom:15},minZoom:7,maxZoom:18}),window.map=d,d.mapboxGLMap.on("load",()=>{d.addWMTSLayer("/PGIS_S_TileMapServer/Maps/XZDJ_DJ/EzMap",{Service:"getImage",Type:"RGB",ZoomOffset:"0",V:"0.3",Zoom:"{z}",Row:"{y}",Col:"{x}"},{tileSize:300}),h.value=d.mapboxGLMap.getZoom()}),o.value=new a(d),o.value.Drawplot(),n["a"].on("setMapCenter",e=>{o.value.setMapCenter(e.location,e.zoomLevel)}),n["a"].on("removePlot",e=>{o.value.removePlot(e)}),n["a"].on("removeAll",e=>{o.value.removeAll(e)}),n["a"].on("addPointArea",e=>{o.value.makerSki(e)}),n["a"].on("showPoint",e=>{o.value.showPoint(e)}),n["a"].on("deletePointArea",e=>{o.value.removeElement(e)}),n["a"].on("deletePointAreaOne",e=>{o.value.removeElementOne(e.flag,e.id)}),n["a"].on("showSquire",e=>{o.value.zdySquire(e)}),n["a"].on("drawShape",e=>{o.value.plot(e,f)}),n["a"].on("removeEara",e=>{o.value.removeEara(e)}),n["a"].on("echoPlane",e=>{o.value.echoPlane(e)}),n["a"].on("removeEara",e=>{o.value.removeEara(e)}),n["a"].on("echoLine",e=>{o.value.createLine(e,e.flag)}),n["a"].on("setBoundarys",e=>{o.value.createBoundarys(e)}),n["a"].on("removeBj",e=>{o.value.removeBj(e)}),n["a"].on("drawLineAnimation",e=>{o.value.displayLineAnimation(e)}),n["a"].on("addPoint",e=>{o.value.aggregateScatteringPoint(e)}),n["a"].on("thermodynamicChart",e=>{o.value.showHeatDrawing(e)}),n["a"].on("diffusionCircle",e=>{o.value.diffusionCircle(e)}),n["a"].on("showGapText",e=>{o.value.gapText(e)}),n["a"].on("getCurrentCenter",e=>{let t=d.mapboxGLMap.getCenter(),r=[t.lng,t.lat];n["a"].emit("getcentercoord",r)})});const f=(e,t,r,i)=>{n["a"].emit("coordString",{coord:e,type:t,flag:r,data:i})},p=e=>{d.mapboxGLMap.setZoom(e)},m=e=>{};return Object(i["onUnmounted"])(()=>{n["a"].off("removePlot"),n["a"].off("setMapCenter"),n["a"].off("addPointArea"),n["a"].off("showPoint"),n["a"].off("deletePointArea"),n["a"].off("deletePointAreaOne"),n["a"].off("drawShape"),n["a"].off("echoPlane"),n["a"].off("removeEara"),n["a"].off("echoLine"),n["a"].off("addPoint"),n["a"].off("thermodynamicChart"),n["a"].off("drawLineAnimation"),n["a"].off("aggregateScatteringPoint"),n["a"].off("hotmap"),n["a"].off("setBoundarys"),n["a"].off("diffusionCircle"),n["a"].off("SsCircle"),n["a"].off("ClearssCircle")}),(n,a)=>{const o=Object(i["resolveComponent"])("el-switch"),s=Object(i["resolveComponent"])("el-input-number");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[Object(i["createElementVNode"])("div",{id:e.mapid,class:"map"},null,8,l),t.isShow?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",c,[Object(i["createVNode"])(o,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=e=>r.value=e),onChange:m,"active-text":"打开路况","inactive-text":"关闭路况",style:{"--el-switch-color":"#13ce66","--el-switch-off-color":"#ff4949"}},null,8,["modelValue"]),Object(i["createElementVNode"])("div",u,[Object(i["createVNode"])(s,{min:7,max:18,modelValue:h.value,"onUpdate:modelValue":a[1]||(a[1]=e=>h.value=e),step:1,"step-strictly":"",onChange:p},null,8,["modelValue"])])])):Object(i["createCommentVNode"])("",!0)],64)}}},d=(r("2b3b"),r("d959")),f=r.n(d);const p=f()(h,[["__scopeId","data-v-26606100"]]);t["a"]=p},b9a2:function(e,t,r){"use strict";r("2ae1")},bb77:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAYAAADJViUEAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGqSURBVCiRpZNNSxtRFIafyU2ik0lmMimaqBjq58KFKy0uCmaVTVUQqSLd2n26KHRl+wcKbiWC0GWXguLCnWAtYim4aEMXLZZ8qLGINR91MpMudKYOiaD0rM5973nOOe+FK2np5FwdloAYd4+CBClJTSfz9wSdBt6boOKTeTE8y0xfgl61k9+lY0JKO9s/PrOyt8b6+S5G3bTLY6Jlqu+NfVpOvGRhaBKfVaV8ukv202u8UoSu2CCJnjEquTL71W/OaI+dRGWdmd4EAEatQkloCLmbkpAxLYOoGmF6cJx2EXZgr50MhLsdUQ/F0UNxaBtxmRR+QdgT5Ng8+wc/7hjmefwp+9kMbQHVBVjUqV37rFgwH5ng/a8NvhiHV7DikwmIVh4ENeLa7Q+/+fEDfhRaJB8AkppO1u3Lg7l3nBUsDssFctUT/piXAISFgmbofD//ymJutdGzHflqkWd7r1zaZGCM6dgTZ/1bYV0OsjW+3LBy9rQIFbfWAD/q72lml9GBh7xdz7g0T9PKO4Zr8k7+gHzupGmhYdb4eXHk0v7rY3gkSAGF+4ISpP4CnuF/V7XaAZMAAAAASUVORK5CYII="},bd59:function(e,t,r){},bf66:function(e,t,r){},bfe1:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAoCAYAAAALz1FrAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABVxJREFUeNq0V2tsFFUUPjP7bsHSltIa2mLREkSJoqE1WxGxQGwNJSkaXSMSpQrGqrUaiyA/NK1ATCgxRAjgo9akYmwjKA8Li0paFHy0sEaBohURLX3RIm73MTvjOXdnZmd2t91dU0/y5e59zPnuPefcc89y/xQXQLgkO0+wFucs2BQjliLsiBxECmIYcQFxDLEH4cRvvPSNJEkR+rhoJCgmxDOIGsQUiC19iI2IrUmHj/uikuCEOuBeWJiPzW7EHEhcOhAO1HdGO2jUdpBgLjYHEWnqLtLSwTBvARjuuBP43DyApGSAK0Mgnu+GwDftEPiyFSS3W1lOGzuGeu5Fom8jToIT12P/a0RG0GBmMD1aAaZlDgCzedStS39fAf8720H4rIUcojWfHfWe0/qETkQ2u40NXpMClrrNwN94c9x2CnxxCLybXgUQ/MrQD4hCJBJ4eeAphYBOYKmrT4iAxLBgEZhfWKcdIn2V9INIyBYvq2H12CokuClkjsEBGHmgFAInO9SxkSceAW/9pggi46ISRKl26CV0g5lIShDXMjNNyQJT+YO6D/3NGGiT0oCfMTNoFiSTuruCvtjbwiB2nQ3FfsXTyGZSuqS3lHxxn7qTkjLtAhAv/gHC7gawbmsE7xu1YCyaD0L7V8ClprN54dMWRmj8aH/oTqRPBoN9HgSOHlGGSukkc1W7Ftp1p/DVbwT+roUg9veBePQwCAf2guTCk1weCJplaBBMz9awMNf5p6BI2y0gkmlKj582XX9Tp+YEydZXg3FlJUjDQ2B+pY4ppjFu9hwwlZVH+IbP0+nJJZJU9tNmA7BYdIstz9cwE3F5+WB2LAfbzg+Aw8tIZiKT0al8TY06n7DNpUzSdlPJJ1cRE8CL+U0ScQUfin10sn/7FuDt88G38y0Q/7rIFJtWVzG7C4cOgNC4C4S3t4IN/aKYTfJ4dImENPYGvSyCdKlHf5v7+9RbzWVmgaWyGqzvNzPnjyy5m623bNkB1oZmnV8k3Iw2eRJJp7pzV6c+7osXM6Vmx4pQxJ09zfoUcXSywPcngJ+arftO1Ov5kczVjmDeCzgPqpeJwtezYlnImRhlhtsLwL/nYxZp1CcyPn9GWH4JgIApRiNHKHdRCP2qZGTrm7uAnzU7eA+crcDPnBW5U3S0r6mBkVHUUVAoIuz/BHybN6hdxHQlQTYhHmI7zr0OTdGAoWWNma9oE9zkDDDcEnx6pN4e8Kxaznwoy4eYIB1KKK1HsJAQf/8NvK+txXzii0lCPlMJhi6Dd121loD0rVUSJMh5v0o16/F28LyIlw/9Eo+IP7nA81wFiN2/aIerUG93xPOLGfM9bEKhhHnMuPR+MC0pBy47N+y1kjDSfsYE2sTeEtAXEO+izsejPr8oT8oVyT1Bo/tBQCUELiMT+GycmjCRpRcJn19qowhlxtWxCgkqeVopsf2HQoJqqcWobziekihDrqluSIDgnPyu90UkzDHqqBK5jUfY+mgEY5EoO6NM4I9BQPPlSmWSKAlJG6I2xppaJGgbawEfhylepyQ3yhyNb4ilIB4Syj9rRplbg6fwjwcJyT7EqbCxU0iwL56P+QRCdEeM/riQNFOaUpKK3B93EnqbXRqH9/wfJCTfye1Jli44LioinoSxNOJfNJpPogeTKtDTRbf25ljN8KfX15/f1pkjX0R6eNzKexT13RlFOZ0wEzFRO47KLxHJBY/vPFVqMtSCU6583PGaKy2cgORhV1erc3B4JbafR/mG/h1kxX0S+d9tMhWROs97/YGyjjOjpRCKvIFoE1z4X+Iwx9m0PqFaWj49fRSQ4ZFxVQnxcJ3/CjAA4YgICJjJcpQAAAAASUVORK5CYII="},cac2:function(e,t,r){"use strict";r("b47a")},cb94:function(e,t,r){"use strict";r("56bf")},cbd0:function(e,t,r){},d3a3:function(e,t,r){},d3e1:function(e,t,r){},d570:function(e,t,r){},d7c3:function(e,t,r){"use strict";var i=r("7a23"),n=r("4220"),a=r("5d2d"),o=r("7902"),s=r("762f"),l=r("1d22"),c=r("3ef4"),u={__name:"sendFqzl",props:{itemData:{type:Object,default:()=>{}},identification:{type:String,default:""},tacitly:{type:Object,default:()=>{}}},emits:["handleClose"],setup(e,{expose:t,emit:r}){const u=e,h=Object(i["ref"])({}),d=(Object(i["ref"])(""),Object(i["ref"])()),f=Object(i["ref"])(),p=Object(i["ref"])([{label:"标题",prop:"title",type:"input",width:"40%"},{label:"接收单位",prop:"zrSsbmdm",type:"slot",width:"40%"},{label:"指令状态",prop:"status",type:"input",width:"40%"},{label:"人员选择",prop:"ry",type:"slot",width:"40%"},{label:"附件",prop:"attachmentPath",type:"upload"},{label:"指令内容",prop:"instructionContent",type:"textarea",width:"100%"}]),m=Object(i["reactive"])({title:[{required:!0,message:"请输入指令标题",trigger:"blur"}],zrSsbmdm:[{required:!0,message:"请选择接收单位",trigger:"blur"}],instructionContent:[{required:!0,message:"请输入指令内容",trigger:"blur"}],ry:[{required:!0,message:"请选择人员",trigger:"blur"}]}),g=Object(a["a"])("deptId"),v=()=>{d.value.submit(async e=>{if(e){const e={...h.value};delete e.ry;const i={instructionsEntity:{unitCode:g[0].deptCode,unitName:g[0].deptName,...e,receivingUnitCode:h.value.zrSsbmdm.toString(),receivingUnit:h.value.receivingUnit.toString(),attachmentPath:JSON.stringify(h.value.attachmentPath)},id:u.itemData.id,personnelEntity:f.value};try{let e;switch(u.identification){case"yj":e=await Object(n["i"])(i);break;case"zdrfj":e=await Object(n["a"])(i);break;case"qbcj":e=await Object(n["b"])(i);break}const t=JSON.parse(e);200==t.code?(c["a"].success("发送成功"),h.value={},h.value.attachmentPath="",r("handleClose")):c["a"].error(t.msg)}catch(t){console.log(t)}}})};console.log(u.itemData),Object(i["watch"])(()=>u.itemData,e=>{h.value.title=e[u.tacitly["title"]],u.tacitly["instructionContent"]&&(h.value.instructionContent=e[u.tacitly["instructionContent"]])},{deep:!0,immediate:!0});const _=Object(i["ref"])(!1),y=Object(i["ref"])([]),x=e=>{f.value=e.map((e,t)=>({name:e.userName,idNumber:e.idEntityCard,phoneNumber:e.mobile,personTypeId:"",personTypeName:"",domicilePlace:"",orderId:t+1})),h.value.ry=f.value.map(e=>e.name)},b=e=>{h.value.receivingUnit=e.map(e=>e.orgName)},T=()=>{h.value={},h.value.attachmentPath=""};return t({getsendFqzl:v,close:T}),(e,t)=>{const r=Object(i["resolveComponent"])("el-input");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[Object(i["createVNode"])(l["a"],{modelValue:h.value,"onUpdate:modelValue":t[3]||(t[3]=e=>h.value=e),formList:p.value,labelWidth:"100px",ref_key:"elform",ref:d,rules:m},{zrSsbmdm:Object(i["withCtx"])(()=>[Object(i["createVNode"])(o["c"],{filterable:"",modelValue:h.value.zrSsbmdm,"onUpdate:modelValue":t[0]||(t[0]=e=>h.value.zrSsbmdm=e),width:"100%",onGetDepValue:b,clearable:"",placeholder:"请选择所属部门",multiple:!0},null,8,["modelValue"])]),ry:Object(i["withCtx"])(()=>[Object(i["createVNode"])(r,{readonly:"",modelValue:h.value.ry,"onUpdate:modelValue":t[1]||(t[1]=e=>h.value.ry=e),onClick:t[2]||(t[2]=e=>_.value=!0),placeholder:"请选择民警"},null,8,["modelValue"])]),_:1},8,["modelValue","formList","rules"]),Object(i["createVNode"])(s["a"],{modelValue:_.value,"onUpdate:modelValue":t[4]||(t[4]=e=>_.value=e),onChoosedUsers:x,roleIds:y.value,Single:!1},null,8,["modelValue","roleIds"])],64)}}};const h=u;t["a"]=h},d8f9:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAYAAADJViUEAAAACXBIWXMAAAsTAAALEwEAmpwYAAABm0lEQVQokY2RPUxTURiGn3O41sZ7U8sl4dpKQ4hKSsPCz+RCRJSyGCIOLA4aNSkTkMDkxAAJCTMBBhwc2IyDS8V0AQZjulEZGEgYBJZaU2vb2x+Hhqbn3ovxm77zvu9zvnznCD1hAgwCLwALYDE+3xMOhvyzOwvfcdc5sA2khZ4wp4AdQLt0373c4tnwU4yZDg8WgAowKYHlVhDg20m62cfCfV6wBqxJ4F6r6tN83LXuALAQn+Pr2z0Mv4EmNecFvUJPmPVW5dZNi+OVjJLKF/NU61WGl+7zI3emjFfqzcgrAD6kP1K0S9TqNaxAJ2OxUSYHn7Ce2mxmpRMe6h5oGEIiBLRJSb6UB2Cif9y1uFLZ31kAavUadrUCwLW2asMrZP8N324PN3shhOKFgyHl7HqwR7GHvH+9jX5dV4LlSpnpjeckD3ebmmvnz5kv/PyTc8oU7aICesKA158ihTsqAdspWoFOV9DwG07J1oADYKRVXf60SsTsUpLnvy6c8L7QE2YUSAIR17ir6xR4rAFHQBR4ANz4D7AApIDCX7p2ZcHVjP67AAAAAElFTkSuQmCC"},dab1:function(e,t){e.exports="data:image/png;base64,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"},dd70:function(e,t){e.exports="data:image/png;base64,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"},e767:function(e,t,r){"use strict";var i=r("7a23"),n=r("313e"),a=r("aa74"),o=r("22b4"),s=(r("1be7"),r("f95e")),l=r("5e81"),c=r("ee29");Object(o["a"])([s["a"],l["a"]]);function u(e,t,r){"object"==typeof t&&(r=t,t=null);var i,n=this;if(!(e instanceof Function))for(var a in i=[],e)e.hasOwnProperty(a)&&i.push(a);var o=function(t){if(n.apply(this,arguments),e instanceof Function?h(this,e.call(this,t)):d(this,e,i),this.constructor===o)for(var r=o.__initializers__,a=0;a=this._maxSize&&r>0){var i=this._list.head;this._list.remove(i),delete this._map[i.key]}var n=this._list.insert(t);n.key=e,this._map[e]=n}},N.prototype.get=function(e){var t=this._map[e];if(this._map.hasOwnProperty(e))return t!==this._list.tail&&(this._list.remove(t),this._list.insertEntry(t)),t.value},N.prototype.remove=function(e){var t=this._map[e];"undefined"!==typeof t&&(delete this._map[e],this._list.remove(t))},N.prototype.clear=function(){this._list.clear(),this._map={}};var R=N,P={},I={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function B(e){return e=Math.round(e),e<0?0:e>255?255:e}function j(e){return e=Math.round(e),e<0?0:e>360?360:e}function z(e){return e<0?0:e>1?1:e}function F(e){return e.length&&"%"===e.charAt(e.length-1)?B(parseFloat(e)/100*255):B(parseInt(e,10))}function V(e){return e.length&&"%"===e.charAt(e.length-1)?z(parseFloat(e)/100):z(parseFloat(e))}function k(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function U(e,t,r){return e+(t-e)*r}function G(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function H(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var W=new R(20),X=null;function q(e,t){X&&H(X,t),X=W.put(e,X||t.slice())}function Z(e,t){var r=(parseFloat(e[0])%360+360)%360/360,i=V(e[1]),n=V(e[2]),a=n<=.5?n*(i+1):n+i-n*i,o=2*n-a;return t=t||[],G(t,B(255*k(o,a,r+1/3)),B(255*k(o,a,r)),B(255*k(o,a,r-1/3)),1),4===e.length&&(t[3]=e[3]),t}function Y(e){if(e){var t,r,i=e[0]/255,n=e[1]/255,a=e[2]/255,o=Math.min(i,n,a),s=Math.max(i,n,a),l=s-o,c=(s+o)/2;if(0===l)t=0,r=0;else{r=c<.5?l/(s+o):l/(2-s-o);var u=((s-i)/6+l/2)/l,h=((s-n)/6+l/2)/l,d=((s-a)/6+l/2)/l;i===s?t=d-h:n===s?t=1/3+u-d:a===s&&(t=2/3+h-u),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,r,c];return null!=e[3]&&f.push(e[3]),f}}P.parse=function(e,t){if(e){t=t||[];var r=W.get(e);if(r)return H(t,r);e+="";var i=e.replace(/ /g,"").toLowerCase();if(i in I)return H(t,I[i]),q(e,t),t;if("#"!==i.charAt(0)){var n=i.indexOf("("),a=i.indexOf(")");if(-1!==n&&a+1===i.length){var o=i.substr(0,n),s=i.substr(n+1,a-(n+1)).split(","),l=1;switch(o){case"rgba":if(4!==s.length)return void G(t,0,0,0,1);l=V(s.pop());case"rgb":return 3!==s.length?void G(t,0,0,0,1):(G(t,F(s[0]),F(s[1]),F(s[2]),l),q(e,t),t);case"hsla":return 4!==s.length?void G(t,0,0,0,1):(s[3]=V(s[3]),Z(s,t),q(e,t),t);case"hsl":return 3!==s.length?void G(t,0,0,0,1):(Z(s,t),q(e,t),t);default:return}}G(t,0,0,0,1)}else{if(4===i.length){var c=parseInt(i.substr(1),16);return c>=0&&c<=4095?(G(t,(3840&c)>>4|(3840&c)>>8,240&c|(240&c)>>4,15&c|(15&c)<<4,1),q(e,t),t):void G(t,0,0,0,1)}if(7===i.length){c=parseInt(i.substr(1),16);return c>=0&&c<=16777215?(G(t,(16711680&c)>>16,(65280&c)>>8,255&c,1),q(e,t),t):void G(t,0,0,0,1)}}}},P.parseToFloat=function(e,t){if(t=P.parse(e,t),t)return t[0]/=255,t[1]/=255,t[2]/=255,t},P.lift=function(e,t){var r=P.parse(e);if(r){for(var i=0;i<3;i++)r[i]=t<0?r[i]*(1-t)|0:(255-r[i])*t+r[i]|0;return P.stringify(r,4===r.length?"rgba":"rgb")}},P.toHex=function(e){var t=P.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},P.fastLerp=function(e,t,r){if(t&&t.length&&e>=0&&e<=1){r=r||[];var i=e*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=t[n],s=t[a],l=i-n;return r[0]=B(U(o[0],s[0],l)),r[1]=B(U(o[1],s[1],l)),r[2]=B(U(o[2],s[2],l)),r[3]=z(U(o[3],s[3],l)),r}},P.fastMapToColor=P.fastLerp,P.lerp=function(e,t,r){if(t&&t.length&&e>=0&&e<=1){var i=e*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=P.parse(t[n]),s=P.parse(t[a]),l=i-n,c=P.stringify([B(U(o[0],s[0],l)),B(U(o[1],s[1],l)),B(U(o[2],s[2],l)),z(U(o[3],s[3],l))],"rgba");return r?{color:c,leftIndex:n,rightIndex:a,value:i}:c}},P.mapToColor=P.lerp,P.modifyHSL=function(e,t,r,i){if(e=P.parse(e),e)return e=Y(e),null!=t&&(e[0]=j(t)),null!=r&&(e[1]=V(r)),null!=i&&(e[2]=V(i)),P.stringify(Z(e),"rgba")},P.modifyAlpha=function(e,t){if(e=P.parse(e),e&&null!=t)return e[3]=z(t),P.stringify(e,"rgba")},P.stringify=function(e,t){if(e&&e.length){var r=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(r+=","+e[3]),t+"("+r+")"}};var K=P,Q=K.parseToFloat,J={};function $(e){var t=Object.keys(e);t.sort();for(var r=[],i=0;i=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(e,t){if("object"===typeof e)for(var r in e){var i=e[r];this.setUniform(r,i)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var r=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var i=this.uniforms;this._enabledUniforms=Object.keys(i),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(e){var t=this.uniforms[e].type;return"t"===t||"tv"===t}),this);var n=this.vertexDefines,a=this.fragmentDefines;if(this.vertexDefines=b.clone(e.vertexDefines),this.fragmentDefines=b.clone(e.fragmentDefines),t){for(var o in r)i[o]&&(i[o].value=r[o].value);b.defaults(this.vertexDefines,n),b.defaults(this.fragmentDefines,a)}var s={};for(var l in e.textures)s[l]={shaderType:e.textures[l].shaderType,type:e.textures[l].type,enabled:!(!t||!this._textureStatus[l])&&this._textureStatus[l].enabled};this._textureStatus=s,this._programKey=""},clone:function(){var e=new this.constructor({name:this.name,shader:this.shader});for(var t in this.uniforms)e.uniforms[t].value=this.uniforms[t].value;return e.depthTest=this.depthTest,e.depthMask=this.depthMask,e.transparent=this.transparent,e.blend=this.blend,e.vertexDefines=b.clone(this.vertexDefines),e.fragmentDefines=b.clone(this.fragmentDefines),e.enableTexture(this.getEnabledTextures()),e.precision=this.precision,e},define:function(e,t,r){var i=this.vertexDefines,n=this.fragmentDefines;"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<3&&(r=t,t=e,e="both"),r=null!=r?r:null,"vertex"!==e&&"both"!==e||i[t]!==r&&(i[t]=r,this._programKey=""),"fragment"!==e&&"both"!==e||n[t]!==r&&(n[t]=r,"both"!==e&&(this._programKey=""))},undefine:function(e,t){"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<2&&(t=e,e="both"),"vertex"!==e&&"both"!==e||this.isDefined("vertex",t)&&(delete this.vertexDefines[t],this._programKey=""),"fragment"!==e&&"both"!==e||this.isDefined("fragment",t)&&(delete this.fragmentDefines[t],"both"!==e&&(this._programKey=""))},isDefined:function(e,t){switch(e){case"vertex":return void 0!==this.vertexDefines[t];case"fragment":return void 0!==this.fragmentDefines[t]}},getDefine:function(e,t){switch(e){case"vertex":return this.vertexDefines[t];case"fragment":return this.fragmentDefines[t]}},enableTexture:function(e){if(Array.isArray(e))for(var t=0;t0&&(n=1/Math.sqrt(n),e[0]=t[0]*n,e[1]=t[1]*n),e},oe.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},oe.cross=function(e,t,r){var i=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=i,e},oe.lerp=function(e,t,r,i){var n=t[0],a=t[1];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e},oe.random=function(e,t){t=t||1;var r=2*GLMAT_RANDOM()*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e},oe.transformMat2=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n,e[1]=r[1]*i+r[3]*n,e},oe.transformMat2d=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n+r[4],e[1]=r[1]*i+r[3]*n+r[5],e},oe.transformMat3=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[3]*n+r[6],e[1]=r[1]*i+r[4]*n+r[7],e},oe.transformMat4=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e},oe.forEach=function(){var e=oe.create();return function(t,r,i,n,a,o){var s,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,s=i;s0&&i.push("#define "+n.toUpperCase()+"_COUNT "+a)}if(r)for(var o=0;oc.getMaxJointNumber()&&(f.USE_SKIN_MATRICES_TEXTURE=null),d+="\n"+Te(f)+"\n"}a&&(d+="\n#define INSTANCING\n");var p=d+Te(t.vertexDefines,l,h),m=d+Te(t.fragmentDefines,l,h),g=p+"\n"+t.shader.vertex,v=["OES_standard_derivatives","EXT_shader_texture_lod"].filter((function(e){return null!=c.getGLExtension(e)}));v.indexOf("EXT_shader_texture_lod")>=0&&(m+="\n#define SUPPORT_TEXTURE_LOD"),v.indexOf("OES_standard_derivatives")>=0&&(m+="\n#define SUPPORT_STANDARD_DERIVATIVES");var _=we(v)+"\n"+Se(t.precision)+"\n"+m+"\n"+t.shader.fragment,y=be(g,t.vertexDefines,l),x=be(_,t.fragmentDefines,l);s=new ye;s.uniformSemantics=t.shader.uniformSemantics,s.attributes=t.shader.attributes;var b=s.buildProgram(u,t.shader,y,x);return s.__error=b,i[o]=s,s};var Ae=Ee,Ce=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,Oe=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,Me=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,De={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"};function Le(e){for(var t=[],r=0;r=0){if(f!==l&&f!==h){ke();break}f=c,m=[]}else if(f!==l)if(f!==h)g(v),f=s;else{var _=v;Re.indexOf(_)>=0||Pe.indexOf(_)>=0||Ie.indexOf(_)>=0?p[o].semantic=_:"ignore"===_||"unconfigurable"===_?p[o].ignore=!0:p[o].value="bool"===e?"true"===_:parseFloat(_)}else p[o].value="bool"===e?"true"===v:parseFloat(v),m=null;else{if(f!==c){ke();break}if(!(m instanceof Array)){ke();break}m.push(+i[++a])}else p[o].value=new M["a"].Float32Array(m),m=null,f=d;else if(f===c){if(!(m instanceof Array)){ke();break}m.push(+i[++a])}else f=d;else f=h;else{if(f!==s&&f!==u){ke();break}f=l}}return p}function Ge(e,t){"object"===typeof e&&(t=e.fragment,e=e.vertex),e=Ve(e),t=Ve(t),this._shaderID=Fe(e,t),this._vertexCode=Ge.parseImport(e),this._fragmentCode=Ge.parseImport(t),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}Ge.prototype={constructor:Ge,createUniforms:function(){var e={};for(var t in this.uniformTemplates){var r=this.uniformTemplates[t];e[t]={type:r.type,value:r.value()}}return e},_parseImport:function(){this._vertexCode=Ge.parseImport(this.vertex),this._fragmentCode=Ge.parseImport(this.fragment)},_addSemanticUniform:function(e,t,r){if(Re.indexOf(r)>=0)this.attributeSemantics[r]={symbol:e,type:t};else if(Ie.indexOf(r)>=0){var i=!1,n=r;r.match(/TRANSPOSE$/)&&(i=!0,n=r.slice(0,-9)),this.matrixSemantics[r]={symbol:e,type:t,isTranspose:i,semanticNoTranspose:n}}else Pe.indexOf(r)>=0&&(this.uniformSemantics[r]={symbol:e,type:t})},_addMaterialUniform:function(e,t,r,i,n,a){a[e]={type:r,value:n?Ne["array"]:i||Ne[t],semantic:null}},_parseUniforms:function(){var e={},t=this,r="vertex";function i(e){return null!=e?function(){return e}:null}function n(n,a,o){var s=Ue(a,o),l=[];for(var c in s){var u=s[c],h=u.semantic,d=c,f=De[a],p=i(s[c].value);s[c].isArray&&(d+="["+s[c].arraySize+"]",f+="v"),l.push(d),t._uniformList.push(c),u.ignore||("sampler2D"!==a&&"samplerCube"!==a||(t.textures[c]={shaderType:r,type:a}),h?t._addSemanticUniform(c,f,h):t._addMaterialUniform(c,a,f,p,s[c].isArray,e))}return l.length>0?"uniform "+a+" "+l.join(",")+";\n":""}this._uniformList=[],this._vertexCode=this._vertexCode.replace(Ce,n),r="fragment",this._fragmentCode=this._fragmentCode.replace(Ce,n),t.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=e},_parseAttributes:function(){var e={},t=this;function r(r,i,n){var a=Ue(i,n),o=Be[i]||1,s=[];for(var l in a){var c=a[l].semantic;if(e[l]={type:"float",size:o,semantic:c||null},c){if(Re.indexOf(c)<0)throw new Error('Unkown semantic "'+c+'"');t.attributeSemantics[c]={symbol:l,type:i}}s.push(l)}return"attribute "+i+" "+s.join(",")+";\n"}this._vertexCode=this._vertexCode.replace(Oe,r),this.attributes=e},_parseDefines:function(){var e=this,t="vertex";function r(r,i,n){var a="vertex"===t?e.vertexDefines:e.fragmentDefines;return a[i]||(a[i]="false"!==n&&("true"===n||(n?isNaN(parseFloat(n))?n.trim():parseFloat(n):null))),""}this._vertexCode=this._vertexCode.replace(Me,r),t="fragment",this._fragmentCode=this._fragmentCode.replace(Me,r)},clone:function(){var e=ze[this._shaderID],t=new Ge(e.vertex,e.fragment);return t}},Object.defineProperty&&(Object.defineProperty(Ge.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(Ge.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(Ge.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(Ge.prototype,"uniforms",{get:function(){return this._uniformList}}));var He=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;Ge.parseImport=function(e){return e=e.replace(He,(function(e,t,r){e=Ge.source(r);return e?Ge.parseImport(e):(console.error('Shader chunk "'+r+'" not existed in library'),"")})),e};var We=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;Ge["import"]=function(e){e.replace(We,(function(e,t,r,i){i=i.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"");if(i){var n,a=r.split("."),o=Ge.codes,s=0;while(s 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n}\n@end",Ze={create:function(){var e=new ne(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},clone:function(e){var t=new ne(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},transpose:function(e,t){if(e===t){var r=t[1],i=t[2],n=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=n,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},invert:function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],v=t[15],_=r*s-i*o,y=r*l-n*o,x=r*c-a*o,b=i*l-n*s,T=i*c-a*s,w=n*c-a*l,S=u*m-h*p,E=u*g-d*p,A=u*v-f*p,C=h*g-d*m,O=h*v-f*m,M=d*v-f*g,D=_*M-y*O+x*C+b*A-T*E+w*S;return D?(D=1/D,e[0]=(s*M-l*O+c*C)*D,e[1]=(n*O-i*M-a*C)*D,e[2]=(m*w-g*T+v*b)*D,e[3]=(d*T-h*w-f*b)*D,e[4]=(l*A-o*M-c*E)*D,e[5]=(r*M-n*A+a*E)*D,e[6]=(g*x-p*w-v*y)*D,e[7]=(u*w-d*x+f*y)*D,e[8]=(o*O-s*A+c*S)*D,e[9]=(i*A-r*O-a*S)*D,e[10]=(p*T-m*x+v*_)*D,e[11]=(h*x-u*T-f*_)*D,e[12]=(s*E-o*C-l*S)*D,e[13]=(r*C-i*E+n*S)*D,e[14]=(m*y-p*b-g*_)*D,e[15]=(u*b-h*y+d*_)*D,e):null},adjoint:function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],v=t[15];return e[0]=s*(d*v-f*g)-h*(l*v-c*g)+m*(l*f-c*d),e[1]=-(i*(d*v-f*g)-h*(n*v-a*g)+m*(n*f-a*d)),e[2]=i*(l*v-c*g)-s*(n*v-a*g)+m*(n*c-a*l),e[3]=-(i*(l*f-c*d)-s*(n*f-a*d)+h*(n*c-a*l)),e[4]=-(o*(d*v-f*g)-u*(l*v-c*g)+p*(l*f-c*d)),e[5]=r*(d*v-f*g)-u*(n*v-a*g)+p*(n*f-a*d),e[6]=-(r*(l*v-c*g)-o*(n*v-a*g)+p*(n*c-a*l)),e[7]=r*(l*f-c*d)-o*(n*f-a*d)+u*(n*c-a*l),e[8]=o*(h*v-f*m)-u*(s*v-c*m)+p*(s*f-c*h),e[9]=-(r*(h*v-f*m)-u*(i*v-a*m)+p*(i*f-a*h)),e[10]=r*(s*v-c*m)-o*(i*v-a*m)+p*(i*c-a*s),e[11]=-(r*(s*f-c*h)-o*(i*f-a*h)+u*(i*c-a*s)),e[12]=-(o*(h*g-d*m)-u*(s*g-l*m)+p*(s*d-l*h)),e[13]=r*(h*g-d*m)-u*(i*g-n*m)+p*(i*d-n*h),e[14]=-(r*(s*g-l*m)-o*(i*g-n*m)+p*(i*l-n*s)),e[15]=r*(s*d-l*h)-o*(i*d-n*h)+u*(i*l-n*s),e},determinant:function(e){var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15],v=t*o-r*a,_=t*s-i*a,y=t*l-n*a,x=r*s-i*o,b=r*l-n*o,T=i*l-n*s,w=c*p-u*f,S=c*m-h*f,E=c*g-d*f,A=u*m-h*p,C=u*g-d*p,O=h*g-d*m;return v*O-_*C+y*A+x*E-b*S+T*w},multiply:function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],_=t[15],y=r[0],x=r[1],b=r[2],T=r[3];return e[0]=y*i+x*s+b*h+T*m,e[1]=y*n+x*l+b*d+T*g,e[2]=y*a+x*c+b*f+T*v,e[3]=y*o+x*u+b*p+T*_,y=r[4],x=r[5],b=r[6],T=r[7],e[4]=y*i+x*s+b*h+T*m,e[5]=y*n+x*l+b*d+T*g,e[6]=y*a+x*c+b*f+T*v,e[7]=y*o+x*u+b*p+T*_,y=r[8],x=r[9],b=r[10],T=r[11],e[8]=y*i+x*s+b*h+T*m,e[9]=y*n+x*l+b*d+T*g,e[10]=y*a+x*c+b*f+T*v,e[11]=y*o+x*u+b*p+T*_,y=r[12],x=r[13],b=r[14],T=r[15],e[12]=y*i+x*s+b*h+T*m,e[13]=y*n+x*l+b*d+T*g,e[14]=y*a+x*c+b*f+T*v,e[15]=y*o+x*u+b*p+T*_,e},multiplyAffine:function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[4],s=t[5],l=t[6],c=t[8],u=t[9],h=t[10],d=t[12],f=t[13],p=t[14],m=r[0],g=r[1],v=r[2];return e[0]=m*i+g*o+v*c,e[1]=m*n+g*s+v*u,e[2]=m*a+g*l+v*h,m=r[4],g=r[5],v=r[6],e[4]=m*i+g*o+v*c,e[5]=m*n+g*s+v*u,e[6]=m*a+g*l+v*h,m=r[8],g=r[9],v=r[10],e[8]=m*i+g*o+v*c,e[9]=m*n+g*s+v*u,e[10]=m*a+g*l+v*h,m=r[12],g=r[13],v=r[14],e[12]=m*i+g*o+v*c+d,e[13]=m*n+g*s+v*u+f,e[14]=m*a+g*l+v*h+p,e}};Ze.mul=Ze.multiply,Ze.mulAffine=Ze.multiplyAffine,Ze.translate=function(e,t,r){var i,n,a,o,s,l,c,u,h,d,f,p,m=r[0],g=r[1],v=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*v+t[12],e[13]=t[1]*m+t[5]*g+t[9]*v+t[13],e[14]=t[2]*m+t[6]*g+t[10]*v+t[14],e[15]=t[3]*m+t[7]*g+t[11]*v+t[15]):(i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=i,e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=i*m+s*g+h*v+t[12],e[13]=n*m+l*g+d*v+t[13],e[14]=a*m+c*g+f*v+t[14],e[15]=o*m+u*g+p*v+t[15]),e},Ze.scale=function(e,t,r){var i=r[0],n=r[1],a=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},Ze.rotate=function(e,t,r,i){var n,a,o,s,l,c,u,h,d,f,p,m,g,v,_,y,x,b,T,w,S,E,A,C,O=i[0],M=i[1],D=i[2],L=Math.sqrt(O*O+M*M+D*D);return Math.abs(L)0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e},Ke.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},Ke.cross=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=n*l-a*s,e[1]=a*o-i*l,e[2]=i*s-n*o,e},Ke.lerp=function(e,t,r,i){var n=t[0],a=t[1],o=t[2];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=o+i*(r[2]-o),e},Ke.random=function(e,t){t=t||1;var r=2*ae()*Math.PI,i=2*ae()-1,n=Math.sqrt(1-i*i)*t;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=i*t,e},Ke.transformMat4=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[3]*i+r[7]*n+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/o,e[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/o,e[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/o,e},Ke.transformMat3=function(e,t,r){var i=t[0],n=t[1],a=t[2];return e[0]=i*r[0]+n*r[3]+a*r[6],e[1]=i*r[1]+n*r[4]+a*r[7],e[2]=i*r[2]+n*r[5]+a*r[8],e},Ke.transformQuat=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*i+s*a-l*n,h=c*n+l*i-o*a,d=c*a+o*n-s*i,f=-o*i-s*n-l*a;return e[0]=u*c+f*-o+h*-l-d*-s,e[1]=h*c+f*-s+d*-o-u*-l,e[2]=d*c+f*-l+u*-s-h*-o,e},Ke.rotateX=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},Ke.rotateY=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},Ke.rotateZ=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},Ke.forEach=function(){var e=Ke.create();return function(t,r,i,n,a,o){var s,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,s=i;s1?0:Math.acos(n)};var Qe=Ke;Xe["import"](qe);var Je=Ye.create,$e={};function et(e){return e.material}function tt(e,t,r){return t.uniforms[r].value}function rt(e,t,r,i){return r!==i}function it(e){return!0}function nt(){}var at={float:O.FLOAT,byte:O.BYTE,ubyte:O.UNSIGNED_BYTE,short:O.SHORT,ushort:O.UNSIGNED_SHORT};function ot(e,t,r){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=r,this.vao=null}function st(e){var t,r;this.bind=function(e){t||(t=M["a"].createCanvas(),t.width=t.height=1,t.getContext("2d"));var i=e.gl,n=!r;n&&(r=i.createTexture()),i.bindTexture(i.TEXTURE_2D,r),n&&i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t)},this.unbind=function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var lt=w.extend((function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:"undefined"!==typeof window&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},maxJointNumber:20,__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}}),(function(){this.canvas||(this.canvas=M["a"].createCanvas());var e=this.canvas;try{var t={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!this.gl)throw new Error;this._glinfo=new C(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(r){throw"Error creating WebGL Context "+r}this._programMgr=new Ae(this),this._placeholderTexture=new st(this)}),{resize:function(e,t){var r=this.canvas,i=this.devicePixelRatio;null!=e?(r.style&&(r.style.width=e+"px",r.style.height=t+"px"),r.width=e*i,r.height=t*i,this._width=e,this._height=t):(this._width=r.width/i,this._height=r.height/i),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var e=this.viewport;return e.width/e.height},setDevicePixelRatio:function(e){this.devicePixelRatio=e,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(e){return this._glinfo.getExtension(e)},getGLParameter:function(e){return this._glinfo.getParameter(e)},setViewport:function(e,t,r,i,n){if("object"===typeof e){var a=e;e=a.x,t=a.y,r=a.width,i=a.height,n=a.devicePixelRatio}n=n||this.devicePixelRatio,this.gl.viewport(e*n,t*n,r*n,i*n),this.viewport={x:e,y:t,width:r,height:i,devicePixelRatio:n}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var e=this._clearStack.pop();this.clearColor=e.clearColor,this.clearBit=e.clearBit}},bindSceneRendering:function(e){this._sceneRendering=e},render:function(e,t,r,i){var n=this.gl,a=this.clearColor;if(this.clearBit){n.colorMask(!0,!0,!0,!0),n.depthMask(!0);var o=this.viewport,s=!1,l=o.devicePixelRatio;(o.width!==this._width||o.height!==this._height||l&&l!==this.devicePixelRatio||o.x||o.y)&&(s=!0,n.enable(n.SCISSOR_TEST),n.scissor(o.x*l,o.y*l,o.width*l,o.height*l)),n.clearColor(a[0],a[1],a[2],a[3]),n.clear(this.clearBit),s&&n.disable(n.SCISSOR_TEST)}if(r||e.update(!1),e.updateLights(),t=t||e.getMainCamera(),t){t.update();var c=e.updateRenderList(t,!0);this._sceneRendering=e;var u=c.opaque,h=c.transparent,d=e.material;e.trigger("beforerender",this,e,t,c),i?(this.renderPreZ(u,e,t),n.depthFunc(n.LEQUAL)):n.depthFunc(n.LESS);for(var f=Je(),p=Qe.create(),m=0;m0){var s=e[n-1],l=s.joints?s.joints.length:0,c=a.joints?a.joints.length:0;if(c===l&&a.material===s.material&&a.lightGroup===s.lightGroup){a.__program=s.__program;continue}}var u=this._programMgr.getProgram(a,o,t);this.validateProgram(u),a.__program=u}},renderPass:function(e,t,r){this.trigger("beforerenderpass",this,e,t,r),r=r||{},r.getMaterial=r.getMaterial||et,r.getUniform=r.getUniform||tt,r.isMaterialChanged=r.isMaterialChanged||rt,r.beforeRender=r.beforeRender||nt,r.afterRender=r.afterRender||nt;var i=r.ifRender||it;this.updatePrograms(e,this._sceneRendering,r),r.sortCompare&&e.sort(r.sortCompare);var n=this.viewport,a=n.devicePixelRatio,o=[n.x*a,n.y*a,n.width*a,n.height*a],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],c=[o[2],o[3]],u=Date.now();t?(Ye.copy(ct.VIEW,t.viewMatrix.array),Ye.copy(ct.PROJECTION,t.projectionMatrix.array),Ye.copy(ct.VIEWINVERSE,t.worldTransform.array)):(Ye.identity(ct.VIEW),Ye.identity(ct.PROJECTION),Ye.identity(ct.VIEWINVERSE)),Ye.multiply(ct.VIEWPROJECTION,ct.PROJECTION,ct.VIEW),Ye.invert(ct.PROJECTIONINVERSE,ct.PROJECTION),Ye.invert(ct.VIEWPROJECTIONINVERSE,ct.VIEWPROJECTION);for(var h,d,f,p,m,g,v,_,y,x,b,T,w=this.gl,S=this._sceneRendering,E=null,A=0;Athis.getMaxJointNumber()){var a=n.getSubSkinMatricesTexture(e.__uid__,e.joints);t.useTextureSlot(this,a,r),t.setUniform(i,"1i","skinMatricesTexture",r),t.setUniform(i,"1f","skinMatricesTextureSize",a.width)}else{var o=n.getSubSkinMatrices(e.__uid__,e.joints);t.setUniformOfSemantic(i,"SKIN_MATRIX",o)}},_renderObject:function(e,t,r){var i=this.gl,n=e.geometry,a=e.mode;null==a&&(a=4);var o=null,s=e.isInstancedMesh&&e.isInstancedMesh();if(!s||(o=this.getGLExtension("ANGLE_instanced_arrays"),o)){var l;if(s&&(l=this._bindInstancedAttributes(e,r,o)),t.indicesBuffer){var c=this.getGLExtension("OES_element_index_uint"),u=c&&n.indices instanceof Uint32Array,h=u?i.UNSIGNED_INT:i.UNSIGNED_SHORT;s?o.drawElementsInstancedANGLE(a,t.indicesBuffer.count,h,0,e.getInstanceCount()):i.drawElements(a,t.indicesBuffer.count,h,0)}else s?o.drawArraysInstancedANGLE(a,0,n.vertexCount,e.getInstanceCount()):i.drawArrays(a,0,n.vertexCount);if(s)for(var d=0;dr?r:e}ht.add=function(e,t,r){return Qe.add(e.array,t.array,r.array),e._dirty=!0,e},ht.set=function(e,t,r,i){Qe.set(e.array,t,r,i),e._dirty=!0},ht.copy=function(e,t){return Qe.copy(e.array,t.array),e._dirty=!0,e},ht.cross=function(e,t,r){return Qe.cross(e.array,t.array,r.array),e._dirty=!0,e},ht.dist=function(e,t){return Qe.distance(e.array,t.array)},ht.distance=ht.dist,ht.div=function(e,t,r){return Qe.divide(e.array,t.array,r.array),e._dirty=!0,e},ht.divide=ht.div,ht.dot=function(e,t){return Qe.dot(e.array,t.array)},ht.len=function(e){return Qe.length(e.array)},ht.lerp=function(e,t,r,i){return Qe.lerp(e.array,t.array,r.array,i),e._dirty=!0,e},ht.min=function(e,t,r){return Qe.min(e.array,t.array,r.array),e._dirty=!0,e},ht.max=function(e,t,r){return Qe.max(e.array,t.array,r.array),e._dirty=!0,e},ht.mul=function(e,t,r){return Qe.multiply(e.array,t.array,r.array),e._dirty=!0,e},ht.multiply=ht.mul,ht.negate=function(e,t){return Qe.negate(e.array,t.array),e._dirty=!0,e},ht.normalize=function(e,t){return Qe.normalize(e.array,t.array),e._dirty=!0,e},ht.random=function(e,t){return Qe.random(e.array,t),e._dirty=!0,e},ht.scale=function(e,t,r){return Qe.scale(e.array,t.array,r),e._dirty=!0,e},ht.scaleAndAdd=function(e,t,r,i){return Qe.scaleAndAdd(e.array,t.array,r.array,i),e._dirty=!0,e},ht.sqrDist=function(e,t){return Qe.sqrDist(e.array,t.array)},ht.squaredDistance=ht.sqrDist,ht.sqrLen=function(e){return Qe.sqrLen(e.array)},ht.squaredLength=ht.sqrLen,ht.sub=function(e,t,r){return Qe.subtract(e.array,t.array,r.array),e._dirty=!0,e},ht.subtract=ht.sub,ht.transformMat3=function(e,t,r){return Qe.transformMat3(e.array,t.array,r.array),e._dirty=!0,e},ht.transformMat4=function(e,t,r){return Qe.transformMat4(e.array,t.array,r.array),e._dirty=!0,e},ht.transformQuat=function(e,t,r){return Qe.transformQuat(e.array,t.array,r.array),e._dirty=!0,e};var mt=Math.atan2,gt=Math.asin,vt=Math.abs;ht.eulerFromQuat=function(e,t,r){e._dirty=!0,t=t.array;var i=e.array,n=t[0],a=t[1],o=t[2],s=t[3],l=n*n,c=a*a,u=o*o,h=s*s;r=(r||"XYZ").toUpperCase();switch(r){case"XYZ":i[0]=mt(2*(n*s-a*o),h-l-c+u),i[1]=gt(pt(2*(n*o+a*s),-1,1)),i[2]=mt(2*(o*s-n*a),h+l-c-u);break;case"YXZ":i[0]=gt(pt(2*(n*s-a*o),-1,1)),i[1]=mt(2*(n*o+a*s),h-l-c+u),i[2]=mt(2*(n*a+o*s),h-l+c-u);break;case"ZXY":i[0]=gt(pt(2*(n*s+a*o),-1,1)),i[1]=mt(2*(a*s-o*n),h-l-c+u),i[2]=mt(2*(o*s-n*a),h-l+c-u);break;case"ZYX":i[0]=mt(2*(n*s+o*a),h-l-c+u),i[1]=gt(pt(2*(a*s-n*o),-1,1)),i[2]=mt(2*(n*a+o*s),h+l-c-u);break;case"YZX":i[0]=mt(2*(n*s-o*a),h-l+c-u),i[1]=mt(2*(a*s-n*o),h+l-c-u),i[2]=gt(pt(2*(n*a+o*s),-1,1));break;case"XZY":i[0]=mt(2*(n*s+a*o),h-l+c-u),i[1]=mt(2*(n*o+a*s),h+l-c-u),i[2]=gt(pt(2*(o*s-n*a),-1,1));break;default:console.warn("Unkown order: "+r)}return e},ht.eulerFromMat3=function(e,t,r){var i=t.array,n=i[0],a=i[3],o=i[6],s=i[1],l=i[4],c=i[7],u=i[2],h=i[5],d=i[8],f=e.array;r=(r||"XYZ").toUpperCase();switch(r){case"XYZ":f[1]=gt(pt(o,-1,1)),vt(o)<.99999?(f[0]=mt(-c,d),f[2]=mt(-a,n)):(f[0]=mt(h,l),f[2]=0);break;case"YXZ":f[0]=gt(-pt(c,-1,1)),vt(c)<.99999?(f[1]=mt(o,d),f[2]=mt(s,l)):(f[1]=mt(-u,n),f[2]=0);break;case"ZXY":f[0]=gt(pt(h,-1,1)),vt(h)<.99999?(f[1]=mt(-u,d),f[2]=mt(-a,l)):(f[1]=0,f[2]=mt(s,n));break;case"ZYX":f[1]=gt(-pt(u,-1,1)),vt(u)<.99999?(f[0]=mt(h,d),f[2]=mt(s,n)):(f[0]=0,f[2]=mt(-a,l));break;case"YZX":f[2]=gt(pt(s,-1,1)),vt(s)<.99999?(f[0]=mt(-c,l),f[1]=mt(-u,n)):(f[0]=0,f[1]=mt(o,d));break;case"XZY":f[2]=gt(-pt(a,-1,1)),vt(a)<.99999?(f[0]=mt(h,l),f[1]=mt(o,n)):(f[0]=mt(-c,d),f[1]=0);break;default:console.warn("Unkown order: "+r)}return e._dirty=!0,e},Object.defineProperties(ht,{POSITIVE_X:{get:function(){return new ht(1,0,0)}},NEGATIVE_X:{get:function(){return new ht(-1,0,0)}},POSITIVE_Y:{get:function(){return new ht(0,1,0)}},NEGATIVE_Y:{get:function(){return new ht(0,-1,0)}},POSITIVE_Z:{get:function(){return new ht(0,0,1)}},NEGATIVE_Z:{get:function(){return new ht(0,0,-1)}},UP:{get:function(){return new ht(0,1,0)}},ZERO:{get:function(){return new ht}}});var _t=ht,yt=1e-5,xt=function(e,t){this.origin=e||new _t,this.direction=t||new _t};xt.prototype={constructor:xt,intersectPlane:function(e,t){var r=e.normal.array,i=e.distance,n=this.origin.array,a=this.direction.array,o=Qe.dot(r,a);if(0===o)return null;t||(t=new _t);var s=(Qe.dot(r,n)-i)/o;return Qe.scaleAndAdd(t.array,n,a,-s),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=Qe.dot(e.normal.array,this.direction.array);Qe.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,2*-t),this.direction._dirty=!0},distanceToPoint:function(){var e=Qe.create();return function(t){Qe.sub(e,t,this.origin.array);var r=Qe.dot(e,this.direction.array);if(r<0)return Qe.distance(this.origin.array,t);var i=Qe.lenSquared(e);return Math.sqrt(i-r*r)}}(),intersectSphere:function(){var e=Qe.create();return function(t,r,i){var n=this.origin.array,a=this.direction.array;t=t.array,Qe.sub(e,t,n);var o=Qe.dot(e,a),s=Qe.squaredLength(e),l=s-o*o,c=r*r;if(!(l>c)){var u=Math.sqrt(c-l),h=o-u,d=o+u;return i||(i=new _t),h<0?d<0?null:(Qe.scaleAndAdd(i.array,n,a,d),i):(Qe.scaleAndAdd(i.array,n,a,h),i)}}}(),intersectBoundingBox:function(e,t){var r,i,n,a,o,s,l=this.direction.array,c=this.origin.array,u=e.min.array,h=e.max.array,d=1/l[0],f=1/l[1],p=1/l[2];if(d>=0?(r=(u[0]-c[0])*d,i=(h[0]-c[0])*d):(i=(u[0]-c[0])*d,r=(h[0]-c[0])*d),f>=0?(n=(u[1]-c[1])*f,a=(h[1]-c[1])*f):(a=(u[1]-c[1])*f,n=(h[1]-c[1])*f),r>a||n>i)return null;if((n>r||r!==r)&&(r=n),(a=0?(o=(u[2]-c[2])*p,s=(h[2]-c[2])*p):(s=(u[2]-c[2])*p,o=(h[2]-c[2])*p),r>s||o>i)return null;if((o>r||r!==r)&&(r=o),(s=0?r:i;return t||(t=new _t),Qe.scaleAndAdd(t.array,c,l,m),t},intersectTriangle:function(){var e=Qe.create(),t=Qe.create(),r=Qe.create(),i=Qe.create();return function(n,a,o,s,l,c){var u=this.direction.array,h=this.origin.array;n=n.array,a=a.array,o=o.array,Qe.sub(e,a,n),Qe.sub(t,o,n),Qe.cross(i,t,u);var d=Qe.dot(e,i);if(s){if(d>-yt)return null}else if(d>-yt&&d1)return null;Qe.cross(i,e,r);var p=Qe.dot(u,i)/d;if(p<0||p>1||f+p>1)return null;Qe.cross(i,e,t);var m=-Qe.dot(r,i)/d;return m<0?null:(l||(l=new _t),c&&_t.set(c,1-f-p,f,p),Qe.scaleAndAdd(l.array,h,u,m),l)}}(),applyTransform:function(e){_t.add(this.direction,this.direction,this.origin),_t.transformMat4(this.origin,this.origin,e),_t.transformMat4(this.direction,this.direction,e),_t.sub(this.direction,this.direction,this.origin),_t.normalize(this.direction,this.direction)},copy:function(e){_t.copy(this.origin,e.origin),_t.copy(this.direction,e.direction)},clone:function(){var e=new xt;return e.copy(this),e}};var bt=xt,Tt={create:function(){var e=new ne(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},clone:function(e){var t=new ne(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:function(e,t,r,i){var n=new ne(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},set:function(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},subtract:function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}};Tt.sub=Tt.subtract,Tt.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e},Tt.mul=Tt.multiply,Tt.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e},Tt.div=Tt.divide,Tt.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e},Tt.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e},Tt.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},Tt.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e},Tt.distance=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+i*i+n*n+a*a)},Tt.dist=Tt.distance,Tt.squaredDistance=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return r*r+i*i+n*n+a*a},Tt.sqrDist=Tt.squaredDistance,Tt.length=function(e){var t=e[0],r=e[1],i=e[2],n=e[3];return Math.sqrt(t*t+r*r+i*i+n*n)},Tt.len=Tt.length,Tt.squaredLength=function(e){var t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n},Tt.sqrLen=Tt.squaredLength,Tt.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},Tt.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},Tt.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r*r+i*i+n*n+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o),e},Tt.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},Tt.lerp=function(e,t,r,i){var n=t[0],a=t[1],o=t[2],s=t[3];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=o+i*(r[2]-o),e[3]=s+i*(r[3]-s),e},Tt.random=function(e,t){return t=t||1,e[0]=ae(),e[1]=ae(),e[2]=ae(),e[3]=ae(),Tt.normalize(e,e),Tt.scale(e,e,t),e},Tt.transformMat4=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*o,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*o,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*o,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*o,e},Tt.transformQuat=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*i+s*a-l*n,h=c*n+l*i-o*a,d=c*a+o*n-s*i,f=-o*i-s*n-l*a;return e[0]=u*c+f*-o+h*-l-d*-s,e[1]=h*c+f*-s+d*-o-u*-l,e[2]=d*c+f*-l+u*-s-h*-o,e},Tt.forEach=function(){var e=Tt.create();return function(t,r,i,n,a,o){var s,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,s=i;s.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(Qe.cross(e,n,a),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+o,At.normalize(i,i))}}(),At.setAxes=function(){var e=Et.create();return function(t,r,i,n){return e[0]=i[0],e[3]=i[1],e[6]=i[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],At.normalize(t,At.fromMat3(t,e))}}(),At.clone=wt.clone,At.fromValues=wt.fromValues,At.copy=wt.copy,At.set=wt.set,At.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},At.setAxisAngle=function(e,t,r){r*=.5;var i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e},At.add=wt.add,At.multiply=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+o*s+n*c-a*l,e[1]=n*u+o*l+a*s-i*c,e[2]=a*u+o*c+i*l-n*s,e[3]=o*u-i*s-n*l-a*c,e},At.mul=At.multiply,At.scale=wt.scale,At.rotateX=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*s,e[1]=n*l+a*s,e[2]=a*l-n*s,e[3]=o*l-i*s,e},At.rotateY=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-a*s,e[1]=n*l+o*s,e[2]=a*l+i*s,e[3]=o*l-n*s,e},At.rotateZ=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+n*s,e[1]=n*l-i*s,e[2]=a*l+o*s,e[3]=o*l-a*s,e},At.calculateW=function(e,t){var r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e},At.dot=wt.dot,At.lerp=wt.lerp,At.slerp=function(e,t,r,i){var n,a,o,s,l,c=t[0],u=t[1],h=t[2],d=t[3],f=r[0],p=r[1],m=r[2],g=r[3];return a=c*f+u*p+h*m+d*g,a<0&&(a=-a,f=-f,p=-p,m=-m,g=-g),1-a>1e-6?(n=Math.acos(a),o=Math.sin(n),s=Math.sin((1-i)*n)/o,l=Math.sin(i*n)/o):(s=1-i,l=i),e[0]=s*c+l*f,e[1]=s*u+l*p,e[2]=s*h+l*m,e[3]=s*d+l*g,e},At.invert=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r*r+i*i+n*n+a*a,s=o?1/o:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-n*s,e[3]=a*s,e},At.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},At.length=wt.length,At.len=At.length,At.squaredLength=wt.squaredLength,At.sqrLen=At.squaredLength,At.normalize=wt.normalize,At.fromMat3=function(e,t){var r,i=t[0]+t[4]+t[8];if(i>0)r=Math.sqrt(i+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[3*n+n]&&(n=2);var a=(n+1)%3,o=(n+2)%3;r=Math.sqrt(t[3*n+n]-t[3*a+a]-t[3*o+o]+1),e[n]=.5*r,r=.5/r,e[3]=(t[3*a+o]-t[3*o+a])*r,e[a]=(t[3*a+n]+t[3*n+a])*r,e[o]=(t[3*o+n]+t[3*n+o])*r}return e};var Ct=At,Ot=function(){this._axisX=new _t,this._axisY=new _t,this._axisZ=new _t,this.array=Ye.create(),this._dirty=!0};Ot.prototype={constructor:Ot,setArray:function(e){for(var t=0;t0){var t=this.min,r=this.max,i=t.array,n=r.array;jt(i,e[0]),jt(n,e[0]);for(var a=1;an[0]&&(n[0]=o[0]),o[1]>n[1]&&(n[1]=o[1]),o[2]>n[2]&&(n[2]=o[2])}t._dirty=!0,r._dirty=!0}},union:function(e){var t=this.min,r=this.max;return Qe.min(t.array,t.array,e.min.array),Qe.max(r.array,r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},intersection:function(e){var t=this.min,r=this.max;return Qe.max(t.array,t.array,e.min.array),Qe.min(r.array,r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,r=this.max.array,i=e.min.array,n=e.max.array;return!(t[0]>n[0]||t[1]>n[1]||t[2]>n[2]||r[0]=n[0]&&r[1]>=n[1]&&r[2]>=n[2]},containPoint:function(e){var t=this.min.array,r=this.max.array,i=e.array;return t[0]<=i[0]&&t[1]<=i[1]&&t[2]<=i[2]&&r[0]>=i[0]&&r[1]>=i[1]&&r[2]>=i[2]},isFinite:function(){var e=this.min.array,t=this.max.array;return isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])&&isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])},applyTransform:function(e){this.transformFrom(this,e)},transformFrom:function(){var e=Qe.create(),t=Qe.create(),r=Qe.create(),i=Qe.create(),n=Qe.create(),a=Qe.create();return function(o,s){var l=o.min.array,c=o.max.array,u=s.array;return e[0]=u[0]*l[0],e[1]=u[1]*l[0],e[2]=u[2]*l[0],t[0]=u[0]*c[0],t[1]=u[1]*c[0],t[2]=u[2]*c[0],r[0]=u[4]*l[1],r[1]=u[5]*l[1],r[2]=u[6]*l[1],i[0]=u[4]*c[1],i[1]=u[5]*c[1],i[2]=u[6]*c[1],n[0]=u[8]*l[2],n[1]=u[9]*l[2],n[2]=u[10]*l[2],a[0]=u[8]*c[2],a[1]=u[9]*c[2],a[2]=u[10]*c[2],l=this.min.array,c=this.max.array,l[0]=Math.min(e[0],t[0])+Math.min(r[0],i[0])+Math.min(n[0],a[0])+u[12],l[1]=Math.min(e[1],t[1])+Math.min(r[1],i[1])+Math.min(n[1],a[1])+u[13],l[2]=Math.min(e[2],t[2])+Math.min(r[2],i[2])+Math.min(n[2],a[2])+u[14],c[0]=Math.max(e[0],t[0])+Math.max(r[0],i[0])+Math.max(n[0],a[0])+u[12],c[1]=Math.max(e[1],t[1])+Math.max(r[1],i[1])+Math.max(n[1],a[1])+u[13],c[2]=Math.max(e[2],t[2])+Math.max(r[2],i[2])+Math.max(n[2],a[2])+u[14],this.min._dirty=!0,this.max._dirty=!0,this}}(),applyProjection:function(e){var t=this.min.array,r=this.max.array,i=e.array,n=t[0],a=t[1],o=t[2],s=r[0],l=r[1],c=t[2],u=r[0],h=r[1],d=r[2];if(1===i[15])t[0]=i[0]*n+i[12],t[1]=i[5]*a+i[13],r[2]=i[10]*o+i[14],r[0]=i[0]*u+i[12],r[1]=i[5]*h+i[13],t[2]=i[10]*d+i[14];else{var f=-1/o;t[0]=i[0]*n*f,t[1]=i[5]*a*f,r[2]=(i[10]*o+i[14])*f,f=-1/c,r[0]=i[0]*s*f,r[1]=i[5]*l*f,f=-1/d,t[2]=(i[10]*d+i[14])*f}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var e=this.vertices;if(!e){e=[];for(var t=0;t<8;t++)e[t]=Qe.fromValues(0,0,0);this.vertices=e}var r=this.min.array,i=this.max.array;return Bt(e[0],r[0],r[1],r[2]),Bt(e[1],r[0],i[1],r[2]),Bt(e[2],i[0],r[1],r[2]),Bt(e[3],i[0],i[1],r[2]),Bt(e[4],r[0],r[1],i[2]),Bt(e[5],r[0],i[1],i[2]),Bt(e[6],i[0],r[1],i[2]),Bt(e[7],i[0],i[1],i[2]),this},copy:function(e){var t=this.min,r=this.max;return jt(t.array,e.min.array),jt(r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},clone:function(){var e=new zt;return e.copy(this),e}};var Ft=zt,Vt=0,kt=w.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},(function(){this.name||(this.name=(this.type||"NODE")+"_"+Vt++),this.position||(this.position=new _t),this.rotation||(this.rotation=new It),this.scale||(this.scale=new _t(1,1,1)),this.worldTransform=new Lt,this.localTransform=new Lt,this._children=[]}),{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t=this._scene;if(t){var r=t._nodeRepository;delete r[this.name],r[e]=this}this.name=e},add:function(e){var t=e._parent;if(t!==this){t&&t.remove(e),e._parent=this,this._children.push(e);var r=this._scene;r&&r!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0}},remove:function(e){var t=this._children,r=t.indexOf(e);r<0||(t.splice(r,1),e._parent=null,this._scene&&e.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var e=this._children,t=0;t0},beforeRender:function(e){},afterRender:function(e,t){},getBoundingBox:function(e,t){return t=Ut.prototype.getBoundingBox.call(this,e,t),this.geometry&&this.geometry.boundingBox&&t.union(this.geometry.boundingBox),t},clone:function(){var e=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"];return function(){var t=Ut.prototype.clone.call(this);t.geometry=this.geometry,t.material=this.material;for(var r=0;r=0&&b[y]>1e-4&&(Qe.transformMat4(S,x,v[T[y]]),Qe.scaleAndAdd(w,w,S,b[y]));E.set(_,w)}}for(_=0;_>t;return e+1},dispose:function(e){var t=this._cache;t.use(e.__uid__);var r=t.get("webgl_texture");r&&e.gl.deleteTexture(r),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(Kt.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}}),Object.defineProperty(Kt.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}}),Kt.BYTE=O.BYTE,Kt.UNSIGNED_BYTE=O.UNSIGNED_BYTE,Kt.SHORT=O.SHORT,Kt.UNSIGNED_SHORT=O.UNSIGNED_SHORT,Kt.INT=O.INT,Kt.UNSIGNED_INT=O.UNSIGNED_INT,Kt.FLOAT=O.FLOAT,Kt.HALF_FLOAT=36193,Kt.UNSIGNED_INT_24_8_WEBGL=34042,Kt.DEPTH_COMPONENT=O.DEPTH_COMPONENT,Kt.DEPTH_STENCIL=O.DEPTH_STENCIL,Kt.ALPHA=O.ALPHA,Kt.RGB=O.RGB,Kt.RGBA=O.RGBA,Kt.LUMINANCE=O.LUMINANCE,Kt.LUMINANCE_ALPHA=O.LUMINANCE_ALPHA,Kt.SRGB=35904,Kt.SRGB_ALPHA=35906,Kt.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,Kt.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,Kt.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,Kt.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,Kt.NEAREST=O.NEAREST,Kt.LINEAR=O.LINEAR,Kt.NEAREST_MIPMAP_NEAREST=O.NEAREST_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_NEAREST=O.LINEAR_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR=O.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_LINEAR=O.LINEAR_MIPMAP_LINEAR,Kt.REPEAT=O.REPEAT,Kt.CLAMP_TO_EDGE=O.CLAMP_TO_EDGE,Kt.MIRRORED_REPEAT=O.MIRRORED_REPEAT;var Qt=Kt,Jt=Ht.extend({skeleton:null,joints:null},(function(){this.joints||(this.joints=[])}),{offsetMatrix:null,isInstancedMesh:function(){return!1},isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var e=Ht.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});Jt.POINTS=O.POINTS,Jt.LINES=O.LINES,Jt.LINE_LOOP=O.LINE_LOOP,Jt.LINE_STRIP=O.LINE_STRIP,Jt.TRIANGLES=O.TRIANGLES,Jt.TRIANGLE_STRIP=O.TRIANGLE_STRIP,Jt.TRIANGLE_FAN=O.TRIANGLE_FAN,Jt.BACK=O.BACK,Jt.FRONT=O.FRONT,Jt.FRONT_AND_BACK=O.FRONT_AND_BACK,Jt.CW=O.CW,Jt.CCW=O.CCW;var $t=Jt,er={isPowerOfTwo:function(e){return 0===(e&e-1)},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}},tr=er,rr=tr.isPowerOfTwo;function ir(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function nr(e,t){var r=ir(e.width),i=ir(e.height);t=t||document.createElement("canvas"),t.width=r,t.height=i;var n=t.getContext("2d");return n.drawImage(e.image,0,0,r,i),t}var ar=Qt.extend((function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}}),{textureType:"texture2D",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(e);var r=this.format,i=this.type,n=!(!this.convertToPOT||this.mipmaps.length||!this.image||this.wrapS!==Qt.REPEAT&&this.wrapT!==Qt.REPEAT||!this.NPOT);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,n?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,n?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n?this.minFilter:this.getAvailableMinFilter());var a=e.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_2D,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===i){var o=e.getGLExtension("OES_texture_half_float");o||(i=O.FLOAT)}if(this.mipmaps.length)for(var s=this.width,l=this.height,c=0;c=Qt.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,r,a,i,n,0,t.pixels):e.texImage2D(e.TEXTURE_2D,r,a,i,n,0,a,o,t.pixels)},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_2D))},isPowerOfTwo:function(){return rr(this.width)&&rr(this.height)},isRenderable:function(){return this.image?this.image.width>0&&this.image.height>0:!(!this.width||!this.height)},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},load:function(e,t){var r=M["a"].createImage();t&&(r.crossOrigin=t);var i=this;return r.onload=function(){i.dirty(),i.trigger("success",i)},r.onerror=function(){i.trigger("error",i)},r.src=e,this.image=r,this}});Object.defineProperty(ar.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(e){this.image?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(ar.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(e){this.image?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}});var or=ar;function sr(e){return{byte:M["a"].Int8Array,ubyte:M["a"].Uint8Array,short:M["a"].Int16Array,ushort:M["a"].Uint16Array}[e]||M["a"].Float32Array}function lr(e){return"attr_"+e}function cr(e,t,r,i){switch(this.name=e,this.type=t,this.size=r,this.semantic=i||"",this.value=null,r){case 1:this.get=function(e){return this.value[e]},this.set=function(e,t){this.value[e]=t},this.copy=function(e,t){this.value[e]=this.value[e]};break;case 2:this.get=function(e,t){var r=this.value;return t[0]=r[2*e],t[1]=r[2*e+1],t},this.set=function(e,t){var r=this.value;r[2*e]=t[0],r[2*e+1]=t[1]},this.copy=function(e,t){var r=this.value;t*=2,e*=2,r[e]=r[t],r[e+1]=r[t+1]};break;case 3:this.get=function(e,t){var r=3*e,i=this.value;return t[0]=i[r],t[1]=i[r+1],t[2]=i[r+2],t},this.set=function(e,t){var r=3*e,i=this.value;i[r]=t[0],i[r+1]=t[1],i[r+2]=t[2]},this.copy=function(e,t){var r=this.value;t*=3,e*=3,r[e]=r[t],r[e+1]=r[t+1],r[e+2]=r[t+2]};break;case 4:this.get=function(e,t){var r=this.value,i=4*e;return t[0]=r[i],t[1]=r[i+1],t[2]=r[i+2],t[3]=r[i+3],t},this.set=function(e,t){var r=this.value,i=4*e;r[i]=t[0],r[i+1]=t[1],r[i+2]=t[2],r[i+3]=t[3]},this.copy=function(e,t){var r=this.value;t*=4,e*=4,r[e]=r[t],r[e+1]=r[t+1],r[e+2]=r[t+2],r[e+3]=r[t+3]}}}function ur(e,t,r,i,n){this.name=e,this.type=t,this.buffer=r,this.size=i,this.semantic=n,this.symbol="",this.needsRemove=!1}function hr(e){this.buffer=e,this.count=0}cr.prototype.init=function(e){if(!this.value||this.value.length!==e*this.size){var t=sr(this.type);this.value=new t(e*this.size)}},cr.prototype.fromArray=function(e){var t,r=sr(this.type);if(e[0]&&e[0].length){var i=0,n=this.size;t=new r(e.length*n);for(var a=0;a=0){t||(t=[]);var r=this.indices;return t[0]=r[3*e],t[1]=r[3*e+1],t[2]=r[3*e+2],t}},setTriangleIndices:function(e,t){var r=this.indices;r[3*e]=t[0],r[3*e+1]=t[1],r[3*e+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t,r=this.vertexCount>65535?M["a"].Uint32Array:M["a"].Uint16Array;if(e[0]&&e[0].length){var i=0,n=3;t=new r(e.length*n);for(var a=0;a=0&&(t.splice(r,1),delete this.attributes[e],!0)},getAttribute:function(e){return this.attributes[e]},getEnabledAttributes:function(){var e=this._enabledAttributes,t=this._attributeList;if(e)return e;for(var r=[],i=this.vertexCount,n=0;na[0]&&(a[0]=s),l>a[1]&&(a[1]=l),c>a[2]&&(a[2]=c)}r._dirty=!0,i._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,r=t.position.value,i=t.normal.value;if(i&&i.length===r.length)for(var n=0;n65535&&(this.indices=new M["a"].Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,r=this.getEnabledAttributes(),i={},n=0;nthis.distance,n=1;n<8;n++)if(Qe.dot(t[n].array,r)>this.distance!=i)return!0},intersectLine:function(){var e=Qe.create();return function(t,r,i){var n=this.distanceToPoint(t),a=this.distanceToPoint(r);if(n>0&&a>0||n<0&&a<0)return null;var o=this.normal.array,s=this.distance,l=t.array;Qe.sub(e,r.array,t.array),Qe.normalize(e,e);var c=Qe.dot(o,e);if(0===c)return null;i||(i=new _t);var u=(Qe.dot(o,l)-s)/c;return Qe.scaleAndAdd(i.array,l,e,-u),i._dirty=!0,i}}(),applyTransform:function(){var e=Ye.create(),t=wt.create(),r=wt.create();return r[3]=1,function(i){i=i.array,Qe.scale(r,this.normal.array,this.distance),wt.transformMat4(r,r,i),this.distance=Qe.dot(r,this.normal.array),Ye.invert(e,i),Ye.transpose(e,e),t[3]=0,Qe.copy(t,this.normal.array),wt.transformMat4(t,t,e),Qe.copy(this.normal.array,t)}}(),copy:function(e){Qe.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new Mr;return e.copy(this),e}};var Dr=Mr,Lr=Qe.set,Nr=Qe.copy,Rr=Qe.transformMat4,Pr=Math.min,Ir=Math.max,Br=function(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new Dr);this.boundingBox=new Ft,this.vertices=[];for(e=0;e<8;e++)this.vertices[e]=Qe.fromValues(0,0,0)};Br.prototype={setFromProjection:function(e){var t=this.planes,r=e.array,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],l=r[5],c=r[6],u=r[7],h=r[8],d=r[9],f=r[10],p=r[11],m=r[12],g=r[13],v=r[14],_=r[15];Lr(t[0].normal.array,o-i,u-s,p-h),t[0].distance=-(_-m),t[0].normalize(),Lr(t[1].normal.array,o+i,u+s,p+h),t[1].distance=-(_+m),t[1].normalize(),Lr(t[2].normal.array,o+n,u+l,p+d),t[2].distance=-(_+g),t[2].normalize(),Lr(t[3].normal.array,o-n,u-l,p-d),t[3].distance=-(_-g),t[3].normalize(),Lr(t[4].normal.array,o-a,u-c,p-f),t[4].distance=-(_-v),t[4].normalize(),Lr(t[5].normal.array,o+a,u+c,p+f),t[5].distance=-(_+v),t[5].normalize();var y=this.boundingBox,x=this.vertices;if(0===_){var b=l/i,T=-v/(f-1),w=-v/(f+1),S=-w/l,E=-T/l;y.min.set(-S*b,-S,w),y.max.set(S*b,S,T),Lr(x[0],-S*b,-S,w),Lr(x[1],-S*b,S,w),Lr(x[2],S*b,-S,w),Lr(x[3],S*b,S,w),Lr(x[4],-E*b,-E,T),Lr(x[5],-E*b,E,T),Lr(x[6],E*b,-E,T),Lr(x[7],E*b,E,T)}else{var A=(-1-m)/i,C=(1-m)/i,O=(1-g)/l,M=(-1-g)/l,D=(-1-v)/f,L=(1-v)/f;y.min.set(Math.min(A,C),Math.min(M,O),Math.min(L,D)),y.max.set(Math.max(C,A),Math.max(O,M),Math.max(D,L));var N=y.min.array,R=y.max.array;Lr(x[0],N[0],N[1],N[2]),Lr(x[1],N[0],R[1],N[2]),Lr(x[2],R[0],N[1],N[2]),Lr(x[3],R[0],R[1],N[2]),Lr(x[4],N[0],N[1],R[2]),Lr(x[5],N[0],R[1],R[2]),Lr(x[6],R[0],N[1],R[2]),Lr(x[7],R[0],R[1],R[2])}},getTransformedBoundingBox:function(){var e=Qe.create();return function(t,r){var i=this.vertices,n=r.array,a=t.min,o=t.max,s=a.array,l=o.array,c=i[0];Rr(e,c,n),Nr(s,e),Nr(l,e);for(var u=1;u<8;u++)c=i[u],Rr(e,c,n),s[0]=Pr(e[0],s[0]),s[1]=Pr(e[1],s[1]),s[2]=Pr(e[2],s[2]),l[0]=Ir(e[0],l[0]),l[1]=Ir(e[1],l[1]),l[2]=Ir(e[2],l[2]);return a._dirty=!0,o._dirty=!0,t}}()};var jr=Br,zr=Ut.extend((function(){return{projectionMatrix:new Lt,invProjectionMatrix:new Lt,viewMatrix:new Lt,frustum:new jr}}),(function(){this.update(!0)}),{update:function(e){Ut.prototype.update.call(this,e),Lt.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),Lt.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(e){Lt.copy(this.viewMatrix,e),Lt.invert(this.worldTransform,e),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(e){Lt.copy(this.projectionMatrix,e),Lt.invert(this.invProjectionMatrix,e),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:function(){var e=wt.create();return function(t,r){var i=void 0!==r?r:new bt,n=t.array[0],a=t.array[1];return wt.set(e,n,a,-1,1),wt.transformMat4(e,e,this.invProjectionMatrix.array),wt.transformMat4(e,e,this.worldTransform.array),Qe.scale(i.origin.array,e,1/e[3]),wt.set(e,n,a,1,1),wt.transformMat4(e,e,this.invProjectionMatrix.array),wt.transformMat4(e,e,this.worldTransform.array),Qe.scale(e,e,1/e[3]),Qe.sub(i.direction.array,e,i.origin.array),Qe.normalize(i.direction.array,i.direction.array),i.direction._dirty=!0,i.origin._dirty=!0,i}}()}),Fr=zr,Vr=Ye.create(),kr=Ye.create(),Ur={};function Gr(e){var t=[],r=Object.keys(e);r.sort();for(var i=0;i0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof Or&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof Fr?(t=this._cameraList.indexOf(e),t>=0&&this._cameraList.splice(t,1)):e instanceof Or&&(t=this.lights.indexOf(e),t>=0&&this.lights.splice(t,1)),e.name&&delete this._nodeRepository[e.name]},getNode:function(e){return this._nodeRepository[e]},setMainCamera:function(e){var t=this._cameraList.indexOf(e);t>=0&&this._cameraList.splice(t,1),this._cameraList.unshift(e)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var e=this.lights;this._previousLightNumber=this._lightNumber;for(var t={},r=0;r0&&this._doUpdateRenderList(o,t,r,i,n)}},isFrustumCulled:function(){var e=new Ft,t=new Lt;return function(r,i,n){var a=r.boundingBox;if(a||(a=r.skeleton&&r.skeleton.boundingBox?r.skeleton.boundingBox:r.geometry.boundingBox),!a)return!1;if(t.array=n,e.transformFrom(a,t),r.castShadow&&this.viewBoundingBoxLastFrame.union(e),r.frustumCulling){if(!e.intersectBoundingBox(i.frustum.boundingBox))return!0;t.array=i.projectionMatrix.array,e.max.array[2]>0&&e.min.array[2]<0&&(e.max.array[2]=-1e-20),e.applyProjection(t);var o=e.min.array,s=e.max.array;if(s[0]<-1||o[0]>1||s[1]<-1||o[1]>1||s[2]<-1||o[2]>1)return!0}return!1}}(),_updateLightUniforms:function(){var e=this.lights;e.sort(Xr);var t=this._lightUniforms;for(var r in t)for(var i in t[r])t[r][i].value.length=0;for(var n=0;n1&&t.texParameterf(t.TEXTURE_CUBE_MAP,n.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===i){var a=e.getGLExtension("OES_texture_half_float");a||(i=O.FLOAT)}if(this.mipmaps.length)for(var o=this.width,s=this.height,l=0;l0&&e.height>0}Object.defineProperty(Qr.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(Qr.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}});var $r=Qr,ei=Fr.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var e=this.fov/180*Math.PI;this.projectionMatrix.perspective(e,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array,t=2*Math.atan(1/e[5]);this.fov=t/Math.PI*180,this.aspect=e[5]/e[0],this.near=e[14]/(e[10]-1),this.far=e[14]/(e[10]+1)},clone:function(){var e=Fr.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}}),ti=ei,ri="framebuffer",ii="renderbuffer",ni=ii+"_width",ai=ii+"_height",oi=ii+"_attached",si="depthtexture_attached",li=O.FRAMEBUFFER,ci=O.RENDERBUFFER,ui=O.DEPTH_ATTACHMENT,hi=O.COLOR_ATTACHMENT0,di=w.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},(function(){this._cache=new Yt,this._textures={}}),{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(e){if(e.__currentFrameBuffer){if(e.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}e.__currentFrameBuffer=this;var t=e.gl;t.bindFramebuffer(li,this._getFrameBufferGL(e)),this._boundRenderer=e;var r=this._cache;r.put("viewport",e.viewport);var i,n,a=!1;for(var o in this._textures){a=!0;var s=this._textures[o];s&&(i=s.texture.width,n=s.texture.height,this._doAttach(e,s.texture,o,s.target))}this._width=i,this._height=n,!a&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?e.setViewport(this.viewport):e.setViewport(0,0,i,n,1);var l=r.get("attached_textures");if(l)for(var o in l)if(!this._textures[o]){var c=l[o];this._doDetach(t,o,c)}if(!r.get(si)&&this.depthBuffer){r.miss(ii)&&r.put(ii,t.createRenderbuffer());var u=r.get(ii);i===r.get(ni)&&n===r.get(ai)||(t.bindRenderbuffer(ci,u),t.renderbufferStorage(ci,t.DEPTH_COMPONENT16,i,n),r.put(ni,i),r.put(ai,n),t.bindRenderbuffer(ci,null)),r.get(oi)||(t.framebufferRenderbuffer(li,ui,ci,u),r.put(oi,!0))}},unbind:function(e){e.__currentFrameBuffer=null;var t=e.gl;t.bindFramebuffer(li,null),this._boundRenderer=null,this._cache.use(e.__uid__);var r=this._cache.get("viewport");r&&e.setViewport(r),this.updateMipmap(e)},updateMipmap:function(e){var t=e.gl;for(var r in this._textures){var i=this._textures[r];if(i){var n=i.texture;if(!n.NPOT&&n.useMipmap&&n.minFilter===Qt.LINEAR_MIPMAP_LINEAR){var a="textureCube"===n.textureType?O.TEXTURE_CUBE_MAP:O.TEXTURE_2D;t.bindTexture(a,n.getWebGLTexture(e)),t.generateMipmap(a),t.bindTexture(a,null)}}}},checkStatus:function(e){return e.checkFramebufferStatus(li)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss(ri)&&t.put(ri,e.gl.createFramebuffer()),t.get(ri)},attach:function(e,t,r){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||hi,r=r||O.TEXTURE_2D;var i,n=this._boundRenderer,a=n&&n.gl;if(a){var o=this._cache;o.use(n.__uid__),i=o.get("attached_textures")}var s=this._textures[t];if(!s||s.target!==r||s.texture!==e||!i||null==i[t]){var l=!0;n&&(l=this._doAttach(n,e,t,r),this.viewport||n.setViewport(0,0,e.width,e.height,1)),l&&(this._textures[t]=this._textures[t]||{},this._textures[t].texture=e,this._textures[t].target=r)}},_doAttach:function(e,t,r,i){var n=e.gl,a=t.getWebGLTexture(e),o=this._cache.get("attached_textures");if(o&&o[r]){var s=o[r];if(s.texture===t&&s.target===i)return}r=+r;var l=!0;if(r===ui||r===O.DEPTH_STENCIL_ATTACHMENT){var c=e.getGLExtension("WEBGL_depth_texture");if(c||(console.error("Depth texture is not supported by the browser"),l=!1),t.format!==O.DEPTH_COMPONENT&&t.format!==O.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l){var u=this._cache.get(ii);u&&(n.framebufferRenderbuffer(li,ui,ci,null),n.deleteRenderbuffer(u),this._cache.put(ii,!1)),this._cache.put(oi,!1),this._cache.put(si,!0)}}return n.framebufferTexture2D(li,r,i,a,0),o||(o={},this._cache.put("attached_textures",o)),o[r]=o[r]||{},o[r].texture=t,o[r].target=i,l},_doDetach:function(e,t,r){e.framebufferTexture2D(li,t,r,null,0);var i=this._cache.get("attached_textures");i&&i[t]&&(i[t]=null),t!==ui&&t!==O.DEPTH_STENCIL_ATTACHMENT||this._cache.put(si,!1)},detach:function(e,t){if(this._textures[e]=null,this._boundRenderer){var r=this._cache;r.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,e,t)}},dispose:function(e){var t=e.gl,r=this._cache;r.use(e.__uid__);var i=r.get(ii);i&&t.deleteRenderbuffer(i);var n=r.get(ri);n&&t.deleteFramebuffer(n),r.deleteContext(e.__uid__),this._textures={}}});di.DEPTH_ATTACHMENT=ui,di.COLOR_ATTACHMENT0=hi,di.STENCIL_ATTACHMENT=O.STENCIL_ATTACHMENT,di.DEPTH_STENCIL_ATTACHMENT=O.DEPTH_STENCIL_ATTACHMENT;var fi=di,pi=["px","nx","py","ny","pz","nz"],mi=w.extend((function(){var e={position:new _t,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new ti({fov:90}),nx:new ti({fov:90}),py:new ti({fov:90}),ny:new ti({fov:90}),pz:new ti({fov:90}),nz:new ti({fov:90})};return t.px.lookAt(_t.POSITIVE_X,_t.NEGATIVE_Y),t.nx.lookAt(_t.NEGATIVE_X,_t.NEGATIVE_Y),t.py.lookAt(_t.POSITIVE_Y,_t.POSITIVE_Z),t.ny.lookAt(_t.NEGATIVE_Y,_t.NEGATIVE_Z),t.pz.lookAt(_t.POSITIVE_Z,_t.NEGATIVE_Y),t.nz.lookAt(_t.NEGATIVE_Z,_t.NEGATIVE_Y),e._frameBuffer=new fi,e}),{getCamera:function(e){return this._cameras[e]},render:function(e,t,r){var i=e.gl;r||t.update();for(var n=this.texture.width,a=2*Math.atan(n/(n-.5))/Math.PI*180,o=0;o<6;o++){var s=pi[o],l=this._cameras[s];if(_t.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=a,this.shadowMapPass){l.update();var c=t.getBoundingBox();c.applyTransform(l.viewMatrix),t.viewBoundingBoxLastFrame.copy(c),this.shadowMapPass.render(e,t,l,!0)}this._frameBuffer.attach(this.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+o),this._frameBuffer.bind(e),e.render(t,l,!0),this._frameBuffer.unbind(e)}},dispose:function(e){this._frameBuffer.dispose(e)}}),gi=mi,vi=yr.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var e=this.heightSegments,t=this.widthSegments,r=this.attributes,i=[],n=[],a=[],o=[],s=0;s<=e;s++)for(var l=s/e,c=0;c<=t;c++){var u=c/t;if(i.push([2*u-1,2*l-1,0]),n&&n.push([u,l]),a&&a.push([0,0,1]),c0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),e.renderPass([this],r)}}),Ei=Si,Ai=Ei,Ci=542327876,Oi=131072,Mi=512,Di=4;function Li(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var Ni=31,Ri=Li("DXT1"),Pi=Li("DXT3"),Ii=Li("DXT5"),Bi=0,ji=1,zi=2,Fi=3,Vi=4,ki=7,Ui=20,Gi=21,Hi=28,Wi={parse:function(e,t){var r=new Int32Array(e,0,Ni);if(r[Bi]!==Ci)return null;if(!r(Ui)&Di)return null;var i,n,a=r(Gi),o=r[Vi],s=r[Fi],l=r[Hi]&Mi,c=r[zi]&Oi;switch(a){case Ri:i=8,n=Qt.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Pi:i=16,n=Qt.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Ii:i=16,n=Qt.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var u=r[ji]+4,h=l?6:1,d=1;c&&(d=Math.max(1,r[ki]));for(var f=[],p=0;p0){var n=Math.pow(2,e[3]-128-8+i);t[r+0]=e[0]*n,t[r+1]=e[1]*n,t[r+2]=e[2]*n}else t[r+0]=0,t[r+1]=0,t[r+2]=0;return t[r+3]=1,t}function Qi(e,t,r){for(var i="",n=t;n0)if(e[a][0]=t[r++],e[a][1]=t[r++],e[a][2]=t[r++],e[a][3]=t[r++],1===e[a][0]&&1===e[a][1]&&1===e[a][2]){for(var s=e[a][3]<>>0;s>0;s--)Ji(e[a-1],e[a]),a++,o--;n+=8}else a++,o--,n=0;return r}function en(e,t,r,i){if(iYi)return $i(e,t,r,i);var n=t[r++];if(2!=n)return $i(e,t,r-1,i);if(e[0][1]=t[r++],e[0][2]=t[r++],n=t[r++],(e[0][2]<<8>>>0|n)>>>0!==i)return null;for(n=0;n<4;n++)for(var a=0;a128){o=(127&o)>>>0;var s=t[r++];while(o--)e[a++][n]=s}else while(o--)e[a++][n]=t[r++]}return r}var tn={parseRGBE:function(e,t,r){null==r&&(r=0);var i=new Uint8Array(e),n=i.length;if("#?"===Qi(i,0,2)){for(var a=2;a=n)){a+=2;for(var o="";a20)return console.warn("Given image is not a height map"),e}var f,p,m,g;l%(4*i)===0?(f=o.data[l],m=o.data[l+4]):l%(4*i)===4*(i-1)?(f=o.data[l-4],m=o.data[l]):(f=o.data[l-4],m=o.data[l+4]),l<4*i?(p=o.data[l],g=o.data[l+4*i]):l>i*(n-1)*4?(p=o.data[l-4*i],g=o.data[l]):(p=o.data[l-4*i],g=o.data[l+4*i]),s.data[l]=f-m+127,s.data[l+1]=p-g+127,s.data[l+2]=255,s.data[l+3]=255}return a.putImageData(s,0,0),r},isHeightImage:function(e,t,r){if(!e||!e.width||!e.height)return!1;var i=document.createElement("canvas"),n=i.getContext("2d"),a=t||32;r=r||20,i.width=i.height=a,n.drawImage(e,0,0,a,a);for(var o=n.getImageData(0,0,a,a),s=0;sr)return!1}return!0},_fetchTexture:function(e,t,r){M["a"].request.get({url:e,responseType:"arraybuffer",onload:t,onerror:r})},createChessboard:function(e,t,r,i){e=e||512,t=t||64,r=r||"black",i=i||"white";var n=Math.ceil(e/t),a=document.createElement("canvas");a.width=e,a.height=e;var o=a.getContext("2d");o.fillStyle=i,o.fillRect(0,0,e,e),o.fillStyle=r;for(var s=0;s=0||(on.forEach((function(t){e.on(t,this[sn(t)],this)}),this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),on.forEach((function(t){e.off(t,this[sn(t)])}),this)},dispose:function(){this._meshes.forEach((function(e){this.detachFromMesh(e)}),this)}};var cn=ln,un=Fr.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array;this.left=(-1-e[12])/e[0],this.right=(1-e[12])/e[0],this.top=(1-e[13])/e[5],this.bottom=(-1-e[13])/e[5],this.near=-(-1-e[14])/e[10],this.far=-(1-e[14])/e[10]},clone:function(){var e=Fr.prototype.clone.call(this);return e.left=this.left,e.right=this.right,e.near=this.near,e.far=this.far,e.top=this.top,e.bottom=this.bottom,e}}),hn=un,dn="\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end";Xe["import"](dn);var fn=new _i,pn=new $t({geometry:fn,frustumCulling:!1}),mn=new hn,gn=w.extend((function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}}),(function(){var e=new Xe(Xe.source("clay.compositor.vertex"),this.fragment),t=new re({shader:e});t.enableTexturesAll(),this.material=t}),{setUniform:function(e,t){this.material.setUniform(e,t)},getUniform:function(e){var t=this.material.uniforms[e];if(t)return t.value},attachOutput:function(e,t){this.outputs||(this.outputs={}),t=t||O.COLOR_ATTACHMENT0,this.outputs[t]=e},detachOutput:function(e){for(var t in this.outputs)this.outputs[t]===e&&(this.outputs[t]=null)},bind:function(e,t){if(this.outputs)for(var r in this.outputs){var i=this.outputs[r];i&&t.attach(i,r)}t&&t.bind(e)},unbind:function(e,t){t.unbind(e)},render:function(e,t){var r=e.gl;if(t){this.bind(e,t);var i=e.getGLExtension("EXT_draw_buffers");if(i&&this.outputs){var n=[];for(var a in this.outputs)a=+a,a>=r.COLOR_ATTACHMENT0&&a<=r.COLOR_ATTACHMENT0+8&&n.push(a);i.drawBuffersEXT(n)}}this.trigger("beforerender",this,e);var o=this.clearDepth?r.DEPTH_BUFFER_BIT:0;if(r.depthMask(!0),this.clearColor){o|=r.COLOR_BUFFER_BIT,r.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&r.clearColor(s[0],s[1],s[2],s[3])}r.clear(o),this.blendWithPrevious?(r.enable(r.BLEND),this.material.transparent=!0):(r.disable(r.BLEND),this.material.transparent=!1),this.renderQuad(e),this.trigger("afterrender",this,e),t&&this.unbind(e,t)},renderQuad:function(e){pn.material=this.material,e.renderPass([pn],mn)},dispose:function(e){}}),vn=gn,_n="#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n",yn="#define SHADER_NAME prefilter\n#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n",xn={},bn=["px","nx","py","ny","pz","nz"];xn.prefilterEnvironmentMap=function(e,t,r,i,n){n&&i||(i=xn.generateNormalDistribution(),n=xn.integrateBRDF(e,i)),r=r||{};var a=r.width||64,o=r.height||64,s=r.type||t.type,l=new $r({width:a,height:o,type:s,flipY:!1,mipmaps:[]});l.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var c=Math.min(a,o),u=Math.log(c)/Math.log(2)+1,h=new re({shader:new Xe({vertex:Xe.source("clay.skybox.vertex"),fragment:yn})});h.set("normalDistribution",i),r.encodeRGBM&&h.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&h.define("fragment","RGBM_DECODE");var d,f=new qr;if("texture2D"===t.textureType){var p=new $r({width:a,height:o,type:s===Qt.FLOAT?Qt.HALF_FLOAT:s});an.panoramaToCubeMap(e,t,p,{encodeRGBM:r.decodeRGBM}),t=p}d=new Ei({scene:f,material:h}),d.material.set("environmentMap",t);var m=new gi({texture:l});r.encodeRGBM&&(s=l.type=Qt.UNSIGNED_BYTE);for(var g=new or({width:a,height:o,type:s}),v=new fi({depthBuffer:!1}),_=M["a"][s===Qt.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],y=0;y>>16)>>>0;c=((1431655765&c)<<1|(2863311530&c)>>>1)>>>0,c=((858993459&c)<<2|(3435973836&c)>>>2)>>>0,c=((252645135&c)<<4|(4042322160&c)>>>4)>>>0,c=(((16711935&c)<<8|(4278255360&c)>>>8)>>>0)/4294967296;var u=Math.sqrt((1-c)/(1+(s*s-1)*c));n[l]=u}for(l=0;l65535?Uint32Array:Uint16Array,_=this.indices=new v(t*e*6),y=this.radius,x=this.phiStart,b=this.phiLength,T=this.thetaStart,w=this.thetaLength,S=(y=this.radius,[]),E=[],A=0,C=1/y;for(d=0;d<=e;d++)for(h=0;h<=t;h++)c=h/t,u=d/e,o=-y*Math.cos(x+c*b)*Math.sin(T+u*w),s=y*Math.cos(T+u*w),l=y*Math.sin(x+c*b)*Math.sin(T+u*w),S[0]=o,S[1]=s,S[2]=l,E[0]=c,E[1]=u,r.set(A,S),i.set(A,E),S[0]*=C,S[1]*=C,S[2]*=C,n.set(A,S),A++;var O=t+1,M=0;for(d=0;d=0&&l.splice(e,1)})),l.push(c),this.__zr&&this.__zr.animation.addAnimator(c),c},stopAnimation:function(e){this._animators=this._animators||[];for(var t=this._animators,r=t.length,i=0;i 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.chunk.instancing_header\n#ifdef INSTANCING\nattribute vec4 instanceMat1;\nattribute vec4 instanceMat2;\nattribute vec4 instanceMat3;\n#endif\n@end\n@export clay.chunk.instancing_matrix\nmat4 instanceMat = mat4(\n vec4(instanceMat1.xyz, 0.0),\n vec4(instanceMat2.xyz, 0.0),\n vec4(instanceMat3.xyz, 0.0),\n vec4(instanceMat1.w, instanceMat2.w, instanceMat3.w, 1.0)\n);\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end",ca="\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n",ua="@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\nattribute vec3 normal: NORMAL;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nvarying vec3 v_Normal;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\nvarying vec3 v_Normal;\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end",ha="/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end",da="@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end",fa="@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n",pa="@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n v_Texcoord = texcoord;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end";function ma(e){return!e||"none"===e}function ga(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}function va(e){return e.getZr&&e.setOption}Object.assign(Ut.prototype,sa),Xe.import(la),Xe.import(qe),Xe.import(ca),Xe.import(ua),Xe.import(ha),Xe.import(da),Xe.import(fa),Xe.import(pa);var _a=qr.prototype.addToScene,ya=qr.prototype.removeFromScene;qr.prototype.addToScene=function(e){if(_a.call(this,e),this.__zr){var t=this.__zr;e.traverse((function(e){e.__zr=t,e.addAnimatorsToZr&&e.addAnimatorsToZr(t)}))}},qr.prototype.removeFromScene=function(e){ya.call(this,e),e.traverse((function(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}))},re.prototype.setTextureImage=function(e,t,r,i){if(this.shader){var n,a=r.getZr(),o=this;return o.autoUpdateTextureStatus=!1,o.disableTexture(e),ma(t)||(n=xa.loadTexture(t,r,i,(function(t){o.enableTexture(e),a&&a.refresh()})),o.set(e,n)),n}};var xa={};xa.Renderer=ut,xa.Node=Ut,xa.Mesh=$t,xa.Shader=Xe,xa.Material=re,xa.Texture=Qt,xa.Texture2D=or,xa.Geometry=yr,xa.SphereGeometry=Bn,xa.PlaneGeometry=_i,xa.CubeGeometry=Ti,xa.AmbientLight=zn,xa.DirectionalLight=Vn,xa.PointLight=Un,xa.SpotLight=Hn,xa.PerspectiveCamera=ti,xa.OrthographicCamera=hn,xa.Vector2=ue,xa.Vector3=_t,xa.Vector4=Zn,xa.Quaternion=It,xa.Matrix2=Jn,xa.Matrix2d=ra,xa.Matrix3=na,xa.Matrix4=Lt,xa.Plane=Dr,xa.Ray=bt,xa.BoundingBox=Ft,xa.Frustum=jr;var ba=null;function Ta(){return null!==ba||(ba=an.createBlank("rgba(255,255,255,0)").image),ba}function wa(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function Sa(e){if((e.wrapS===Qt.REPEAT||e.wrapT===Qt.REPEAT)&&e.image){var t=wa(e.width),r=wa(e.height);if(t!==e.width||r!==e.height){var i=document.createElement("canvas");i.width=t,i.height=r;var n=i.getContext("2d");n.drawImage(e.image,0,0,t,r),e.image=i}}}xa.loadTexture=function(e,t,r,i){"function"===typeof r&&(i=r,r={}),r=r||{};for(var n=Object.keys(r).sort(),a="",o=0;o3?t[3]=e[3]:t[3]=1,t):(t=a["h"].parse(e||"#000",t)||[0,0,0,0],t[0]/=255,t[1]/=255,t[2]/=255,t)},xa.directionFromAlphaBeta=function(e,t){var r=e/180*Math.PI+Math.PI/2,i=-t/180*Math.PI+Math.PI/2,n=[],a=Math.sin(r);return n[0]=a*Math.cos(i),n[1]=-Math.cos(r),n[2]=a*Math.sin(i),n},xa.getShadowResolution=function(e){var t=1024;switch(e){case"low":t=512;break;case"medium":break;case"high":t=2048;break;case"ultra":t=4096;break}return t},xa.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"],xa.createShader=function(e){"ecgl.shadow"===e&&(e="ecgl.displayShadow");var t=Xe.source(e+".vertex"),r=Xe.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),r||console.error("Fragment shader of '%s' not exits",e);var i=new Xe(t,r);return i.name=e,i},xa.createMaterial=function(e,t){t instanceof Array||(t=[t]);var r=xa.createShader(e),i=new re({shader:r});return t.forEach((function(e){"string"===typeof e&&i.define(e)})),i},xa.setMaterialFromModel=function(e,t,r,i){t.autoUpdateTextureStatus=!1;var n=r.getModel(e+"Material"),a=n.get("detailTexture"),o=Pn.firstNotNull(n.get("textureTiling"),1),s=Pn.firstNotNull(n.get("textureOffset"),0);"number"===typeof o&&(o=[o,o]),"number"===typeof s&&(s=[s,s]);var l=o[0]>1||o[1]>1?xa.Texture.REPEAT:xa.Texture.CLAMP_TO_EDGE,c={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===e){var u=n.get("roughness"),h=n.get("metalness");null!=h?isNaN(h)&&(t.setTextureImage("metalnessMap",h,i,c),h=Pn.firstNotNull(n.get("metalnessAdjust"),.5)):h=0,null!=u?isNaN(u)&&(t.setTextureImage("roughnessMap",u,i,c),u=Pn.firstNotNull(n.get("roughnessAdjust"),.5)):u=.5;var d=n.get("normalTexture");t.setTextureImage("detailMap",a,i,c),t.setTextureImage("normalMap",d,i,c),t.set({roughness:u,metalness:h,detailUvRepeat:o,detailUvOffset:s})}else if("lambert"===e)t.setTextureImage("detailMap",a,i,c),t.set({detailUvRepeat:o,detailUvOffset:s});else if("color"===e)t.setTextureImage("detailMap",a,i,c),t.set({detailUvRepeat:o,detailUvOffset:s});else if("hatching"===e){var f=n.get("hatchingTextures")||[];f.length;for(var p=0;p<6;p++)t.setTextureImage("hatch"+(p+1),f[p],i,{anisotropic:8,wrapS:xa.Texture.REPEAT,wrapT:xa.Texture.REPEAT});t.set({detailUvRepeat:o,detailUvOffset:s})}},xa.updateVertexAnimation=function(e,t,r,i){var n=i.get("animation"),a=i.get("animationDurationUpdate"),o=i.get("animationEasingUpdate"),s=r.shadowDepthMaterial;if(n&&t&&a>0&&t.geometry.vertexCount===r.geometry.vertexCount){r.material.define("vertex","VERTEX_ANIMATION"),r.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l=0&&this._viewsToDispose.splice(t,1),this.views.push(e),e.layer=this;var r=this.zr;e.scene.traverse((function(e){e.__zr=r,e.addAnimatorsToZr&&e.addAnimatorsToZr(r)}))}},Ca.prototype.removeView=function(e){if(e.layer===this){var t=this.views.indexOf(e);t>=0&&(this.views.splice(t,1),e.scene.traverse(Oa,this),e.layer=null,this._viewsToDispose.push(e))}},Ca.prototype.removeViewsAll=function(){this.views.forEach((function(e){e.scene.traverse(Oa,this),e.layer=null,this._viewsToDispose.push(e)}),this),this.views.length=0},Ca.prototype.resize=function(e,t){var r=this.renderer;r.resize(e,t)},Ca.prototype.clear=function(){var e=this.renderer.gl,t=this._backgroundColor||[0,0,0,0];e.clearColor(t[0],t[1],t[2],t[3]),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT)},Ca.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)},Ca.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},Ca.prototype.needsRefresh=function(){this.zr.refresh()},Ca.prototype.refresh=function(e){this._backgroundColor=e?Ea.parseColor(e):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var t=0;t20)){e=e.event;var i=this.pickObject(e.offsetX,e.offsetY);i&&(this._dispatchEvent(e.type,e,i),this._dispatchDataEvent(e.type,e,i));var n=this._clickToSetFocusPoint(e);if(n){var a=n.view.setDOFFocusOnPoint(n.distance);a&&this.zr.refresh()}}}},Ca.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,r=t.viewport,i=this.views.length-1;i>=0;i--){var n=this.views[i];if(n.hasDOF()&&n.containPoint(e.offsetX,e.offsetY)){this._picking.scene=n.scene,this._picking.camera=n.camera,t.viewport=n.viewport;var a=this._picking.pick(e.offsetX,e.offsetY,!0);if(a)return a.view=n,a}}t.viewport=r},Ca.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})},Ca.prototype.pickObject=function(e,t){for(var r=[],i=this.renderer,n=i.viewport,a=0;a=0&&(h.dataIndex=this._lastDataIndex,h.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",t)),l=!0):null!=s&&s!==this._lastEventData&&(null!=this._lastEventData&&(h.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",t)),l=!0),this._lastEventData=s,this._lastDataIndex=n,this._lastSeriesIndex=o),h.eventData=s,h.dataIndex=n,h.seriesIndex=o,(null!=s||parseInt(n,10)>=0&&parseInt(o,10)>=0)&&(this.zr.handler.dispatchToElement(u,e,t),l&&this.zr.handler.dispatchToElement(u,"mouseover",t))},Ca.prototype._dispatchToView=function(e,t){for(var r=0;r=0&&(ja(t),"mapbox"===t.coordinateSystem&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))})),za(e.xAxis3D),za(e.yAxis3D),za(e.zAxis3D),za(e.grid3D),Ba(e.geo3D)};function Va(e){this._layers={},this._zr=e}Va.prototype.update=function(e,t){var r=this,i=t.getZr();if(i.getWidth()&&i.getHeight()){for(var n in this._layers)this._layers[n].removeViewsAll();e.eachComponent((function(r,i){if("series"!==r){var n=t.getViewOfComponentModel(i),a=i.coordinateSystem;if(n.__ecgl__){if(a){if(!a.viewGL)return void console.error("Can't find viewGL in coordinateSystem of component "+i.id);l=a.viewGL}else{if(!i.viewGL)return void console.error("Can't find viewGL of component "+i.id);l=a.viewGL}var l=a.viewGL,c=o(i);c.addView(l),n.afterRender&&n.afterRender(i,e,t,c),s(n.groupGL,i.get("silent"))}}})),e.eachSeries((function(r){var i=t.getViewOfSeriesModel(r),n=r.coordinateSystem;if(i.__ecgl__){if(n&&!n.viewGL&&!i.viewGL)return void console.error("Can't find viewGL of series "+i.id);var a=n&&n.viewGL||i.viewGL,l=o(r);l.addView(a),i.afterRender&&i.afterRender(r,e,t,l),s(i.groupGL,r.get("silent"))}}))}else console.warn("Dom has no width or height");function o(e){var t;i.setSleepAfterStill(0),t=(e.coordinateSystem&&e.coordinateSystem.model,e.get("zlevel"));var n=r._layers,o=n[t];if(!o){if(o=n[t]=new Pa("gl-"+t,i),i.painter.isSingleCanvas()){o.virtual=!0;var s=new a["l"].Image({z:1e4,style:{image:o.renderer.canvas},silent:!0});o.__hostImage=s,i.add(s)}i.painter.insertLayer(t,o)}return o.__hostImage&&o.__hostImage.setStyle({width:o.renderer.getWidth(),height:o.renderer.getHeight()}),o}function s(e,t){e&&e.traverse((function(e){e.isRenderable&&e.isRenderable()&&(e.ignorePicking=null!=e.$ignorePicking?e.$ignorePicking:t)}))}},a["s"]((function(e){var t=e.getZr(),r=t.painter.dispose;t.painter.dispose=function(){"function"===typeof this.eachOtherLayer&&this.eachOtherLayer((function(e){e instanceof Pa&&e.dispose()})),r.call(this)},t.painter.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas)return this._layers[0].dom;var t=document.createElement("canvas"),r=e.pixelRatio||this.dpr;t.width=this.getWidth()*r,t.height=this.getHeight()*r;var i=t.getContext("2d");i.dpr=r,i.clearRect(0,0,t.width,t.height),e.backgroundColor&&(i.fillStyle=e.backgroundColor,i.fillRect(0,0,t.width,t.height));var n,a=this.storage.getDisplayList(!0),o={},s=this;function l(e,t){var r,n=s._zlevelList;null==e&&(e=-1/0);for(var a=0;ae&&o0&&this._notFirst?this.animateTo({alpha:c,beta:u,center:h,distance:a,orthographicSize:o,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(c),this.setBeta(u),this.setCenter(h),this.setOrthographicSize(o)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){0},animateTo:function(e){var t=this.zr,r=this,i={},n={};return null!=e.distance&&(i.distance=this.getDistance(),n.distance=e.distance),null!=e.orthographicSize&&(i.orthographicSize=this.getOrthographicSize(),n.orthographicSize=e.orthographicSize),null!=e.alpha&&(i.alpha=this.getAlpha(),n.alpha=e.alpha),null!=e.beta&&(i.beta=this.getBeta(),n.beta=e.beta),null!=e.center&&(i.center=this.getCenter(),n.center=e.center),this._addAnimator(t.animation.animate(i).when(e.duration||1e3,n).during((function(){null!=i.alpha&&r.setAlpha(i.alpha),null!=i.beta&&r.setBeta(i.beta),null!=i.distance&&r.setDistance(i.distance),null!=i.center&&r.setCenter(i.center),null!=i.orthographicSize&&r.setOrthographicSize(i.orthographicSize),r._needsUpdate=!0}))).start(e.easing||"linear")},stopAllAnimation:function(){for(var e=0;e0},_update:function(e){if(this._rotating){var t=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=t*e/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(e=Math.min(e,50),this._updateDistanceOrSize(e),this._updatePan(e),this._updateRotate(e),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(e){var t=this._rotateVelocity;this._phi=t.y*e/20+this._phi,this._theta=t.x*e/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(t,Math.pow(this.damping,e/16))},_updateDistanceOrSize:function(e){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*e/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*e/20),this._zoomSpeed*=Math.pow(this.damping,e/16)},_setDistance:function(e){this._distance=Math.max(Math.min(e,this.maxDistance),this.minDistance)},_setOrthoSize:function(e){this._orthoSize=Math.max(Math.min(e,this.maxOrthographicSize),this.minOrthographicSize);var t=this.getCamera(),r=this._orthoSize,i=r/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-i/2,t.right=i/2,t.top=r/2,t.bottom=-r/2},_updatePan:function(e){var t=this._panVelocity,r=this._distance,i=this.getCamera(),n=i.worldTransform.y,a=i.worldTransform.x;this._center.scaleAndAdd(a,-t.x*r/200).scaleAndAdd(n,-t.y*r/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new _t,r=this._theta+Math.PI/2,i=this._phi+Math.PI/2,n=Math.sin(r);t.x=n*Math.cos(i),t.y=-Math.cos(r),t.z=n*Math.sin(i),e.position.copy(this._center).scaleAndAdd(t,this._distance),e.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var e=this.autoRotateAfterStill,t=this;!isNaN(e)&&e>0&&(this._stillTimeout=setTimeout((function(){t._rotating=!0}),1e3*e))},_vectorDamping:function(e,t){var r=e.len();r*=t,r<1e-4&&(r=0),e.normalize().scale(r)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var e=this.getCamera().worldTransform.z,t=Math.asin(e.y),r=Math.atan2(e.x,e.z);this._theta=t,this._phi=-r,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(e){if(!e.target&&!this._isAnimating()){var t=e.offsetX,r=e.offsetY;this.viewGL&&!this.viewGL.containPoint(t,r)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),e.event.targetTouches?1===e.event.targetTouches.length&&(this._mode="rotate"):e.event.button===Za[this.rotateMouseButton]?this._mode="rotate":e.event.button===Za[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=e.offsetX,this._mouseY=e.offsetY)}},_mouseMoveHandler:function(e){if((!e.target||!e.target.__isGLToZRProxy)&&!this._isAnimating()){var t=Ya(this.panSensitivity),r=Ya(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*r[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*r[1]):"pan"===this._mode&&(this._panVelocity.x=(e.offsetX-this._mouseX)/this.zr.getWidth()*t[0]*400,this._panVelocity.y=(-e.offsetY+this._mouseY)/this.zr.getHeight()*t[1]*400),this._mouseX=e.offsetX,this._mouseY=e.offsetY,e.event.preventDefault()}},_mouseWheelHandler:function(e){if(!this._isAnimating()){var t=e.event.wheelDelta||-e.event.detail;this._zoomHandler(e,t)}},_pinchHandler:function(e){this._isAnimating()||(this._zoomHandler(e,e.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(e,t){if(0!==t){var r,i=e.offsetX,n=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(i,n))r="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(t>0?-1:1)*r*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),e.event.preventDefault()}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(e){this._isRightMouseButtonUsed()&&e.preventDefault()},_addAnimator:function(e){var t=this._animators;return t.push(e),e.done((function(){var r=t.indexOf(e);r>=0&&t.splice(r,1)})),e}});Object.defineProperty(Ka.prototype,"autoRotate",{get:function(e){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}});var Qa=Ka,Ja={convertToDynamicArray:function(e){e&&this.resetOffset();var t=this.attributes;for(var r in t)e||!t[r].value?t[r].value=[]:t[r].value=Array.prototype.slice.call(t[r].value);e||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var e=this.attributes;for(var t in e)e[t].value&&e[t].value.length>0?e[t].value=new Float32Array(e[t].value):e[t].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}},$a={vec2:se,vec3:Qe,vec4:wt,mat2:Kn,mat2d:ea,mat3:Et,mat4:Ye,quat:Ct},eo=$a,to=eo.vec3,ro=[[0,0],[1,1]],io=yr.extend((function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new yr.Attribute("position","float",3,"POSITION"),positionPrev:new yr.Attribute("positionPrev","float",3),positionNext:new yr.Attribute("positionNext","float",3),prevPositionPrev:new yr.Attribute("prevPositionPrev","float",3),prevPosition:new yr.Attribute("prevPosition","float",3),prevPositionNext:new yr.Attribute("prevPositionNext","float",3),offset:new yr.Attribute("offset","float",1),color:new yr.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.positionPrev.init(e),t.positionNext.init(e),t.offset.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,r,i){var n=to.dist(e,t)+to.dist(r,t)+to.dist(i,r),a=1/(n+1)*this.segmentScale;return a},getCubicCurveVertexCount:function(e,t,r,i){var n=this._getCubicCurveApproxStep(e,t,r,i),a=Math.ceil(1/n);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,r,i){var n=this._getCubicCurveApproxStep(e,t,r,i),a=Math.ceil(1/n);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(ro)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(ro)},getPolylineVertexCount:function(e){var t;if("number"===typeof e)t=e;else{var r="number"!==typeof e[0];t=r?e.length:e.length/3}return this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;if("number"===typeof e)t=e;else{var r="number"!==typeof e[0];t=r?e.length:e.length/3}return this.useNativeLine?0:2*Math.max(t-1,0)},addCubicCurve:function(e,t,r,i,n,a){null==a&&(a=1);var o=e[0],s=e[1],l=e[2],c=t[0],u=t[1],h=t[2],d=r[0],f=r[1],p=r[2],m=i[0],g=i[1],v=i[2],_=this._getCubicCurveApproxStep(e,t,r,i),y=_*_,x=y*_,b=3*_,T=3*y,w=6*y,S=6*x,E=o-2*c+d,A=s-2*u+f,C=l-2*h+p,O=3*(c-d)-o+m,M=3*(u-f)-s+g,D=3*(h-p)-l+v,L=o,N=s,R=l,P=(c-o)*b+E*T+O*x,I=(u-s)*b+A*T+M*x,B=(h-l)*b+C*T+D*x,j=E*w+O*S,z=A*w+M*S,F=C*w+D*S,V=O*S,k=M*S,U=D*S,G=0,H=0,W=Math.ceil(1/_),X=new Float32Array(3*(W+1)),q=(X=[],0);for(H=0;H1&&(L=P>0?Math.min(L,m):Math.max(L,m),N=I>0?Math.min(N,g):Math.max(N,g),R=B>0?Math.min(R,v):Math.max(R,v));return this.addPolyline(X,n,a)},addLine:function(e,t,r,i){return this.addPolyline([e,t],r,i)},addPolyline:function(e,t,r,i,n){if(e.length){var a="number"!==typeof e[0];if(null==n&&(n=a?e.length:e.length/3),!(n<2)){null==i&&(i=0),null==r&&(r=1),this._itemVertexOffsets.push(this._vertexOffset);a="number"!==typeof e[0];var o,s,l=a?"number"!==typeof t[0]:t.length/4===n,c=this.attributes.position,u=this.attributes.positionPrev,h=this.attributes.positionNext,d=this.attributes.color,f=this.attributes.offset,p=this.indices,m=this._vertexOffset;r=Math.max(r,.01);for(var g=i;g1&&(c.copy(m,m-1),d.copy(m,m-1),m++):(g0&&(h.set(m-2,o),h.set(m-1,o)),c.set(m,o),c.set(m+1,o),d.set(m,s),d.set(m+1,s),f.set(m,r/2),f.set(m+1,-r/2),m+=2),this.useNativeLine)d.set(m,s),c.set(m,o),m++;else if(g>0){var y=3*this._triangleOffset;p=this.indices;p[y]=m-4,p[y+1]=m-3,p[y+2]=m-2,p[y+3]=m-3,p[y+4]=m-1,p[y+5]=m-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,b=this._vertexOffset+2*n;u.copy(x,x+2),u.copy(x+1,x+3),h.copy(b-1,b-3),h.copy(b-2,b-4)}return this._vertexOffset=m,this._vertexOffset}}},setItemColor:function(e,t){for(var r=this._itemVertexOffsets[e],i=eo&&(n=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=t+l,this._rowHeight=Math.max(this._rowHeight,r),a+r+l>s)return null;e.x+=this.offsetX*this.dpr+n,e.y+=this.offsetY*this.dpr+a,this._zr.add(e);var c=[this.offsetX/this.width,this.offsetY/this.height],u=[[n/o+c[0],a/s+c[1]],[(n+t)/o+c[0],(a+r)/s+c[1]]];return u},_fitElement:function(e,t,r){var i=e.getBoundingRect(),n=t/i.width,a=r/i.height;e.x=-i.x*n,e.y=-i.y*a,e.scaleX=n,e.scaleY=a,e.update()}},oo.prototype={clear:function(){for(var e=0;e=e)){var a=(i+this._nodeWidth)*this._dpr,o=(n+this._nodeHeight)*this._dpr;try{this._zr.resize({width:a,height:o})}catch(l){this._canvas.width=a,this._canvas.height=o}var s=new ao(this._zr,i,n,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(s),s}},add:function(e,t,r){if(this._coords[e.id])return this._coords[e.id];var i=this._getCurrentNode().add(e,t,r);if(!i){var n=this._expand();if(!n)return;i=n.add(e,t,r)}return this._coords[e.id]=i,i},getCoordsScale:function(){var e=this._dpr;return[this._nodeWidth/this._canvas.width*e,this._nodeHeight/this._canvas.height*e]},getCoords:function(e){return this._coords[e]},dispose:function(){this._zr.dispose()}};var so=oo;function lo(){}lo.prototype={constructor:lo,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new Ea.DirectionalLight({shadowBias:.005}),this.ambientLight=new Ea.AmbientLight,e.add(this.mainLight),e.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(e){var t=this.mainLight,r=this.ambientLight,i=e.getModel("light"),n=i.getModel("main"),a=i.getModel("ambient");t.intensity=n.get("intensity"),r.intensity=a.get("intensity"),t.color=Ea.parseColor(n.get("color")).slice(0,3),r.color=Ea.parseColor(a.get("color")).slice(0,3);var o=n.get("alpha")||0,s=n.get("beta")||0;t.position.setArray(Ea.directionFromAlphaBeta(o,s)),t.lookAt(Ea.Vector3.ZERO),t.castShadow=n.get("shadow"),t.shadowResolution=Ea.getShadowResolution(n.get("shadowQuality"))},updateAmbientCubemap:function(e,t,r){var i=t.getModel("light.ambientCubemap"),n=i.get("texture");if(n){this._cubemapLightsCache=this._cubemapLightsCache||{};var a=this._cubemapLightsCache[n];if(!a){var o=this;a=this._cubemapLightsCache[n]=Ea.createAmbientCubemap(i.option,e,r,(function(){o._isSkyboxFromAmbientCubemap&&o._skybox.setEnvironmentMap(a.specular.cubemap),r.getZr().refresh()}))}this._lightRoot.add(a.diffuse),this._lightRoot.add(a.specular),this._currentCubemapLights=a}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(e,t,r){var i=t.get("environment"),n=this;function o(){return n._skybox=n._skybox||new Ei,n._skybox}var s=o();if(i&&"none"!==i)if("auto"===i)if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var l=this._currentCubemapLights.specular.cubemap;s.setEnvironmentMap(l),this._scene&&s.attachScene(this._scene),s.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if("object"===typeof i&&i.colorStops||"string"===typeof i&&a["h"].parse(i)){this._isSkyboxFromAmbientCubemap=!1;var c=new Ea.Texture2D({anisotropic:8,flipY:!1});s.setEnvironmentMap(c);var u=c.image=document.createElement("canvas");u.width=u.height=16;var h=u.getContext("2d"),d=new a["l"].Rect({shape:{x:0,y:0,width:16,height:16},style:{fill:i}});a["o"](h,d),s.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;c=Ea.loadTexture(i,r,{anisotropic:8,flipY:!1});s.setEnvironmentMap(c),s.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var f=t.coordinateSystem;if(this._skybox)if(!f||!f.viewGL||"auto"===i||i.match&&i.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var p=f.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[p]("fragment","SRGB_DECODE")}}};var co=lo,uo=eo.vec3,ho=yr.extend((function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new yr.Attribute("position","float",3,"POSITION"),normal:new yr.Attribute("normal","float",3,"NORMAL"),color:new yr.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,r=this.getQuadVertexCount()*e,i=this.getQuadTriangleCount()*e;this.vertexCount!==r&&(t.position.init(r),t.normal.init(r),t.color.init(r)),this.triangleCount!==i&&(this.indices=r>65535?new Uint32Array(3*i):new Uint16Array(3*i))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var e=uo.create(),t=uo.create(),r=uo.create(),i=[0,3,1,3,2,1];return function(n,a){var o=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;uo.sub(e,n[1],n[0]),uo.sub(t,n[2],n[1]),uo.cross(r,e,t),uo.normalize(r,r);for(var c=0;c<4;c++)o.set(this._vertexOffset+c,n[c]),l.set(this._vertexOffset+c,a),s.set(this._vertexOffset+c,r);var u=3*this._faceOffset;for(c=0;c<6;c++)this.indices[u+c]=i[c]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});a["w"].defaults(ho.prototype,Ja);var fo=ho,po=Pn.firstNotNull,mo={x:0,y:2,z:1};function go(e,t,r,i){var n=[0,0,0],a=i<0?r.getExtentMin():r.getExtentMax();n[mo[r.dim]]=a,e.position.setArray(n),e.rotation.identity(),t.distance=-Math.abs(a),t.normal.set(0,0,0),"x"===r.dim?(e.rotation.rotateY(i*Math.PI/2),t.normal.x=-i):"z"===r.dim?(e.rotation.rotateX(-i*Math.PI/2),t.normal.y=-i):(i>0&&e.rotation.rotateY(Math.PI),t.normal.z=-i)}function vo(e,t,r){this.rootNode=new Ea.Node;var i=new Ea.Mesh({geometry:new no({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),n=new Ea.Mesh({geometry:new fo,material:r,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(n),this.rootNode.add(i),this.faceInfo=e,this.plane=new Ea.Plane,this.linesMesh=i,this.quadsMesh=n}vo.prototype.update=function(e,t,r){var i=e.coordinateSystem,n=[i.getAxis(this.faceInfo[0]),i.getAxis(this.faceInfo[1])],a=this.linesMesh.geometry,o=this.quadsMesh.geometry;a.convertToDynamicArray(!0),o.convertToDynamicArray(!0),this._updateSplitLines(a,n,e,r),this._udpateSplitAreas(o,n,e,r),a.convertToTypedArray(),o.convertToTypedArray();var s=i.getAxis(this.faceInfo[2]);go(this.rootNode,this.plane,s,this.faceInfo[3])},vo.prototype._updateSplitLines=function(e,t,r,i){var n=i.getDevicePixelRatio();t.forEach((function(i,o){var s=i.model,l=t[1-o].getExtent();if(!i.scale.isBlank()){var c=s.getModel("splitLine",r.getModel("splitLine"));if(c.get("show")){var u=c.getModel("lineStyle"),h=u.get("color"),d=po(u.get("opacity"),1),f=po(u.get("width"),1);h=a["w"].isArray(h)?h:[h];for(var p=i.getTicksCoords({tickModel:c}),m=0,g=0;g65535?new Uint32Array(3*r):new Uint16Array(3*r))},setSpriteAlign:function(e,t,r,i,n){var a,o,s,l;switch(null==r&&(r="left"),null==i&&(i="top"),n=n||0,r){case"left":a=n,s=t[0]+n;break;case"center":case"middle":a=-t[0]/2,s=t[0]/2;break;case"right":a=-t[0]-n,s=-n;break}switch(i){case"bottom":o=n,l=t[1]+n;break;case"middle":o=-t[1]/2,l=t[1]/2;break;case"top":o=-t[1]-n,l=-n;break}var c=4*e,u=this.attributes.offset;u.set(c,[a,l]),u.set(c+1,[s,l]),u.set(c+2,[s,o]),u.set(c+3,[a,o])},addSprite:function(e,t,r,i,n,a){var o=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,r,i,n,a);for(var s=0;s 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end",Do=Pn.firstNotNull;Ea.Shader.import(Mo);var Lo={x:0,y:2,z:1},No=a["d"].extend({type:"grid3D",__ecgl__:!0,init:function(e,t){var r=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]],i=["x","y","z"],n=new Ea.Material({shader:Ea.createShader("ecgl.color"),depthMask:!1,transparent:!0}),a=new Ea.Material({shader:Ea.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new Ea.Node,this._control=new Qa({zr:t.getZr()}),this._control.init(),this._faces=r.map((function(e){var t=new _o(e,a,n);return this.groupGL.add(t.rootNode),t}),this),this._axes=i.map((function(e){var t=new Oo(e,a);return this.groupGL.add(t.rootNode),t}),this);var o=t.getDevicePixelRatio();this._axisLabelSurface=new so({width:256,height:256,devicePixelRatio:o}),this._axisLabelSurface.onupdate=function(){t.getZr().refresh()},this._axisPointerLineMesh=new Ea.Mesh({geometry:new no({useNativeLine:!1}),material:a,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new so({width:128,height:128,devicePixelRatio:o}),this._axisPointerLabelsMesh=new wo({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new Ea.Node,this._sceneHelper=new co,this._sceneHelper.initLight(this._lightRoot)},render:function(e,t,r){this._model=e,this._api=r;var i=e.coordinateSystem;i.viewGL.add(this._lightRoot),e.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL);var n=this._control;n.setViewGL(i.viewGL);var a=e.getModel("viewControl");n.setFromViewControlModel(a,0),this._axisLabelSurface.clear(),n.off("update"),e.get("show")&&(this._faces.forEach((function(i){i.update(e,t,r)}),this),this._axes.forEach((function(t){t.update(e,this._axisLabelSurface,r)}),this)),n.on("update",this._onCameraChange.bind(this,e,r),this),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(e),i.viewGL.setPostEffect(e.getModel("postEffect"),r),i.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._initMouseHandler(e)},afterRender:function(e,t,r,i){var n=i.renderer;this._sceneHelper.updateAmbientCubemap(n,e,r),this._sceneHelper.updateSkybox(n,e,r)},showAxisPointer:function(e,t,r,i){this._doShowAxisPointer(),this._updateAxisPointer(i.value)},hideAxisPointer:function(e,t,r,i){this._doHideAxisPointer()},_initMouseHandler:function(e){var t=e.coordinateSystem,r=t.viewGL;e.get("show")&&e.get("axisPointer.show")?r.on("mousemove",this._updateAxisPointerOnMousePosition,this):r.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(e){if(!e.target){for(var t,r=this._model,i=r.coordinateSystem,n=i.viewGL,a=n.castRay(e.offsetX,e.offsetY,new Ea.Ray),o=0;oi[1]?0:1,s=this._faces[2*r+o],l=this._faces[2*r+1-o];s.rootNode.invisible=!0,l.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),r=e.getAxis("y"),i=e.getAxis("z"),n=i.getExtentMax(),a=i.getExtentMin(),o=t.getExtentMin(),s=t.getExtentMax(),l=r.getExtentMax(),c=r.getExtentMin(),u=this._axes[0].rootNode,h=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,p=f[4].rootNode.invisible?c:l,m=f[2].rootNode.invisible?n:a,g=f[0].rootNode.invisible?o:s,v=f[2].rootNode.invisible?n:a,_=f[0].rootNode.invisible?s:o,y=f[4].rootNode.invisible?c:l;u.rotation.identity(),h.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,u.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,h.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),u.position.set(0,m,p),h.position.set(g,v,0),d.position.set(_,0,y),u.update(),h.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new Ea.Vector4,new Ea.Vector4],r=new Ea.Vector4;this.groupGL.getWorldPosition(r),r.w=1,r.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),r.x/=r.w,r.y/=r.w,this._axes.forEach((function(i){for(var n=i.axisLineCoords,a=(i.labelsMesh.geometry,0);ar.y?"bottom":"top"):(s="middle",o=u>r.x?"left":"right"),i.setSpriteAlign(o,s,this._api)}),this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(e){var t=this._model.coordinateSystem,r=t.dataToPoint(e),i=this._axisPointerLineMesh,n=i.geometry,a=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function s(e){return Pn.firstNotNull(e.model.get("axisPointer.show"),a.get("show"))}function l(e){var t=e.model.getModel("axisPointer",a),r=t.getModel("lineStyle"),i=Ea.parseColor(r.get("color")),n=Do(r.get("width"),1),o=Do(r.get("opacity"),1);return i[3]*=o,{color:i,lineWidth:n}}n.convertToDynamicArray(!0);for(var c=0;c 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n #endif\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n #else\n depth += bias;\n #endif\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = worldViewProjection * P;\n v_WorldPosition = (world * P).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end",qo=["px","nx","py","ny","pz","nz"];function Zo(e,t,r){if("alphaMap"===r)return e.material.get("diffuseMap");if("alphaCutoff"===r){if(e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")){var i=e.material.get("alphaCutoff");return i||0}return 0}return"uvRepeat"===r?e.material.get("uvRepeat"):"uvOffset"===r?e.material.get("uvOffset"):t.get(r)}function Yo(e,t){var r=e.material,i=t.material;return r.get("diffuseMap")!==i.get("diffuseMap")||(r.get("alphaCutoff")||0)!==(i.get("alphaCutoff")||0)}Xe["import"](Xo);var Ko=w.extend((function(){return{softShadow:Ko.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new fi,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new Wo}}),(function(){this._gaussianPassH=new vn({fragment:Xe.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new vn({fragment:Xe.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new vn({fragment:Xe.source("clay.sm.debug_depth")})}),{render:function(e,t,r,i){r||(r=t.getMainCamera()),this.trigger("beforerender",this,e,t,r),this._renderShadowPass(e,t,r,i),this.trigger("afterrender",this,e,t,r)},renderDebug:function(e,t){e.saveClear();var r=e.viewport,i=0,n=0,a=t||r.width/4,o=a;for(var s in this.softShadow===Ko.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var l=this._textures[s];e.setViewport(i,n,a*l.width/l.height,o),this._outputDepthPass.setUniform("depthMap",l),this._outputDepthPass.render(e),i+=a*l.width/l.height}e.setViewport(r),e.restoreClear()},_updateReceivers:function(e,t){if(t.receiveShadow?(this._receivers.push(t),t.material.set("shadowEnabled",1),t.material.set("pcfKernel",this.kernelPCF)):t.material.set("shadowEnabled",0),this.softShadow===Ko.VSM)t.material.define("fragment","USE_VSM"),t.material.undefine("fragment","PCF_KERNEL_SIZE");else{t.material.undefine("fragment","USE_VSM");var r=this.kernelPCF;r&&r.length?t.material.define("fragment","PCF_KERNEL_SIZE",r.length/2):t.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(e,t){var r=this;t.traverse((function(t){t.isRenderable()&&r._updateReceivers(e,t)}));for(var i=0;i4){console.warn("Support at most 4 cascade");continue}p.shadowCascade>1&&(o=p),this.renderDirectionalLightShadow(e,t,r,p,h,u,c)}else"SPOT_LIGHT"===p.type?this.renderSpotLightShadow(e,t,p,l,s):"POINT_LIGHT"===p.type&&this.renderPointLightShadow(e,t,p,d);this._shadowMapNumber[p.type]++}for(var m in this._shadowMapNumber){var g=this._shadowMapNumber[m],v=m+"_SHADOWMAP_COUNT";for(f=0;f0?y.define("fragment",v,g):y.isDefined("fragment",v)&&y.undefine("fragment",v))}}for(f=0;f0){var b=c.map(E);if(x.directionalLightShadowMaps={value:c,type:"tv"},x.directionalLightMatrices={value:u,type:"m4v"},x.directionalLightShadowMapSizes={value:b,type:"1fv"},o){var T=h.slice(),w=h.slice();T.pop(),w.shift(),T.reverse(),w.reverse(),u.reverse(),x.shadowCascadeClipsNear={value:T,type:"1fv"},x.shadowCascadeClipsFar={value:w,type:"1fv"}}}if(s.length>0){var S=s.map(E);x=t.shadowUniforms;x.spotLightShadowMaps={value:s,type:"tv"},x.spotLightMatrices={value:l,type:"m4v"},x.spotLightShadowMapSizes={value:S,type:"1fv"}}d.length>0&&(x.pointLightShadowMaps={value:d,type:"tv"})}function E(e){return e.height}},renderDirectionalLightShadow:function(){var e=new jr,t=new Lt,r=new Ft,i=new Lt,n=new Lt,a=new Lt,o=new Lt;return function(s,l,c,u,h,d,f){var p=this._getDepthMaterial(u),m={getMaterial:function(e){return e.shadowDepthMaterial||p},isMaterialChanged:Yo,getUniform:Zo,ifRender:function(e){return e.castShadow},sortCompare:ut.opaqueSortCompare};if(!l.viewBoundingBoxLastFrame.isFinite()){var g=l.getBoundingBox();l.viewBoundingBoxLastFrame.copy(g).applyTransform(c.viewMatrix)}var v=Math.min(-l.viewBoundingBoxLastFrame.min.z,c.far),_=Math.max(-l.viewBoundingBoxLastFrame.max.z,c.near),y=this._getDirectionalLightCamera(u,l,c),x=a.array;o.copy(y.projectionMatrix),Ye.invert(n.array,y.worldTransform.array),Ye.multiply(n.array,n.array,c.worldTransform.array),Ye.multiply(x,o.array,n.array);for(var b=[],T=c instanceof ti,w=(c.near+c.far)/(c.near-c.far),S=2*c.near*c.far/(c.near-c.far),E=0;E<=u.shadowCascade;E++){var A=_*Math.pow(v/_,E/u.shadowCascade),C=_+(v-_)*E/u.shadowCascade,O=A*u.cascadeSplitLogFactor+C*(1-u.cascadeSplitLogFactor);b.push(O),h.push(-(-O*w+S)/-O)}var M=this._getTexture(u,u.shadowCascade);f.push(M);var D=s.viewport,L=s.gl;this._frameBuffer.attach(M),this._frameBuffer.bind(s),L.clear(L.COLOR_BUFFER_BIT|L.DEPTH_BUFFER_BIT);for(E=0;Ed?s>f?p[n>0?"px":"nx"]=!0:p[o>0?"pz":"nz"]=!0:d>f?p[a>0?"py":"ny"]=!0:p[o>0?"pz":"nz"]=!0}for(r=0;r0){var t=this.outputs[e];t.keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e])}}}),$o=Jo,es=w.extend((function(){return{nodes:[]}}),{dirty:function(){this._dirty=!0},addNode:function(e){this.nodes.indexOf(e)>=0||(this.nodes.push(e),this._dirty=!0)},removeNode:function(e){"string"===typeof e&&(e=this.getNodeByName(e));var t=this.nodes.indexOf(e);t>=0&&(this.nodes.splice(t,1),this._dirty=!0)},getNodeByName:function(e){for(var t=0;t=r.COLOR_ATTACHMENT0&&l<=r.COLOR_ATTACHMENT0+8&&u.push(l);c.drawBuffersEXT(u)}e.saveClear(),e.clearBit=O.DEPTH_BUFFER_BIT|O.COLOR_BUFFER_BIT,t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),i.unbind(e)}else t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",t),this._rendering=!1,this._rendered=!0}}),as=ns,os=$o.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}}),ss=os,ls=$o.extend((function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),(function(){var e=new vn({fragment:this.shader});this.pass=e}),{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var r=e.gl;for(var i in this.inputLinks){var n=this.inputLinks[i],a=n.node.getOutput(e,n.pin);this.pass.setUniform(i,a)}if(this.outputs){this.pass.outputs={};var o={};for(var s in this.outputs){var l=this.updateParameter(s,e);isNaN(l.width)&&this.updateParameter(s,e);var c=this.outputs[s],u=this._compositor.allocateTexture(l);this._outputTextures[s]=u;var h=c.attachment||r.COLOR_ATTACHMENT0;"string"===typeof h&&(h=r[h]),o[h]=u}for(var h in this._compositor.getFrameBuffer().bind(e),o)this._compositor.getFrameBuffer().attach(o[h],h);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);for(var i in this.inputLinks){n=this.inputLinks[i];n.node.removeReference(n.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var r,i,n=this.outputs[e],a=n.parameters,o=n._parametersCopy;if(o||(o=n._parametersCopy={}),a)for(var s in a)"width"!==s&&"height"!==s&&(o[s]=a[s]);return r="function"===typeof a.width?a.width.call(this,t):a.width,i="function"===typeof a.height?a.height.call(this,t):a.height,r=Math.ceil(r),i=Math.ceil(i),o.width===r&&o.height===i||this._outputTextures[e]&&this._outputTextures[e].dispose(t),o.width=r,o.height=i,o},setParameter:function(e,t){this.pass.setUniform(e,t)},getParameter:function(e){return this.pass.getUniform(e)},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},define:function(e,t){this.pass.material.define("fragment",e,t)},undefine:function(e){this.pass.material.undefine("fragment",e)},removeReference:function(e){if(this._outputReferences[e]--,0===this._outputReferences[e]){var t=this.outputs[e];t.keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e])}},clear:function(){$o.prototype.clear.call(this),this.pass.material.disableTexturesAll()}}),cs=ls,us="@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end",hs="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n",ds="@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end",fs="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end",ps="@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end",ms="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",gs="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n",vs="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end",_s="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end",ys="@export clay.compositor.hdr.composite\n#define TONEMAPPING\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n#ifdef TONEMAPPING\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",xs="@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end",bs="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end",Ts="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end";function ws(e){e["import"](us),e["import"](hs),e["import"](ds),e["import"](fs),e["import"](ps),e["import"](ms),e["import"](gs),e["import"](vs),e["import"](_s),e["import"](ys),e["import"](xs),e["import"](bs),e["import"](Ts)}ws(Xe);var Ss=/^#source\((.*?)\)/;function Es(e,t){var r=new is;t=t||{};var i={textures:{},parameters:{}},n=function(n,a){for(var o=0;o0)r+=i*(n%t),n=Math.floor(n/t),i/=t;return r}var js=Bs,zs="@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n";function Fs(e){for(var t=new Uint8Array(e*e*4),r=0,i=new _t,n=0;n 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {\n float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));\n vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;\n return transformNormal(H, N);\n}\nfloat G_Smith(float g, float ndv, float ndl) {\n float roughness = 1.0 - g;\n float k = roughness * roughness / 2.0;\n float G1V = ndv / (ndv * (1.0 - k) + k);\n float G1L = ndl / (ndl * (1.0 - k) + k);\n return G1L * G1V;\n}\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n#endif\n\nfloat fetchDepth(sampler2D depthTexture, vec2 uv)\n{\n vec4 depthTexel = texture2D(depthTexture, uv);\n return depthTexel.r * 2.0 - 1.0;\n}\n\nfloat linearDepth(float depth)\n{\n if (projection[3][3] == 0.0) {\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n }\n else {\n return (depth - projection[3][2]) / projection[2][2];\n }\n}\n\nbool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)\n{\n if (rayZFar > rayZNear)\n {\n float t = rayZFar; rayZFar = rayZNear; rayZNear = t;\n }\n float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));\n return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;\n}\n\n\nbool traceScreenSpaceRay(\n vec3 rayOrigin, vec3 rayDir, float jitter,\n out vec2 hitPixel, out vec3 hitPoint, out float iterationCount\n)\n{\n float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)\n ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;\n\n vec3 rayEnd = rayOrigin + rayDir * rayLength;\n\n vec4 H0 = projection * vec4(rayOrigin, 1.0);\n vec4 H1 = projection * vec4(rayEnd, 1.0);\n\n float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;\n\n vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;\n\n vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;\n vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;\n\n P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;\n vec2 delta = P1 - P0;\n\n bool permute = false;\n if (abs(delta.x) < abs(delta.y)) {\n permute = true;\n delta = delta.yx;\n P0 = P0.yx;\n P1 = P1.yx;\n }\n float stepDir = sign(delta.x);\n float invdx = stepDir / delta.x;\n\n vec3 dQ = (Q1 - Q0) * invdx;\n float dk = (k1 - k0) * invdx;\n\n vec2 dP = vec2(stepDir, delta.y * invdx);\n\n float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);\n float pixStride = 1.0 + strideScaler * pixelStride;\n\n dP *= pixStride; dQ *= pixStride; dk *= pixStride;\n\n vec4 pqk = vec4(P0, Q0.z, k0);\n vec4 dPQK = vec4(dP, dQ.z, dk);\n\n pqk += dPQK * jitter;\n float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n float rayZNear;\n\n bool intersect = false;\n\n vec2 texelSize = 1.0 / viewportSize;\n\n iterationCount = 0.0;\n\n for (int i = 0; i < MAX_ITERATION; i++)\n {\n pqk += dPQK;\n\n rayZNear = rayZFar;\n rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n\n hitPixel = permute ? pqk.yx : pqk.xy;\n hitPixel *= texelSize;\n\n intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);\n\n iterationCount += 1.0;\n\n dPQK *= 1.2;\n\n if (intersect) {\n break;\n }\n }\n\n Q0.xy += dQ.xy * iterationCount;\n Q0.z = pqk.z;\n hitPoint = Q0 / pqk.w;\n\n return intersect;\n}\n\nfloat calculateAlpha(\n float iterationCount, float reflectivity,\n vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir\n)\n{\n float alpha = clamp(reflectivity, 0.0, 1.0);\n alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));\n vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;\n float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));\n alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);\n\n float _eyeFadeStart = eyeFadeStart;\n float _eyeFadeEnd = eyeFadeEnd;\n if (_eyeFadeStart > _eyeFadeEnd) {\n float tmp = _eyeFadeEnd;\n _eyeFadeEnd = _eyeFadeStart;\n _eyeFadeStart = tmp;\n }\n\n float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);\n alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);\n\n alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);\n\n return alpha;\n}\n\n@import clay.util.rand\n\n@import clay.util.rgbm\n\nvoid main()\n{\n vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);\n\n if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {\n discard;\n }\n\n float g = normalAndGloss.a;\n#if !defined(PHYSICALLY_CORRECT)\n if (g <= minGlossiness) {\n discard;\n }\n#endif\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);\n N = normalize((toViewSpace * vec4(N, 0.0)).xyz);\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);\n vec4 pos = projectionInv * projectedPos;\n vec3 rayOrigin = pos.xyz / pos.w;\n vec3 V = -normalize(rayOrigin);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n float iterationCount;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n#ifdef PHYSICALLY_CORRECT\n vec4 color = vec4(vec3(0.0), 1.0);\n vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);\n vec3 albedo = albedoMetalness.rgb;\n float m = albedoMetalness.a;\n vec3 diffuseColor = albedo * (1.0 - m);\n vec3 spec = mix(vec3(0.04), albedo, m);\n\n float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);\n\n for (int i = 0; i < SAMPLE_PER_FRAME; i++) {\n vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);\n vec3 rayDir = normalize(reflect(-V, H));\n#else\n vec3 rayDir = normalize(reflect(-V, N));\n#endif\n vec2 hitPixel;\n vec3 hitPoint;\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);\n#ifdef PHYSICALLY_CORRECT\n float ndl = clamp(dot(N, rayDir), 0.0, 1.0);\n float vdh = clamp(dot(V, H), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n vec3 litTexel = vec3(0.0);\n if (dot(hitNormal, rayDir) < 0.0 && intersect) {\n litTexel = texture2D(sourceTexture, hitPixel).rgb;\n litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);\n\n }\n else {\n #ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;\n#endif\n }\n color.rgb += ndl * litTexel * (\n F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)\n );\n }\n color.rgb /= float(SAMPLE_PER_FRAME);\n#else\n #if !defined(SPECULARCUBEMAP_ENABLED)\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n if (!intersect) {\n discard;\n }\n#endif\n float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);\n vec4 color = texture2D(sourceTexture, hitPixel);\n color.rgb *= alpha;\n\n#ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n alpha = alpha * (intersect ? 1.0 : 0.0);\n float bias = (1.0 -g) * 5.0;\n color.rgb += (1.0 - alpha)\n * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb\n * specularIntensity;\n#endif\n\n#endif\n\n gl_FragColor = encodeHDR(color);\n}\n@end\n\n@export ecgl.ssr.blur\n\nuniform sampler2D texture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform mat4 projection;\nuniform float depthRange : 0.05;\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\n#ifdef BLEND\n #ifdef SSAOTEX_ENABLED\nuniform sampler2D ssaoTex;\n #endif\nuniform sampler2D sourceTexture;\n#endif\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n\n@import clay.util.rgbm\n\n\nvoid main()\n{\n @import clay.compositor.kernel.gaussian_9\n\n vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);\n float g = centerNTexel.a;\n float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;\n#ifdef VERTICAL\n vec2 off = vec2(0.0, maxBlurSize / textureSize.y);\n#else\n vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);\n#endif\n\n vec2 coord = v_Texcoord;\n\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n\n vec3 cN = centerNTexel.rgb * 2.0 - 1.0;\n float cD = getLinearDepth(v_Texcoord);\n for (int i = 0; i < 9; i++) {\n vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));\n float w = gaussianKernel[i]\n * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));\n\n weightAll += w;\n sum += decodeHDR(texture2D(texture, coord)) * w;\n }\n\n#ifdef BLEND\n float aoFactor = 1.0;\n #ifdef SSAOTEX_ENABLED\n aoFactor = texture2D(ssaoTex, v_Texcoord).r;\n #endif\n gl_FragColor = encodeHDR(\n sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))\n );\n#else\n gl_FragColor = encodeHDR(sum / weightAll);\n#endif\n}\n\n@end";function Ws(e){e=e||{},this._ssrPass=new vn({fragment:Xe.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new vn({fragment:Xe.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new vn({fragment:Xe.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new vn({fragment:Xe.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),this._ssrPass.setUniform("gBufferTexture1",e.normalTexture),this._ssrPass.setUniform("gBufferTexture2",e.depthTexture),this._blurPass1.setUniform("gBufferTexture1",e.normalTexture),this._blurPass1.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.setUniform("gBufferTexture1",e.normalTexture),this._blurPass2.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._ssrTexture=new or({type:Qt.HALF_FLOAT}),this._texture2=new or({type:Qt.HALF_FLOAT}),this._texture3=new or({type:Qt.HALF_FLOAT}),this._prevTexture=new or({type:Qt.HALF_FLOAT}),this._currentTexture=new or({type:Qt.HALF_FLOAT}),this._frameBuffer=new fi({depthBuffer:!1}),this._normalDistribution=null,this._totalSamples=256,this._samplePerFrame=4,this._ssrPass.material.define("fragment","SAMPLE_PER_FRAME",this._samplePerFrame),this._ssrPass.material.define("fragment","TOTAL_SAMPLES",this._totalSamples),this._downScale=1}Xe.import(Hs),Ws.prototype.setAmbientCubemap=function(e,t){this._ssrPass.material.set("specularCubemap",e),this._ssrPass.material.set("specularIntensity",t);var r=e&&t;this._ssrPass.material[r?"enableTexture":"disableTexture"]("specularCubemap")},Ws.prototype.update=function(e,t,r,i){var n=e.getWidth(),a=e.getHeight(),o=this._ssrTexture,s=this._texture2,l=this._texture3;o.width=this._prevTexture.width=this._currentTexture.width=n/this._downScale,o.height=this._prevTexture.height=this._currentTexture.height=a/this._downScale,s.width=l.width=n,s.height=l.height=a;var c=this._frameBuffer,u=this._ssrPass,h=this._blurPass1,d=this._blurPass2,f=this._blendPass,p=new Lt,m=new Lt;Lt.transpose(p,t.worldTransform),Lt.transpose(m,t.viewMatrix),u.setUniform("sourceTexture",r),u.setUniform("projection",t.projectionMatrix.array),u.setUniform("projectionInv",t.invProjectionMatrix.array),u.setUniform("toViewSpace",p.array),u.setUniform("toWorldSpace",m.array),u.setUniform("nearZ",t.near);var g=i/this._totalSamples*this._samplePerFrame;if(u.setUniform("jitterOffset",g),u.setUniform("sampleOffset",i*this._samplePerFrame),h.setUniform("textureSize",[o.width,o.height]),d.setUniform("textureSize",[n,a]),d.setUniform("sourceTexture",r),h.setUniform("projection",t.projectionMatrix.array),d.setUniform("projection",t.projectionMatrix.array),c.attach(o),c.bind(e),u.render(e),this._physicallyCorrect&&(c.attach(this._currentTexture),f.setUniform("texture1",this._prevTexture),f.setUniform("texture2",o),f.material.set({weight1:i>=1?.95:0,weight2:i>=1?.05:1}),f.render(e)),c.attach(s),h.setUniform("texture",this._physicallyCorrect?this._currentTexture:o),h.render(e),c.attach(l),d.setUniform("texture",s),d.render(e),c.unbind(e),this._physicallyCorrect){var v=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=v}},Ws.prototype.getTargetTexture=function(){return this._texture3},Ws.prototype.setParameter=function(e,t){"maxIteration"===e?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)},Ws.prototype.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=Tn.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=e},Ws.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")},Ws.prototype.isFinished=function(e){return!this._physicallyCorrect||e>this._totalSamples/this._samplePerFrame},Ws.prototype.dispose=function(e){this._ssrTexture.dispose(e),this._texture2.dispose(e),this._texture3.dispose(e),this._prevTexture.dispose(e),this._currentTexture.dispose(e),this._frameBuffer.dispose(e)};var Xs=Ws,qs=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925],Zs="@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end";function Ys(e,t,r,i,n){var a=e.gl;t.setUniform(a,"1i",r,n),a.activeTexture(a.TEXTURE0+n),i.isRenderable()?i.bind(e):i.unbind(e)}function Ks(e,t,r,i,n){var a,o,s,l,c=e.gl;return function(n,u,h){if(!l||l.material!==n.material){var d=n.material,f=n.__program,p=d.get("roughness");null==p&&(p=1);var m=d.get("normalMap")||t,g=d.get("roughnessMap"),v=d.get("bumpMap"),_=d.get("uvRepeat"),y=d.get("uvOffset"),x=d.get("detailUvRepeat"),b=d.get("detailUvOffset"),T=!!v&&d.isTextureEnabled("bumpMap"),w=!!g&&d.isTextureEnabled("roughnessMap"),S=d.isDefined("fragment","DOUBLE_SIDED");v=v||r,g=g||i,h!==u?(u.set("normalMap",m),u.set("bumpMap",v),u.set("roughnessMap",g),u.set("useBumpMap",T),u.set("useRoughnessMap",w),u.set("doubleSide",S),null!=_&&u.set("uvRepeat",_),null!=y&&u.set("uvOffset",y),null!=x&&u.set("detailUvRepeat",x),null!=b&&u.set("detailUvOffset",b),u.set("roughness",p)):(f.setUniform(c,"1f","roughness",p),a!==m&&Ys(e,f,"normalMap",m,0),o!==v&&v&&Ys(e,f,"bumpMap",v,1),s!==g&&g&&Ys(e,f,"roughnessMap",g,2),null!=_&&f.setUniform(c,"2f","uvRepeat",_),null!=y&&f.setUniform(c,"2f","uvOffset",y),null!=x&&f.setUniform(c,"2f","detailUvRepeat",x),null!=b&&f.setUniform(c,"2f","detailUvOffset",b),f.setUniform(c,"1i","useBumpMap",+T),f.setUniform(c,"1i","useRoughnessMap",+w),f.setUniform(c,"1i","doubleSide",+S)),a=m,o=v,s=g,l=n}}}function Qs(e){e=e||{},this._depthTex=new or({format:Qt.DEPTH_COMPONENT,type:Qt.UNSIGNED_INT}),this._normalTex=new or({type:Qt.HALF_FLOAT}),this._framebuffer=new fi,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,fi.DEPTH_ATTACHMENT),this._normalMaterial=new re({shader:new Xe(Xe.source("ecgl.normal.vertex"),Xe.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=an.createBlank("#000"),this._defaultBumpMap=an.createBlank("#000"),this._defaultRoughessMap=an.createBlank("#000"),this._debugPass=new vn({fragment:Xe.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}Xe.import(Zs),Qs.prototype.getDepthTexture=function(){return this._depthTex},Qs.prototype.getNormalTexture=function(){return this._normalTex},Qs.prototype.update=function(e,t,r){var i=e.getWidth(),n=e.getHeight(),a=this._depthTex,o=this._normalTex,s=this._normalMaterial;a.width=i,a.height=n,o.width=i,o.height=n;var l=t.getRenderList(r).opaque;this._framebuffer.bind(e),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.disable(e.gl.BLEND),e.renderPass(l,r,{getMaterial:function(){return s},ifRender:function(e){return e.renderNormal},beforeRender:Ks(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)},Qs.prototype.renderDebug=function(e){this._debugPass.render(e)},Qs.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)};var Js=Qs;function $s(e){e=e||{},this._edgePass=new vn({fragment:Xe.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new or({type:Qt.HALF_FLOAT}),this._frameBuffer=new fi,this._frameBuffer.attach(this._targetTexture)}$s.prototype.update=function(e,t,r,i){var n=e.getWidth(),a=e.getHeight(),o=this._targetTexture;o.width=n,o.height=a;var s=this._frameBuffer;s.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[n,a]),this._edgePass.setUniform("texture",r),this._edgePass.render(e),s.unbind(e)},$s.prototype.getTargetTexture=function(){return this._targetTexture},$s.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)},$s.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)};var el=$s,tl={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]},rl="@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = texture2D(blurred, v_Texcoord);\n vec4 originalColor = texture2D(original, v_Texcoord);\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end",il="@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end";function nl(e,t){return{color:{parameters:{width:e,height:t}}}}Xe["import"](hs),Xe["import"](fs),Xe["import"](ms),Xe["import"](gs),Xe["import"](vs),Xe["import"](_s),Xe["import"](ys),Xe["import"](bs),Xe["import"](Ts),Xe["import"](rl),Xe["import"](il);var al=["composite","FXAA"];function ol(){this._width,this._height,this._dpr,this._sourceTexture=new or({type:Qt.HALF_FLOAT}),this._depthTexture=new or({format:Qt.DEPTH_COMPONENT,type:Qt.UNSIGNED_INT}),this._framebuffer=new fi,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,fi.DEPTH_ATTACHMENT),this._normalPass=new Js,this._compositor=Is(tl);var e=this._compositor.getNodeByName("source");e.texture=this._sourceTexture;var t=this._compositor.getNodeByName("coc");this._sourceNode=e,this._cocNode=t,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map((function(e){return this._compositor.getNodeByName(e)}),this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=al.map((function(e){return this._compositor.getNodeByName(e)}),this);var r={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new Gs(r),this._ssrPass=new Xs(r),this._edgePass=new el(r)}ol.prototype.resize=function(e,t,r){r=r||1;e*=r,t*=r;var i=this._sourceTexture,n=this._depthTexture;i.width=e,i.height=t,n.width=e,n.height=t;var a={getWidth:function(){return e},getHeight:function(){return t},getDevicePixelRatio:function(){return r}};function o(e,t){if("function"===typeof e[t]){var r=e[t].__original||e[t];e[t]=function(e){return r.call(this,a)},e[t].__original=r}}this._compositor.nodes.forEach((function(e){for(var t in e.outputs){var r=e.outputs[t].parameters;r&&(o(r,"width"),o(r,"height"))}for(var i in e.parameters)o(e.parameters,i)})),this._width=e,this._height=t,this._dpr=r},ol.prototype.getWidth=function(){return this._width},ol.prototype.getHeight=function(){return this._height},ol.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},ol.prototype._getPrevNode=function(e){var t=al.indexOf(e.name)-1,r=this._finalNodesChain[t];while(r&&!this._compositor.getNodeByName(r.name))t-=1,r=this._finalNodesChain[t];return r},ol.prototype._getNextNode=function(e){var t=al.indexOf(e.name)+1,r=this._finalNodesChain[t];while(r&&!this._compositor.getNodeByName(r.name))t+=1,r=this._finalNodesChain[t];return r},ol.prototype._addChainNode=function(e){var t=this._getPrevNode(e),r=this._getNextNode(e);t&&(e.inputs.texture=t.name,r?(e.outputs=nl(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))},ol.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),r=this._getNextNode(e);t&&(r?(t.outputs=nl(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))},ol.prototype.updateNormal=function(e,t,r,i){this._ifRenderNormalPass()&&this._normalPass.update(e,t,r)},ol.prototype.updateSSAO=function(e,t,r,i){this._ssaoPass.update(e,r,i)},ol.prototype.enableSSAO=function(){this._enableSSAO=!0},ol.prototype.disableSSAO=function(){this._enableSSAO=!1},ol.prototype.enableSSR=function(){this._enableSSR=!0},ol.prototype.disableSSR=function(){this._enableSSR=!1},ol.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},ol.prototype.getSourceFrameBuffer=function(){return this._framebuffer},ol.prototype.getSourceTexture=function(){return this._sourceTexture},ol.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},ol.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},ol.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},ol.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},ol.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},ol.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},ol.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},ol.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},ol.prototype.enableEdge=function(){this._enableEdge=!0},ol.prototype.disableEdge=function(){this._enableEdge=!1},ol.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)},ol.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var r={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",r);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t);break;default:0}},ol.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var r=0;r=this._haltonSequence.length},render:function(e,t,r){var i=this._blendPass;0===this._frame?(i.setUniform("weight1",0),i.setUniform("weight2",1)):(i.setUniform("weight1",.9),i.setUniform("weight2",.1)),i.setUniform("texture1",this._prevFrameTex),i.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),i.render(e),this._blendFb.unbind(e),r||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var n=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=n,this._frame++},dispose:function(e){this._sourceFb.dispose(e),this._blendFb.dispose(e),this._prevFrameTex.dispose(e),this._outputTex.dispose(e),this._sourceTex.dispose(e),this._outputPass.dispose(e),this._blendPass.dispose(e)}};var cl=ll;function ul(e){e=e||"perspective",this.layer=null,this.scene=new qr,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new sl,this._temporalSS=new cl,this._shadowMapPass=new Qo;for(var t=[],r=0,i=0;i<30;i++){for(var n=[],a=0;a<6;a++)n.push(4*js(r,2)-2),n.push(4*js(r,3)-2),r++;t.push(n)}this._pcfKernels=t,this.scene.on("beforerender",(function(e,t,r){this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,r)}),this)}ul.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),"perspective"===e?this.camera instanceof ti||(this.camera=new ti,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof hn||(this.camera=new hn,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3},ul.prototype.setViewport=function(e,t,r,i,n){this.camera instanceof ti&&(this.camera.aspect=r/i),n=n||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=r,this.viewport.height=i,this.viewport.devicePixelRatio=n,this._compositor.resize(r*n,i*n),this._temporalSS.resize(r*n,i*n)},ul.prototype.containPoint=function(e,t){var r=this.viewport,i=this.layer.renderer.getHeight();return t=i-t,e>=r.x&&t>=r.y&&e<=r.x+r.width&&t<=r.y+r.height};var hl=new ue;ul.prototype.castRay=function(e,t,r){var i=this.layer.renderer,n=i.viewport;return i.viewport=this.viewport,i.screenToNDC(e,t,hl),this.camera.castRay(hl,r),i.viewport=n,r},ul.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var e=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var t=0;t30},ul.prototype._doRender=function(e,t,r){var i=this.scene,n=this.camera;r=r||0,this._updateTransparent(e,i,n,r),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,i,n,!0)),this._updateShadowPCFKernel(r);var a=e.clearColor;if(e.gl.clearColor(a[0],a[1],a[2],a[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,n),this._compositor.updateNormal(e,i,n,this._temporalSS.getFrame())),this._updateSSAO(e,i,n,this._temporalSS.getFrame()),this._enablePostEffect){var o=this._compositor.getSourceFrameBuffer();o.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(i,n,!0,!0),o.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,i,n,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,i,n,null,0))}else if(this.needsTemporalSS()&&t){o=this._temporalSS.getSourceFrameBuffer();o.bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(i,n,!0,!0),e.restoreClear(),o.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)}else e.setViewport(this.viewport),e.render(i,n,!0,!0)},ul.prototype._updateTransparent=function(e,t,r,i){for(var n=new _t,a=new Lt,o=r.getWorldPosition(),s=t.getRenderList(r).transparent,l=0;lthis.camera.far||e80*r){i=a=e[0],n=o=e[1];for(var p=r;pa&&(a=s),l>o&&(o=l);c=Math.max(a-i,o-n)}return zl(d,f,r,i,n,c),f}function Bl(e,t,r,i,n){var a,o;if(n===cc(e,t,r,i)>0)for(a=t;a=t;a-=i)o=oc(a,e[a],e[a+1],o);return o&&ec(o,o.next)&&(sc(o),o=o.next),o}function jl(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!ec(i,i.next)&&0!==$l(i.prev,i,i.next))i=i.next;else{if(sc(i),i=t=i.prev,i===i.next)return null;r=!0}}while(r||i!==t);return t}function zl(e,t,r,i,n,a,o){if(e){!o&&a&&ql(e,i,n,a);var s,l,c=e;while(e.prev!==e.next)if(s=e.prev,l=e.next,a?Vl(e,i,n,a):Fl(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),sc(e),e=l.next,c=l.next;else if(e=l,e===c){o?1===o?(e=kl(e,t,r),zl(e,t,r,i,n,a,2)):2===o&&Ul(e,t,r,i,n,a):zl(jl(e),t,r,i,n,a,1);break}}}function Fl(e){var t=e.prev,r=e,i=e.next;if($l(t,r,i)>=0)return!1;var n=e.next.next;while(n!==e.prev){if(Ql(t.x,t.y,r.x,r.y,i.x,i.y,n.x,n.y)&&$l(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function Vl(e,t,r,i){var n=e.prev,a=e,o=e.next;if($l(n,a,o)>=0)return!1;var s=n.xa.x?n.x>o.x?n.x:o.x:a.x>o.x?a.x:o.x,u=n.y>a.y?n.y>o.y?n.y:o.y:a.y>o.y?a.y:o.y,h=Yl(s,l,t,r,i),d=Yl(c,u,t,r,i),f=e.nextZ;while(f&&f.z<=d){if(f!==e.prev&&f!==e.next&&Ql(n.x,n.y,a.x,a.y,o.x,o.y,f.x,f.y)&&$l(f.prev,f,f.next)>=0)return!1;f=f.nextZ}f=e.prevZ;while(f&&f.z>=h){if(f!==e.prev&&f!==e.next&&Ql(n.x,n.y,a.x,a.y,o.x,o.y,f.x,f.y)&&$l(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function kl(e,t,r){var i=e;do{var n=i.prev,a=i.next.next;!ec(n,a)&&tc(n,i,i.next,a)&&ic(n,a)&&ic(a,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(a.i/r),sc(i),sc(i.next),i=e=a),i=i.next}while(i!==e);return i}function Ul(e,t,r,i,n,a){var o=e;do{var s=o.next.next;while(s!==o.prev){if(o.i!==s.i&&Jl(o,s)){var l=ac(o,s);return o=jl(o,o.next),l=jl(l,l.next),zl(o,t,r,i,n,a),void zl(l,t,r,i,n,a)}s=s.next}o=o.next}while(o!==e)}function Gl(e,t,r,i){var n,a,o,s,l,c=[];for(n=0,a=t.length;n=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>o){if(o=s,s===n){if(a===i.y)return i;if(a===i.next.y)return i.next}r=i.x=i.x&&i.x>=u&&n!==i.x&&Ql(ar.x)&&ic(i,e)&&(r=i,d=l)),i=i.next;return r}function ql(e,t,r,i){var n=e;do{null===n.z&&(n.z=Yl(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,Zl(n)}function Zl(e){var t,r,i,n,a,o,s,l,c=1;do{r=e,e=null,a=null,o=0;while(r){for(o++,i=r,s=0,t=0;t0||l>0&&i)0!==s&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;r=i}a.nextZ=null,c*=2}while(o>1);return e}function Yl(e,t,r,i,n){return e=32767*(e-r)/n,t=32767*(t-i)/n,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function Kl(e){var t=e,r=e;do{t.x=0&&(e-o)*(i-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(n-o)*(i-s)>=0}function Jl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!rc(e,t)&&ic(e,t)&&ic(t,e)&&nc(e,t)}function $l(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function ec(e,t){return e.x===t.x&&e.y===t.y}function tc(e,t,r,i){return!!(ec(e,t)&&ec(r,i)||ec(e,i)&&ec(r,t))||$l(e,t,r)>0!==$l(e,t,i)>0&&$l(r,i,e)>0!==$l(r,i,t)>0}function rc(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&tc(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function ic(e,t){return $l(e.prev,e,e.next)<0?$l(e,t,e.next)>=0&&$l(e,e.prev,t)>=0:$l(e,t,e.prev)<0||$l(e,e.next,t)<0}function nc(e,t){var r=e,i=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&n<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}function ac(e,t){var r=new lc(e.i,e.x,e.y),i=new lc(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function oc(e,t,r,i){var n=new lc(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function sc(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function lc(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function cc(e,t,r,i){for(var n=0,a=t,o=r-i;al&&s.push({pivot:Math.floor((c+l)/2),left:l,right:c});l=a[o].pivot+1,c=a[o].right;c>l&&s.push({pivot:Math.floor((c+l)/2),left:l,right:c})}a=this._parts=s}else for(o=0;o=2e4},doSortTriangles:function(e,t){var r=this.indices;if(0===t){var i=this.attributes.position;e=e.array;this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new r.constructor(r.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var n,a=0,o=0;o0,r={},i=0;i65535?new Uint32Array(3*o):new Uint16Array(3*o),d.material.shader!==t&&d.material.attachShader(t,!0),Ea.setMaterialFromModel(t.__shading,d.material,e,r),s>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(s),this._linesMesh.geometry.setTriangleCount(l)),this._dataIndexOfVertex=new Uint32Array(a),this._vertexRangeOfDataIndex=new Uint32Array(2*(n-i))},_updateRegionMesh:function(e,t,r,i){for(var n=e.getData(),a=0,o=0,s=!1,l=this._polygonMesh,c=this._linesMesh,u=r;u0;T&&(b*=t.getDevicePixelRatio(),this._updateLinesGeometry(c.geometry,e,u,_,b,e.coordinateSystem.transform)),c.invisible=!T,c.material.set({color:g})}l=this._polygonMesh;l.material.transparent=s,l.material.depthMask=!s,l.geometry.updateBoundingBox(),l.frontFace=this.extrudeY?Ea.Mesh.CCW:Ea.Mesh.CW,l.material.get("normalMap")&&l.geometry.generateTangents(),l.seriesIndex=e.seriesIndex,l.on("mousemove",this._onmousemove,this),l.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(e){var t=e.getModel("debug.wireframe");if(t.get("show")){var r=Ea.parseColor(t.get("lineStyle.color")||"rgba(0,0,0,0.5)"),i=Pn.firstNotNull(t.get("lineStyle.width"),1),n=this._polygonMesh;n.geometry.generateBarycentric(),n.material.define("both","WIREFRAME_TRIANGLE"),n.material.set("wireframeLineColor",r),n.material.set("wireframeLineWidth",i)}},_onmousemove:function(e){var t=this._dataIndexOfVertex[e.triangle[0]];null==t&&(t=-1),t!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(t),this._labelsBuilder.updateLabels([t])),this._lastHoverDataIndex=t,this._polygonMesh.dataIndex=t},_onmouseout:function(e){e.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1),this._labelsBuilder.updateLabels([])},_updateGroundPlane:function(e,t,r){var i=e.getModel("groundPlane",e);if(this._groundMesh.invisible=!i.get("show",!0),!this._groundMesh.invisible){var n=e.get("shading"),a=this._groundMaterials[n];a||(a=this._groundMaterials.lambert),Ea.setMaterialFromModel(n,a,i,r),a.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=a,this._groundMesh.material.set("color",Ea.parseColor(i.get("color"))),this._groundMesh.scale.set(t.size[0],t.size[2],1)}},_triangulation:function(e,t,r){this._triangulationResults=[];for(var i=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0],a=e.coordinateSystem,o=t;o1?i:0,L[k][g]=C.points[G+2],l.set(n+k,L[k]),s?(I[0]=(C.points[G]*v[0]-_[0])/x,I[1]=(C.points[G+2]*v[g]-_[g])/x):(I[0]=(U?B:B+V)/x,I[1]=(L[k][m]*v[m]-_[m])/x),u.set(n+k,I)}Oc.sub(N,L[1],L[0]),Oc.sub(R,L[3],L[0]),Oc.cross(P,N,R),Oc.normalize(P,P);for(k=0;k<4;k++)c.set(n+k,P),f&&h.set(n+k,o);for(k=0;k<6;k++)p[3*a+k]=D[k]+n;n+=4,a+=2,B+=V}}return t.dirty(),{vertexOffset:n,triangleOffset:a}},_getRegionLinesInfo:function(e,t,r){var i=0,n=0,a=t.getRegionModel(e),o=a.getModel("itemStyle"),s=o.get("borderWidth");if(s>0){var l=t.getRegionPolygonCoords(e);l.forEach((function(e){var t=e.exterior,a=e.interiors;i+=r.getPolylineVertexCount(t),n+=r.getPolylineTriangleCount(t);for(var o=0;othis._endIndex)){t-=this._startIndex;for(var i=this._vertexRangeOfDataIndex[2*t];i0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var e=this.getDisplacementTexture(),t=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==e||this._displacementScale!==t,this._displacementTexture=e,this._displacementScale=t},isDisplacementChanged:function(){return this._displacementChanged}});a["w"].merge(qc.prototype,ka),a["w"].merge(qc.prototype,Ua),a["w"].merge(qc.prototype,Ga),a["w"].merge(qc.prototype,Dl);var Zc=qc,Yc=Math.PI,Kc=Math.sin,Qc=Math.cos,Jc=Math.tan,$c=Math.asin,eu=Math.atan2,tu=Yc/180,ru=864e5,iu=2440588,nu=2451545;function au(e){return e.valueOf()/ru-.5+iu}function ou(e){return au(e)-nu}var su=23.4397*tu;function lu(e,t){return eu(Kc(e)*Qc(su)-Jc(t)*Kc(su),Qc(e))}function cu(e,t){return $c(Kc(t)*Qc(su)+Qc(t)*Kc(su)*Kc(e))}function uu(e,t,r){return eu(Kc(e),Qc(e)*Kc(t)-Jc(r)*Qc(t))}function hu(e,t,r){return $c(Kc(t)*Kc(r)+Qc(t)*Qc(r)*Qc(e))}function du(e,t){return tu*(280.16+360.9856235*e)-t}function fu(e){return tu*(357.5291+.98560028*e)}function pu(e){var t=tu*(1.9148*Kc(e)+.02*Kc(2*e)+3e-4*Kc(3*e)),r=102.9372*tu;return e+t+r+Yc}function mu(e){var t=fu(e),r=pu(t);return{dec:cu(r,0),ra:lu(r,0)}}var gu={getPosition:function(e,t,r){var i=tu*-r,n=tu*t,a=ou(e),o=mu(a),s=du(a,i)-o.ra;return{azimuth:uu(s,n,o.dec),altitude:hu(s,n,o.dec)}}},vu=gu,_u="@export ecgl.atmosphere.vertex\nattribute vec3 position: POSITION;\nattribute vec3 normal : NORMAL;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 normalMatrix : WORLDINVERSETRANSPOSE;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n v_Normal = normalize((normalMatrix * vec4(normal, 0.0)).xyz);\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n\n\n@export ecgl.atmosphere.fragment\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform float glowPower;\nuniform vec3 glowColor;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n float intensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor = vec4(glowColor, intensity * intensity);\n}\n@end";Ea.Shader["import"](la),Ea.Shader["import"](_u);var yu=a["d"].extend({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(e,t){this.groupGL=new Ea.Node,this._sphereGeometry=new Ea.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new Ea.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new Ea.PlaneGeometry,this._earthMesh=new Ea.Mesh({renderNormal:!0}),this._atmosphereMesh=new Ea.Mesh,this._atmosphereGeometry=new Ea.SphereGeometry({widthSegments:80,heightSegments:40}),this._atmosphereMaterial=new Ea.Material({shader:new Ea.Shader(Ea.Shader.source("ecgl.atmosphere.vertex"),Ea.Shader.source("ecgl.atmosphere.fragment")),transparent:!0}),this._atmosphereMesh.geometry=this._atmosphereGeometry,this._atmosphereMesh.material=this._atmosphereMaterial,this._atmosphereMesh.frontFace=Ea.Mesh.CW,this._lightRoot=new Ea.Node,this._sceneHelper=new co,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._atmosphereMesh),this.groupGL.add(this._earthMesh),this._control=new Qa({zr:t.getZr()}),this._control.init(),this._layerMeshes={}},render:function(e,t,r){var i=e.coordinateSystem,n=e.get("shading");i.viewGL.add(this._lightRoot),e.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL),this._sceneHelper.setScene(i.viewGL.scene),i.viewGL.setPostEffect(e.getModel("postEffect"),r),i.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var a=this._earthMesh;a.geometry=this._sphereGeometry;var o="ecgl."+n;a.material&&a.material.shader.name===o||(a.material=Ea.createMaterial(o)),Ea.setMaterialFromModel(n,a.material,e,r),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(e){var t=a.material.get(e);t&&(t.flipY=!1)})),a.material.set("color",Ea.parseColor(e.get("baseColor")));var s=.99*i.radius;if(a.scale.set(s,s,s),e.get("atmosphere.show")){a.material.define("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!1,this._atmosphereMaterial.setUniforms({glowPower:e.get("atmosphere.glowPower")||6,glowColor:e.get("atmosphere.color")||"#ffffff"}),a.material.setUniforms({glowPower:e.get("atmosphere.innerGlowPower")||2,glowColor:e.get("atmosphere.color")||"#ffffff"});var l=e.get("atmosphere.offset")||5;this._atmosphereMesh.scale.set(s+l,s+l,s+l)}else a.material.undefine("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!0;var c=a.material.setTextureImage("diffuseMap",e.get("baseTexture"),r,{flipY:!1,anisotropic:8});c&&c.surface&&c.surface.attachToMesh(a);var u=a.material.setTextureImage("bumpMap",e.get("heightTexture"),r,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(a),a.material[e.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(e,r),this._displaceVertices(e,r),this._updateViewControl(e,r),this._updateLayers(e,r)},afterRender:function(e,t,r,i){var n=i.renderer;this._sceneHelper.updateAmbientCubemap(n,e,r),this._sceneHelper.updateSkybox(n,e,r)},_updateLayers:function(e,t){var r=e.coordinateSystem,i=e.get("layers"),n=r.radius,o=[],s=[],l=[],c=[];a["w"].each(i,(function(e){var i=new a["f"](e),u=i.get("type"),h=Ea.loadTexture(i.get("texture"),t,{flipY:!1,anisotropic:8});if(h.surface&&h.surface.attachToMesh(this._earthMesh),"blend"===u){var d=i.get("blendTo"),f=Pn.firstNotNull(i.get("intensity"),1);"emission"===d?(l.push(h),c.push(f)):(o.push(h),s.push(f))}else{var p=i.get("id"),m=this._layerMeshes[p];m||(m=this._layerMeshes[p]=new Ea.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0}));var g=i.get("shading");"lambert"===g?(m.material=m.__lambertMaterial||new Ea.Material({autoUpdateTextureStatus:!1,shader:Ea.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),m.__lambertMaterial=m.material):(m.material=m.__colorMaterial||new Ea.Material({autoUpdateTextureStatus:!1,shader:Ea.createShader("ecgl.color"),transparent:!0,depthMask:!1}),m.__colorMaterial=m.material),m.material.enableTexture("diffuseMap");var v=i.get("distance"),_=n+(null==v?r.radius/100:v);m.scale.set(_,_,_),n=_;var y=this._blankTexture||(this._blankTexture=Ea.createBlankTexture("rgba(255, 255, 255, 0)"));m.material.set("diffuseMap",y),Ea.loadTexture(i.get("texture"),t,{flipY:!1,anisotropic:8},(function(e){e.surface&&e.surface.attachToMesh(m),m.material.set("diffuseMap",e),t.getZr().refresh()})),i.get("show")?this.groupGL.add(m):this.groupGL.remove(m)}}),this);var u=this._earthMesh.material;u.define("fragment","LAYER_DIFFUSEMAP_COUNT",o.length),u.define("fragment","LAYER_EMISSIVEMAP_COUNT",l.length),u.set("layerDiffuseMap",o),u.set("layerDiffuseIntensity",s),u.set("layerEmissiveMap",l),u.set("layerEmissionIntensity",c);var h=e.getModel("debug.wireframe");if(h.get("show")){u.define("both","WIREFRAME_TRIANGLE");var d=Ea.parseColor(h.get("lineStyle.color")||"rgba(0,0,0,0.5)"),f=Pn.firstNotNull(h.get("lineStyle.width"),1);u.set("wireframeLineWidth",f),u.set("wireframeLineColor",d)}else u.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(e,t){var r=e.coordinateSystem,i=e.getModel("viewControl"),n=(r.viewGL.camera,this);function a(){return{type:"globeChangeCamera",alpha:o.getAlpha(),beta:o.getBeta(),distance:o.getDistance()-r.radius,center:o.getCenter(),from:n.uid,globeId:e.id}}var o=this._control;o.setViewGL(r.viewGL);var s,l,c=i.get("targetCoord");null!=c&&(l=c[0]+90,s=c[1]),o.setFromViewControlModel(i,{baseDistance:r.radius,alpha:s,beta:l}),o.off("update"),o.on("update",(function(){t.dispatchAction(a())}))},_displaceVertices:function(e,t){var r=e.get("displacementQuality"),i=e.get("debug.wireframe.show"),n=e.coordinateSystem;if(e.isDisplacementChanged()||r!==this._displacementQuality||i!==this._showDebugWireframe){this._displacementQuality=r,this._showDebugWireframe=i;var a=this._sphereGeometry,o={low:100,medium:200,high:400,ultra:800}[r]||200,s=o/2;(a.widthSegments!==o||i)&&(a.widthSegments=o,a.heightSegments=s,a.build()),this._doDisplaceVertices(a,n),i&&a.generateBarycentric()}},_doDisplaceVertices:function(e,t){var r=e.attributes.position.value,i=e.attributes.texcoord0.value,n=e.__originalPosition;n&&n.length===r.length||(n=new Float32Array(r.length),n.set(r),e.__originalPosition=n);for(var a=t.displacementWidth,o=t.displacementHeight,s=t.displacementData,l=0;l50&&(o=1e3);var s=[];ju.perspective(s,Fu,this.width/this.height,1,o),this.viewGL.camera.projectionMatrix.setArray(s),this.viewGL.camera.decomposeProjectionMatrix();s=ju.identity([]);var l=this.dataToPoint(this.center);ju.scale(s,s,[1,-1,1]),ju.translate(s,s,[0,0,-e]),ju.rotateX(s,s,t),ju.rotateZ(s,s,-this.bearing/180*Math.PI),ju.translate(s,s,[-l[0]*this.getScale()*ku,-l[1]*this.getScale()*ku,0]),this.viewGL.camera.viewMatrix.array=s;var c=[];ju.invert(c,s),this.viewGL.camera.worldTransform.array=c,this.viewGL.camera.decomposeWorldTransform();var u,h=zu*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var d=this.altitudeExtent[1]-this.altitudeExtent[0];u=this.boxHeight/d*this.getScale()/Math.pow(2,this._initialZoom-this.zoomOffset)}else u=h/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*ku;this.viewGL.rootNode.scale.set(this.getScale()*ku,this.getScale()*ku,u)}},getScale:function(){return Math.pow(2,this.zoom-this.zoomOffset)},projectOnTile:function(e,t){return this.projectOnTileWithScale(e,this.getScale()*zu,t)},projectOnTileWithScale:function(e,t,r){var i=e[0],n=e[1],a=i*Vu/180,o=n*Vu/180,s=t*(a+Vu)/(2*Vu),l=t*(Vu-Math.log(Math.tan(Vu/4+.5*o)))/(2*Vu);return r=r||[],r[0]=s,r[1]=l,r},unprojectFromTile:function(e,t){return this.unprojectOnTileWithScale(e,this.getScale()*zu,t)},unprojectOnTileWithScale:function(e,t,r){var i=e[0],n=e[1],a=i/t*(2*Vu)-Vu,o=2*(Math.atan(Math.exp(Vu-n/t*(2*Vu)))-Vu/4);return r=r||[],r[0]=180*a/Vu,r[1]=180*o/Vu,r},dataToPoint:function(e,t){return t=this.projectOnTileWithScale(e,zu,t),t[0]-=this._origin[0],t[1]-=this._origin[1],t[2]=isNaN(e[2])?0:e[2],isNaN(e[2])||(t[2]=e[2],this.altitudeExtent&&(t[2]-=this.altitudeExtent[0])),t}};var Gu=Uu;function Hu(){Gu.apply(this,arguments)}Hu.prototype=new Gu,Hu.prototype.constructor=Hu,Hu.prototype.type="mapbox3D";var Wu=Hu,Xu=function(e,t,r){function i(e,t){var r=t.getWidth(),i=t.getHeight(),n=t.getDevicePixelRatio();this.viewGL.setViewport(0,0,r,i,n),this.width=r,this.height=i,this.altitudeScale=e.get("altitudeScale"),this.boxHeight=e.get("boxHeight")}function n(e,t){if("auto"!==this.model.get("boxHeight")){var r=[1/0,-1/0];e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),i=e.coordDimToDataDim("alt")[0];if(i){var n=t.getDataExtent(i,!0);r[0]=Math.min(r[0],n[0]),r[1]=Math.max(r[1],n[1])}}}),this),r&&isFinite(r[1]-r[0])&&(this.altitudeExtent=r)}}return{dimensions:t.prototype.dimensions,create:function(a,o){var s=[];return a.eachComponent(e,(function(e){var r=e.__viewGL;r||(r=e.__viewGL=new dl,r.setRootNode(new Ea.Node));var a=new t;a.viewGL=e.__viewGL,a.resize=i,a.resize(e,o),s.push(a),e.coordinateSystem=a,a.model=e,a.update=n})),a.eachSeries((function(t){if(t.get("coordinateSystem")===e){var r=t.getReferringComponents(e).models[0];if(r||(r=a.getComponent(e)),!r)throw new Error(e+' "'+Pn.firstNotNull(t.get(e+"Index"),t.get(e+"Id"),0)+'" not found');t.coordinateSystem=r.coordinateSystem}})),r&&r(s,a,o),s}}},qu=Xu("mapbox3D",Wu,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMapboxCameraOption())}))})),Zu=qu;function Yu(e){e.registerComponentModel(Lu),e.registerComponentView(Bu),e.registerCoordinateSystem("mapbox3D",Zu),e.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"mapbox3D",query:e},(function(t){t.setMapboxCameraOption(e)}))}))}Object(a["v"])(Yu);var Ku=["zoom","center","pitch","bearing"],Qu=a["c"].extend({type:"maptalks3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",attribution:'© OpenStreetMap contributors, © CARTO',center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMaptalksCameraOption:function(){var e=this;return Ku.reduce((function(t,r){return t[r]=e.get(r),t}),{})},setMaptalksCameraOption:function(e){null!=e&&Ku.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMaptalks:function(){return this._maptalks},setMaptalks:function(e){this._maptalks=e}});a["w"].merge(Qu.prototype,Ua),a["w"].merge(Qu.prototype,Ga);var Ju=Qu;function $u(e,t,r,i){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!maptalks)throw new Error("Maptalks library must be included. See https://maptalks.org");this._maptalks=new maptalks.Map(this.dom,{center:r,zoom:i,doubleClickZoom:!1,fog:!1}),this._initEvents()}$u.prototype.setUnpainted=function(){},$u.prototype.resize=function(){this._maptalks.checkSize()},$u.prototype.getMaptalks=function(){return this._maptalks},$u.prototype.clear=function(){},$u.prototype.refresh=function(){this._maptalks.checkSize()};var eh=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];$u.prototype._initEvents=function(){var e=this.dom;this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},eh.forEach((function(t){this._handlers[t]=function(r){var i={};for(var n in r)i[n]=r[n];i.bubbles=!1;var a=new r.constructor(r.type,i);"mousewheel"===t||"DOMMouseScroll"===t?e.dispatchEvent(a):e.firstElementChild.dispatchEvent(a)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},$u.prototype.dispose=function(){eh.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this),this._maptalks.remove()};var th=$u;Ea.Shader.import(Iu);var rh=a["d"].extend({type:"maptalks3D",__ecgl__:!0,init:function(e,t){this._groundMesh=new Ea.Mesh({geometry:new Ea.PlaneGeometry,material:new Ea.Material({shader:new Ea.Shader({vertex:Ea.Shader.source("ecgl.displayShadow.vertex"),fragment:Ea.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(e,t){var r=t.getZr();this._zrLayer=new th("maptalks3D",r,e.get("center"),e.get("zoom")),r.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new Ea.Node,this._sceneHelper=new co(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var i=this._zrLayer.getMaptalks(),n=this._dispatchInteractAction.bind(this,t,i);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend","animating"].forEach((function(e){i.on(e,n)}))},render:function(e,t,r){this._zrLayer||this._initMaptalksLayer(e,r);var i=this._zrLayer.getMaptalks(),n=e.get("urlTemplate"),a=i.getBaseLayer();n!==this._oldUrlTemplate&&(a?a.setOptions({urlTemplate:n,attribution:e.get("attribution")}):(a=new maptalks.TileLayer("maptalks-echarts-gl-baselayer",{urlTemplate:n,subdomains:["a","b","c"],attribution:e.get("attribution")}),i.setBaseLayer(a))),this._oldUrlTemplate=n,i.setCenter(e.get("center")),i.setZoom(e.get("zoom"),{animation:!1}),i.setPitch(e.get("pitch")),i.setBearing(e.get("bearing")),e.setMaptalks(i);var o=e.coordinateSystem;o.viewGL.scene.add(this._lightRoot),o.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(e),o.viewGL.setPostEffect(e.getModel("postEffect"),r),o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._maptalks3DModel=e},afterRender:function(e,t,r,i){var n=i.renderer;this._sceneHelper.updateAmbientCubemap(n,e,r),this._sceneHelper.updateSkybox(n,e,r),e.coordinateSystem.viewGL.scene.traverse((function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(e,t,r,i){e.coordinateSystem.setCameraOption(i),this._updateGroundMesh(),r.getZr().refresh()},_dispatchInteractAction:function(e,t,r){e.dispatchAction({type:"maptalks3DChangeCamera",pitch:t.getPitch(),zoom:nh(t.getResolution())+1,center:t.getCenter().toArray(),bearing:t.getBearing(),maptalks3DId:this._maptalks3DModel&&this._maptalks3DModel.id})},_updateGroundMesh:function(){if(this._maptalks3DModel){var e=this._maptalks3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var r=new Ea.Plane(new Ea.Vector3(0,0,1),0),i=e.viewGL.camera.castRay(new Ea.Vector2(-1,-1)),n=e.viewGL.camera.castRay(new Ea.Vector2(1,1)),a=i.intersectPlane(r),o=n.intersectPlane(r),s=a.dist(o)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(s,s,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}});const ih=12756274*Math.PI/(256*Math.pow(2,20));function nh(e){return 19-Math.log(e/ih)/Math.LN2}function ah(){Gu.apply(this,arguments),this.maxPitch=85,this.zoomOffset=1}ah.prototype=new Gu,ah.prototype.constructor=ah,ah.prototype.type="maptalks3D";var oh=ah,sh=Xu("maptalks3D",oh,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMaptalksCameraOption())}))})),lh=sh;function ch(e){e.registerComponentModel(Ju),e.registerComponentView(rh),e.registerCoordinateSystem("maptalks3D",lh),e.registerAction({type:"maptalks3DChangeCamera",event:"maptalks3dcamerachanged",update:"maptalks3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"maptalks3D",query:e},(function(t){t.setMaptalksCameraOption(e)}))}))}Object(a["v"])(ch);var uh=eo.vec3,hh=a["m"].dataStack.isDimensionStacked;function dh(e){var t=e[0],r=e[1];return!(t>0&&r>0||t<0&&r<0)}function fh(e,t){var r=e.getData(),i=e.get("barSize");if(null==i){var n,o,s=t.size,l=t.getAxis("x"),c=t.getAxis("y");n="category"===l.type?.7*l.getBandWidth():.6*Math.round(s[0]/Math.sqrt(r.count())),o="category"===c.type?.7*c.getBandWidth():.6*Math.round(s[1]/Math.sqrt(r.count())),i=[n,o]}else a["w"].isArray(i)||(i=[i,i]);var u=t.getAxis("z").scale.getExtent(),h=dh(u),d=["x","y","z"].map((function(t){return e.coordDimToDataDim(t)[0]})),f=hh(r,d[2]),p=f?r.getCalculationInfo("stackResultDimension"):d[2];r.each(d,(function(e,n,a,o){var s=r.get(p,o),l=f?s-a:h?0:u[0],c=t.dataToPoint([e,n,l]),d=t.dataToPoint([e,n,s]),m=uh.dist(c,d),g=[0,d[1]":"")+o.join(i?"
":", ")}var n=e.getData(),o=e.getRawValue(t),s=a["w"].isArray(o)?i(o):a["i"].encodeHTML(a["i"].addCommas(o)),l=n.getName(t),c=Tc(n,t);a["w"].isObject(c)&&c.colorStops&&(c=(c.colorStops[0]||{}).color),c=c||"transparent";var u=a["i"].getTooltipMarker(c),h=e.name;return"\0-"===h&&(h=""),h=h?a["i"].encodeHTML(h)+(r?": ":"
"):"",r?u+h+s:h+u+(l?a["i"].encodeHTML(l)+": "+s:s)},Ch=function(e,t,r){r=r||e.getSource();var i=t||a["j"](e.get("coordinateSystem"))||["x","y","z"],n=a["m"].createDimensions(r,{dimensionsDefine:r.dimensionsDefine||e.get("dimensions"),encodeDefine:r.encodeDefine||e.get("encode"),coordDimensions:i.map((function(t){var r=e.getReferringComponents(t+"Axis3D").models[0];return{type:r&&"category"===r.get("type")?"ordinal":"float",name:t}}))});"cartesian3D"===e.get("coordinateSystem")&&n.forEach((function(t){if(i.indexOf(t.coordDim)>=0){var r=e.getReferringComponents(t.coordDim+"Axis3D").models[0];r&&"category"===r.get("type")&&(t.ordinalMeta=r.getOrdinalMeta())}}));var o=a["m"].dataStack.enableDataStack(e,n,{byIndex:!0,stackedCoordDimension:"z"}),s=new a["e"](n,e);return s.setCalculationInfo(o),s.initData(r),s},Oh=a["g"].extend({type:"series.bar3D",dependencies:["globe"],visualStyleAccessPathvisu:"itemStyle",getInitialData:function(e,t){return Ch(this)},getFormattedLabel:function(e,t,r,i){var n=Sh.getFormattedLabel(this,e,t,r,i);return null==n&&(n=this.getData().get("z",e)),n},formatTooltip:function(e){return Ah(this,e)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});a["w"].merge(Oh.prototype,Dl);var Mh=Oh,Dh=eo.vec3,Lh=eo.mat3,Nh=yr.extend((function(){return{attributes:{position:new yr.Attribute("position","float",3,"POSITION"),normal:new yr.Attribute("normal","float",3,"NORMAL"),color:new yr.Attribute("color","float",4,"COLOR"),prevPosition:new yr.Attribute("prevPosition","float",3),prevNormal:new yr.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(e){var t=this.enableNormal,r=this.getBarVertexCount()*e,i=this.getBarTriangleCount()*e;this.vertexCount!==r&&(this.attributes.position.init(r),t?this.attributes.normal.init(r):this.attributes.normal.value=null,this.attributes.color.init(r)),this.triangleCount!==i&&(this.indices=r>65535?new Uint32Array(3*i):new Uint16Array(3*i),this._dataIndices=new Uint32Array(r))},getBarVertexCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarVertexCount(e):this.enableNormal?24:8},getBarTriangleCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarTriangleCount(e):12},_getBevelBarVertexCount:function(e){return 4*(e+1)*(e+1)*2},_getBevelBarTriangleCount:function(e){var t=4*e+3,r=2*e+1;return(t+1)*r*2+4},setColor:function(e,t){for(var r=this.getBarVertexCount(),i=r*e,n=r*(e+1),a=i;a0&&this.bevelSegments>0)this._addBevelBar(e,h,m,g,this.bevelSize,this.bevelSegments,v);else{Dh.copy(n,h),Dh.normalize(n,n),Dh.cross(a,m,n),Dh.normalize(a,a),Dh.cross(i,n,a),Dh.normalize(a,a),Dh.negate(o,i),Dh.negate(s,n),Dh.negate(l,a),t(c[0],e,i,g[0]/2),t(c[0],c[0],a,g[2]/2),t(c[1],e,i,g[0]/2),t(c[1],c[1],l,g[2]/2),t(c[2],e,o,g[0]/2),t(c[2],c[2],l,g[2]/2),t(c[3],e,o,g[0]/2),t(c[3],c[3],a,g[2]/2),t(r,e,n,g[1]),t(c[4],r,i,g[0]/2),t(c[4],c[4],a,g[2]/2),t(c[5],r,i,g[0]/2),t(c[5],c[5],l,g[2]/2),t(c[6],r,o,g[0]/2),t(c[6],c[6],l,g[2]/2),t(c[7],r,o,g[0]/2),t(c[7],c[7],a,g[2]/2);var x=this.attributes;if(this.enableNormal){u[0]=i,u[1]=o,u[2]=n,u[3]=s,u[4]=a,u[5]=l;for(var b=this._vertexOffset,T=0;T0&&(f++,u[3]<.99&&(p=!0))}})),o.geometry.setBarCount(f);var m=r.getLayout("orient"),g=this._barIndexOfData=new Int32Array(r.count());f=0;r.each((function(e){if(r.hasValue(e)){var t=r.getItemLayout(e),i=t[0],n=t[1],o=t[2],s=4*e;u[0]=h[s++],u[1]=h[s++],u[2]=h[s++],u[3]=h[s++],u[3]>0&&(a._barMesh.geometry.addBar(i,n,m,o,u,e),g[e]=f++)}else g[e]=-1})),o.geometry.dirty(),o.geometry.updateBoundingBox();var v=o.material;v.transparent=p,v.depthMask=!p,o.geometry.sortTriangles=p,this._initHandler(e,t)},_initHandler:function(e,t){var r=e.getData(),i=this._barMesh,n="cartesian3D"===e.coordinateSystem.type;i.seriesIndex=e.seriesIndex;var a=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(e){var o=i.geometry.getDataIndexOfVertex(e.triangle[0]);o!==a&&(this._downplay(a),this._highlight(o),this._labelsBuilder.updateLabels([o]),n&&t.dispatchAction({type:"grid3DShowAxisPointer",value:[r.get("x",o),r.get("y",o),r.get("z",o,!0)]})),a=o,i.dataIndex=o}),this),i.on("mouseout",(function(e){this._downplay(a),this._labelsBuilder.updateLabels(),a=-1,i.dataIndex=-1,n&&t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(e){var t=this._data;if(t){var r=this._barIndexOfData[e];if(!(r<0)){var i=t.getItemModel(e),n=i.getModel("emphasis.itemStyle"),o=n.get("color"),s=n.get("opacity");if(null==o){var l=Tc(t,e);o=a["h"].lift(l,-.4)}null==s&&(s=wc(t,e));var c=Ea.parseColor(o);c[3]*=s,this._barMesh.geometry.setColor(r,c),this._api.getZr().refresh()}}},_downplay:function(e){var t=this._data;if(t){var r=this._barIndexOfData[e];if(!(r<0)){var i=Tc(t,e),n=wc(t,e),a=Ea.parseColor(i);a[3]*=n,this._barMesh.geometry.setColor(r,a),this._api.getZr().refresh()}}},highlight:function(e,t,r,i){this._toggleStatus("highlight",e,t,r,i)},downplay:function(e,t,r,i){this._toggleStatus("downplay",e,t,r,i)},_toggleStatus:function(e,t,r,i,n){var o=t.getData(),s=Pn.queryDataIndex(o,n),l=this;null!=s?a["w"].each(Sh.normalizeToArray(s),(function(t){"highlight"===e?this._highlight(t):this._downplay(t)}),this):o.each((function(t){"highlight"===e?l._highlight(t):l._downplay(t)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this._labelsBuilder.dispose(),this.groupGL.removeAll()}});function Bh(e){e.registerChartView(Ih),e.registerSeriesModel(Mh),Th(e),e.registerProcessor((function(e,t){e.eachSeriesByType("bar3d",(function(e){var t=e.getData();t.filterSelf((function(e){return t.hasValue(e)}))}))}))}Object(a["v"])(Bh);var jh=a["g"].extend({type:"series.line3D",dependencies:["grid3D"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",getInitialData:function(e,t){return Ch(this)},formatTooltip:function(e){return Ah(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}}),zh=jh,Fh=r("9680"),Vh=eo.vec3;Ea.Shader.import(Mo);var kh=a["b"].extend({type:"line3D",__ecgl__:!0,init:function(e,t){this.groupGL=new Ea.Node,this._api=t},render:function(e,t,r){var i=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=i,this._line3DMesh||(this._line3DMesh=new Ea.Mesh({geometry:new no({useNativeLine:!1,sortTriangles:!0}),material:new Ea.Material({shader:Ea.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var n=e.coordinateSystem;if(n&&n.viewGL){n.viewGL.add(this.groupGL);var a=n.viewGL.isLinearSpace()?"define":"undefine";this._line3DMesh.material[a]("fragment","SRGB_DECODE")}this._doRender(e,r),this._data=e.getData(),this._camera=n.viewGL.camera,this.updateCamera(),this._updateAnimation(e)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(e,t){var r=e.getData(),i=this._line3DMesh;i.geometry.resetOffset();var n=r.getLayout("points"),a=[],o=new Float32Array(n.length/3*4),s=0,l=!1;r.each((function(e){var t=Tc(r,e),i=wc(r,e);null==i&&(i=1),Ea.parseColor(t,a),a[3]*=i,o[s++]=a[0],o[s++]=a[1],o[s++]=a[2],o[s++]=a[3],a[3]<.99&&(l=!0)})),i.geometry.setVertexCount(i.geometry.getPolylineVertexCount(n)),i.geometry.setTriangleCount(i.geometry.getPolylineTriangleCount(n)),i.geometry.addPolyline(n,o,Pn.firstNotNull(e.get("lineStyle.width"),1)),i.geometry.dirty(),i.geometry.updateBoundingBox();var c=i.material;c.transparent=l,c.depthMask=!l;var u=e.getModel("debug.wireframe");u.get("show")?(i.geometry.createAttribute("barycentric","float",3),i.geometry.generateBarycentric(),i.material.set("both","WIREFRAME_TRIANGLE"),i.material.set("wireframeLineColor",Ea.parseColor(u.get("lineStyle.color")||"rgba(0,0,0,0.5)")),i.material.set("wireframeLineWidth",Pn.firstNotNull(u.get("lineStyle.width"),1))):i.material.set("both","WIREFRAME_TRIANGLE"),this._points=n,this._initHandler(e,t)},_updateAnimation:function(e){Ea.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,e)},_initHandler:function(e,t){var r=e.getData(),i=e.coordinateSystem,n=this._line3DMesh,a=-1;n.seriesIndex=e.seriesIndex,n.off("mousemove"),n.off("mouseout"),n.on("mousemove",(function(e){var o=i.pointToData(e.point.array),s=r.indicesOfNearest("x",o[0])[0];s!==a&&(t.dispatchAction({type:"grid3DShowAxisPointer",value:[r.get("x",s),r.get("y",s),r.get("z",s)]}),n.dataIndex=s),a=s}),this),n.on("mouseout",(function(e){a=-1,n.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateNDCPosition:function(){var e=new Lt,t=this._camera;Lt.multiply(e,t.projectionMatrix,t.viewMatrix);var r=this._positionNDC,i=this._points,n=i.length/3;r&&r.length/2===n||(r=this._positionNDC=new Float32Array(2*n));for(var a=[],o=0;o=0){var b=3*c,T=new _t(this._points[b],this._points[b+1],this._points[b+2]);a.push({dataIndex:c,point:T,pointWorld:T.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(T)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});function Uh(e){e.registerChartView(kh),e.registerSeriesModel(zh),e.registerLayout((function(e,t){e.eachSeriesByType("line3D",(function(e){var t=e.getData(),r=e.coordinateSystem;if(r){if("cartesian3D"!==r.type)return void 0;var i=new Float32Array(3*t.count()),n=[],a=[],o=r.dimensions,s=o.map((function(t){return e.coordDimToDataDim(t)[0]}));r&&t.each(s,(function(e,t,o,s){n[0]=e,n[1]=t,n[2]=o,r.dataToPoint(n,a),i[3*s]=a[0],i[3*s+1]=a[1],i[3*s+2]=a[2]})),t.setLayout("points",i)}}))}))}Object(a["v"])(Uh);var Gh=a["g"].extend({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,getInitialData:function(e,t){return Ch(this)},getFormattedLabel:function(e,t,r,i){var n=Sh.getFormattedLabel(this,e,t,r,i);if(null==n){var a=this.getData(),o=a.dimensions[a.dimensions.length-1];n=a.get(o,e)}return n},formatTooltip:function(e){return Ah(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}});function Hh(e,t,r){t=t||document.createElement("canvas");t.width=e,t.height=e;var i=t.getContext("2d");return r&&r(i),t}function Wh(e,t,r,i){a["w"].isArray(t)||(t=[t,t]);var n=qh.getMarginByStyle(r,i),o=t[0]+n.left+n.right,s=t[1]+n.top+n.bottom,l=a["m"].createSymbol(e,0,0,t[0],t[1]),c=Math.max(o,s);l.x=n.left,l.y=n.top,o>s?l.y+=(c-s)/2:l.x+=(c-o)/2;var u=l.getBoundingRect();return l.x-=u.x,l.y-=u.y,l.setStyle(r),l.update(),l.__size=c,l}function Xh(e,t,r){var i=t.width,n=t.height,a=e.canvas.width,o=e.canvas.height,s=i/a,l=n/o;function c(e){return e<128?1:-1}function u(e,a){var o=1/0;e=Math.floor(e*s),a=Math.floor(a*l);for(var u=a*i+e,h=t.data[4*u],d=c(h),f=Math.max(a-r,0);f=2e4},doSortVertices:function(e,t){var r=this.indices,i=Yh.create();if(!r){r=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var n=0;n.05);else for(n=0;n<3;n++)this._progressiveQuickSort(3*t+n);this.dirtyIndices()},_simpleSort:function(e){var t=this._zList,r=this.indices;function i(e,r){return t[r]-t[e]}e?Array.prototype.sort.call(r,i):pc.sort(r,i,0,r.length-1)},_progressiveQuickSort:function(e){var t=this._zList,r=this.indices;this._quickSort=this._quickSort||new pc,this._quickSort.step(r,(function(e,r){return t[r]-t[e]}),e)}},Qh="@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end",Jh=eo.vec4;Ea.Shader.import(Qh);var $h=Ea.Mesh.extend((function(){var e=new Ea.Geometry({dynamic:!0,attributes:{color:new Ea.Geometry.Attribute("color","float",4,"COLOR"),position:new Ea.Geometry.Attribute("position","float",3,"POSITION"),size:new Ea.Geometry.Attribute("size","float",1),prevPosition:new Ea.Geometry.Attribute("prevPosition","float",3),prevSize:new Ea.Geometry.Attribute("prevSize","float",1)}});Object.assign(e,Kh);var t=new Ea.Material({shader:Ea.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});t.enableTexture("sprite"),t.define("both","VERTEX_COLOR"),t.define("both","VERTEX_SIZE");var r=new Ea.Texture2D({image:document.createElement("canvas"),flipY:!1});return t.set("sprite",r),e.pick=this._pick.bind(this),{geometry:e,material:t,mode:Ea.Mesh.POINTS,sizeScale:1}}),{_pick:function(e,t,r,i,n,a){var o=this._positionNDC;if(o)for(var s=r.viewport,l=2/s.width,c=2/s.height,u=this.geometry.vertexCount-1;u>=0;u--){var h;h=this.geometry.indices?this.geometry.indices[u]:u;var d=o[2*h],f=o[2*h+1],p=this.geometry.attributes.size.get(h)/this.sizeScale,m=p/2;if(e>d-m*l&&ef-m*c&&t2?(p=this._updateSymbolSprite(e,d,u,h),s.enableTexture("sprite")):s.disableTexture("sprite"),c.position.init(n-i);var m=[];if(f){s.undefine("VERTEX_SIZE"),s.undefine("VERTEX_COLOR");var g=xc(o),v=bc(o);Ea.parseColor(g,m),m[3]*=v,s.set({color:m,u_Size:u.maxSize*this._sizeScale})}else s.set({color:[1,1,1,1]}),s.define("VERTEX_SIZE"),s.define("VERTEX_COLOR"),c.size.init(n-i),c.color.init(n-i),this._originalOpacity=new Float32Array(n-i);for(var _=o.getLayout("points"),y=c.position.value,x=0;x1?(n[0]=r.maxSize,n[1]=r.maxSize/r.aspect):(n[1]=r.maxSize,n[0]=r.maxSize*r.aspect),n[0]=n[0]||1,n[1]=n[1]||1,this._symbolType===r.type&&id(this._symbolSize,n)&&this._lineWidth===t.lineWidth||(Zh.createSymbolSprite(r.type,n,{fill:"#fff",lineWidth:t.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(n[0]/2,10)},this._spriteImageCanvas),Zh.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),td,this._mesh.material.get("sprite").image),this._symbolType=r.type,this._symbolSize=n,this._lineWidth=t.lineWidth),this._spriteImageCanvas.width/r.maxSize*i},_updateMaterial:function(e,t){var r="lighter"===e.get("blendMode")?Ea.additiveBlend:null,i=this._mesh.material;i.blend=r,i.set("lineWidth",t.lineWidth/td);var n=Ea.parseColor(t.stroke);i.set("strokeColor",n),i.transparent=!0,i.depthMask=!1,i.depthTest=!this.is2D,i.sortVertices=!this.is2D},_updateLabelBuilder:function(e,t,r){var i=e.getData(),n=this._mesh.geometry,a=n.attributes.position.value,o=(t=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(i,t,r),this._labelsBuilder.getLabelPosition=function(e,r,i){var n=3*(e-t);return[a[n],a[n+1],a[n+2]]},this._labelsBuilder.getLabelDistance=function(e,r,i){var a=n.attributes.size.get(e-t)/o;return a/2+i},this._labelsBuilder.updateLabels()},_updateAnimation:function(e){Ea.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,e)},_updateHandler:function(e,t,r){var i,n=e.getData(),a=this._mesh,o=this,s=-1,l=e.coordinateSystem&&"cartesian3D"===e.coordinateSystem.type;l&&(i=e.coordinateSystem.model),a.seriesIndex=e.seriesIndex,a.off("mousemove"),a.off("mouseout"),a.on("mousemove",(function(t){var c=t.vertexIndex+o._startDataIndex;c!==s&&(this.highlightOnMouseover&&(this.downplay(n,s),this.highlight(n,c),this._labelsBuilder.updateLabels([c])),l&&r.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get(e.coordDimToDataDim("x")[0],c),n.get(e.coordDimToDataDim("y")[0],c),n.get(e.coordDimToDataDim("z")[0],c)],grid3DIndex:i.componentIndex})),a.dataIndex=c,s=c}),this),a.on("mouseout",(function(e){var t=e.vertexIndex+o._startDataIndex;this.highlightOnMouseover&&(this.downplay(n,t),this._labelsBuilder.updateLabels()),s=-1,a.dataIndex=-1,l&&r.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:i.componentIndex})}),this)},updateLayout:function(e,t,r){var i=e.getData();if(this._mesh){var n=this._mesh.geometry.attributes.position.value,a=i.getLayout("points");if(this.is2D)for(var o=0;othis._endDataIndex||tthis._endDataIndex||t0?1:-1}Ea.Shader.import(Md);var Nd=Ea.Mesh.extend((function(){var e=new Ea.Material({shader:new Ea.Shader(Ea.Shader.source("ecgl.trail2.vertex"),Ea.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),t=new no({dynamic:!0});return t.createAttribute("dist","float",1),t.createAttribute("distAll","float",1),t.createAttribute("start","float",1),{geometry:t,material:e,culling:!1,$ignorePicking:!0}}),{updateData:function(e,t,r){var i=e.hostModel,n=this.geometry,a=i.getModel("effect"),o=a.get("trailWidth")*t.getDevicePixelRatio(),s=a.get("trailLength"),l=i.get("effect.constantSpeed"),c=1e3*i.get("effect.period"),u=null!=l;u?this.material.set("speed",l/1e3):this.material.set("period",c),this.material[u?"define":"undefine"]("vertex","CONSTANT_SPEED");var h=i.get("polyline");n.trailLength=s,this.material.set("trailLength",s),n.resetOffset(),["position","positionPrev","positionNext"].forEach((function(e){n.attributes[e].value=r.attributes[e].value}));var d=["dist","distAll","start","offset","color"];d.forEach((function(e){n.attributes[e].init(n.vertexCount)})),n.indices=r.indices;var f=[],p=a.get("trailColor"),m=a.get("trailOpacity"),g=null!=p,v=null!=m;this.updateWorldTransform();var _=this.worldTransform.x.len(),y=this.worldTransform.y.len(),x=this.worldTransform.z.len(),b=0,T=0;e.each((function(t){var i=e.getItemLayout(t),a=v?m:wc(e,t),s=Tc(e,t);null==a&&(a=1),f=Ea.parseColor(g?p:s,f),f[3]*=a;for(var l=h?r.getPolylineVertexCount(i):r.getCubicCurveVertexCount(i[0],i[1],i[2],i[3]),d=0,w=[],S=[],E=b;Eb&&(d+=Dd.dist(w,S)),n.attributes.dist.set(E,d),Dd.copy(S,w);T=Math.max(T,d);var A=Math.random()*(u?d:c);for(E=b;E0;this._updateSurfaceMesh(this._surfaceMesh,e,u,f);var p=this._surfaceMesh.material;f?(p.define("WIREFRAME_QUAD"),p.set("wireframeLineWidth",d),p.set("wireframeLineColor",Ea.parseColor(h.get("lineStyle.color")))):p.undefine("WIREFRAME_QUAD"),this._initHandler(e,r),this._updateAnimation(e)},_updateAnimation:function(e){Ea.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new Ea.Mesh({geometry:new Ea.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new Ea.Material({shader:new Ea.Shader(Ea.Shader.source("ecgl.sm.depth.vertex"),Ea.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return e.geometry.createAttribute("barycentric","float",4),e.geometry.createAttribute("prevPosition","float",3),e.geometry.createAttribute("prevNormal","float",3),Object.assign(e.geometry,yc),e},_initHandler:function(e,t){var r=e.getData(),i=this._surfaceMesh,n=e.coordinateSystem;function a(e,t){for(var r=1/0,n=-1,a=[],o=0;o=0){var l=[];i.geometry.attributes.position.get(s,l);for(var c=n.pointToData(l),u=1/0,h=-1,d=[],f=0;f65535?Uint32Array:Uint16Array)((p-1)*(m-1)*6),T=function(e,t,r){r[1]=e*m+t,r[0]=e*m+t+1,r[3]=(e+1)*m+t+1,r[2]=(e+1)*m+t},w=!1;if(l){var S=[],E=[],A=0;v?u.init(n.vertexCount):u.value=null;for(var C=[[],[],[]],O=[],M=[],D=Gd.create(),L=function(e,t,r){var i=3*t;return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r},N=new Float32Array(o.length),R=new Float32Array(o.length/3*4),P=0;P0){if(Math.floor(s/u)===s/u)return[u,s/u];u--}return u=Math.floor(Math.sqrt(s)),[u,u]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function Xd(e){e.registerChartView(Wd),e.registerSeriesModel(Ud),e.registerLayout((function(e,t){e.eachSeriesByType("surface",(function(e){var t=e.coordinateSystem;t&&t.type;var r=e.getData(),i=new Float32Array(3*r.count()),n=[NaN,NaN,NaN];if(t&&"cartesian3D"===t.type){var a=t.dimensions,o=a.map((function(t){return e.coordDimToDataDim(t)[0]}));r.each(o,(function(e,a,o,s){var l;l=r.hasValue(s)?t.dataToPoint([e,a,o]):n,i[3*s]=l[0],i[3*s+1]=l[1],i[3*s+2]=l[2]}))}r.setLayout("points",i)}))}))}function qd(e,t){for(var r=[],i=0;i "+p)),h++)}var m=a["m"].createDimensions(e,{coordDimensions:["value"]});l=new a["e"](m,r),l.initData(e);var g=new a["e"](["value"],r);return g.initData(u,c),n&&n(l,g),lf({mainData:l,struct:o,structAttr:"graph",datas:{node:l,edge:g},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o},uf=a["g"].extend({type:"series.graphGL",visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,init:function(e){uf.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(e){uf.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(e,t,r,i){var n=Sh.getFormattedLabel(this,e,t,r,i);if(null==n){var a=this.getData(),o=a.dimensions[a.dimensions.length-1];n=a.get(o,e)}return n},getInitialData:function(e,t){var r=e.edges||e.links||[],i=e.data||e.nodes||[],n=this;if(i&&r)return cf(i,r,this,!0,a).data;function a(e,r){e.wrapMethod("getItemModel",(function(e){const t=n._categoriesModels,r=e.getShallow("category"),i=t[r];return i&&(i.parentModel=e.parentModel,e.parentModel=i),e}));const i=t.getModel([]).getModel;function a(e,t){const r=i.call(this,e,t);return r.resolveParentPath=o,r}function o(e){if(e&&("label"===e[0]||"label"===e[1])){const t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}r.wrapMethod("getItemModel",(function(e){return e.resolveParentPath=o,e.getModel=a,e}))}},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,r){if("edge"===r){var i=this.getData(),n=this.getDataParams(e,r),o=i.graph.getEdgeByIndex(e),s=i.getName(o.node1.dataIndex),l=i.getName(o.node2.dataIndex),c=[];return null!=s&&c.push(s),null!=l&&c.push(l),c=a["i"].encodeHTML(c.join(" > ")),n.value&&(c+=" : "+a["i"].encodeHTML(n.value)),c}return uf.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=(this.option.categories||[]).map((function(e){return null!=e.value?e:Object.assign({value:0},e)})),t=new a["e"](["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setView:function(e){null!=e.zoom&&(this.option.zoom=e.zoom),null!=e.offset&&(this.option.offset=e.offset)},setNodePosition:function(e){for(var t=0;t65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,r,i){var n=df.dist(e,t)+df.dist(r,t)+df.dist(i,r),a=1/(n+1)*this.segmentScale;return a},getCubicCurveVertexCount:function(e,t,r,i){var n=this._getCubicCurveApproxStep(e,t,r,i),a=Math.ceil(1/n);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,r,i){var n=this._getCubicCurveApproxStep(e,t,r,i),a=Math.ceil(1/n);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(ff)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(ff)},getPolylineVertexCount:function(e){var t;if("number"===typeof e)t=e;else{var r="number"!==typeof e[0];t=r?e.length:e.length/2}return this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;if("number"===typeof e)t=e;else{var r="number"!==typeof e[0];t=r?e.length:e.length/2}return this.useNativeLine?0:2*(t-1)},addCubicCurve:function(e,t,r,i,n,a){null==a&&(a=1);var o=e[0],s=e[1],l=t[0],c=t[1],u=r[0],h=r[1],d=i[0],f=i[1],p=this._getCubicCurveApproxStep(e,t,r,i),m=p*p,g=m*p,v=3*p,_=3*m,y=6*m,x=6*g,b=o-2*l+u,T=s-2*c+h,w=3*(l-u)-o+d,S=3*(c-h)-s+f,E=o,A=s,C=(l-o)*v+b*_+w*g,O=(c-s)*v+T*_+S*g,M=b*y+w*x,D=T*y+S*x,L=w*x,N=S*x,R=0,P=0,I=Math.ceil(1/p),B=new Float32Array(3*(I+1)),j=(B=[],0);for(P=0;P1&&(E=C>0?Math.min(E,d):Math.max(E,d),A=O>0?Math.min(A,f):Math.max(A,f));this.addPolyline(B,n,a)},addLine:function(e,t,r,i){this.addPolyline([e,t],r,i)},addPolyline:function(){var e=df.create(),t=df.create(),r=df.create(),i=df.create(),n=[],a=[],o=[];return function(s,l,c,u,h){if(s.length){var d="number"!==typeof s[0];if(null==h&&(h=d?s.length:s.length/2),!(h<2)){null==u&&(u=0),null==c&&(c=1),this._itemVertexOffsets.push(this._vertexOffset);for(var f,p=d?"number"!==typeof l[0]:l.length/4===h,m=this.attributes.position,g=this.attributes.color,v=this.attributes.offset,_=this.attributes.normal,y=this.indices,x=this._vertexOffset,b=0;b1&&(m.copy(x,x-1),g.copy(x,x-1),x++);else{var S;if(b0){df.sub(e,n,o),df.sub(t,a,n),df.normalize(e,e),df.normalize(t,t),df.add(i,e,t),df.normalize(i,i);var E=c/2*Math.min(1/df.dot(e,i),2);r[0]=-i[1],r[1]=i[0],S=E}else df.sub(e,a,n),df.normalize(e,e),r[0]=-e[1],r[1]=e[0],S=c/2}else df.sub(e,n,o),df.normalize(e,e),r[0]=-e[1],r[1]=e[0],S=c/2;_.set(x,r),_.set(x+1,r),v.set(x,S),v.set(x+1,-S),df.copy(o,n),m.set(x,n),m.set(x+1,n),g.set(x,f),g.set(x+1,f),x+=2}if(this.useNativeLine)g.set(x,f),m.set(x,n),x++;else if(b>0){var A=3*this._faceOffset;y=this.indices;y[A]=x-4,y[A+1]=x-3,y[A+2]=x-2,y[A+3]=x-3,y[A+4]=x-1,y[A+5]=x-2,this._faceOffset+=2}}this._vertexOffset=x}}}}(),setItemColor:function(e,t){for(var r=this._itemVertexOffsets[e],i=e 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end";Ea.Shader.import(gf);var vf={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function _f(e){var t={type:Ea.Texture.FLOAT,minFilter:Ea.Texture.NEAREST,magFilter:Ea.Texture.NEAREST};this._positionSourceTex=new Ea.Texture2D(t),this._positionSourceTex.flipY=!1,this._positionTex=new Ea.Texture2D(t),this._positionPrevTex=new Ea.Texture2D(t),this._forceTex=new Ea.Texture2D(t),this._forcePrevTex=new Ea.Texture2D(t),this._weightedSumTex=new Ea.Texture2D(t),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new Ea.Texture2D(t),this._globalSpeedPrevTex=new Ea.Texture2D(t),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new vn({fragment:Ea.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new vn({fragment:Ea.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new vn({fragment:Ea.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new vn({fragment:Ea.Shader.source("clay.compositor.output")});var r=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE)};this._edgeForceMesh=new Ea.Mesh({geometry:new Ea.Geometry({attributes:{node1:new Ea.Geometry.Attribute("node1","float",2),node2:new Ea.Geometry.Attribute("node2","float",2),weight:new Ea.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new Ea.Material({transparent:!0,shader:Ea.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:r,depthMask:!1,depthText:!1}),mode:Ea.Mesh.POINTS}),this._weightedSumMesh=new Ea.Mesh({geometry:new Ea.Geometry({attributes:{node:new Ea.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new Ea.Material({transparent:!0,shader:Ea.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:r,depthMask:!1,depthText:!1}),mode:Ea.Mesh.POINTS}),this._framebuffer=new fi({depthBuffer:!1}),this._dummyCamera=new Ea.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}_f.prototype.updateOption=function(e){for(var t in vf)this[t]=vf[t];var r=this._nodes.length;if(this.jitterTolerence=r>5e4?10:r>5e3?1:.1,this.scaling=r>100?2:10,e)for(var t in vf)null!=e[t]&&(this[t]=e[t]);if(this.repulsionByDegree)for(var i=this._positionSourceTex.pixels,n=0;ne},_f.prototype._swapTexture=function(){var e=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=e;e=this._forcePrevTex;this._forcePrevTex=this._forceTex,this._forceTex=e;e=this._globalSpeedPrevTex;this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=e},_f.prototype._initFromSource=function(e){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(e),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(e),e.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(e)},_f.prototype._resize=function(e,t){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(r){this[r].width=e,this[r].height=t,this[r].dirty()}),this)},_f.prototype.dispose=function(e){this._framebuffer.dispose(e),this._copyPass.dispose(e),this._nodeRepulsionPass.dispose(e),this._positionPass.dispose(e),this._globalSpeedPass.dispose(e),this._edgeForceMesh.geometry.dispose(e),this._weightedSumMesh.geometry.dispose(e),this._positionSourceTex.dispose(e),this._positionTex.dispose(e),this._positionPrevTex.dispose(e),this._forceTex.dispose(e),this._forcePrevTex.dispose(e),this._weightedSumTex.dispose(e),this._globalSpeedTex.dispose(e),this._globalSpeedPrevTex.dispose(e)};var yf=_f;function xf(){var e={create:function(){return new Float32Array(2)},dist:function(e,t){var r=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(r*r+i*i)},len:function(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)},scaleAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e},scale:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e},sub:function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e},normalize:function(e,t){var r=t[0],i=t[1],n=r*r+i*i;return n>0&&(n=1/Math.sqrt(n),e[0]=t[0]*n,e[1]=t[1]*n),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,r){return e[0]=t,e[1]=r,e}};function t(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}var r=t.prototype;function i(){this.position=new Float32Array(2),this.force=e.create(),this.forcePrev=e.create(),this.mass=1,this.inDegree=0,this.outDegree=0}function n(e,t){this.source=e,this.target=t,this.weight=1}function a(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new t,this.rootRegion.centerOfMass=e.create(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}r.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},r.setBBox=function(e,t,r,i){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=r,this.bbox[3]=i,this.size=(r-e+i-t)/2},r._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new t,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},r._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),r=this.bbox;if(!t){var i=(r[0]+r[2])/2,n=(r[1]+r[3])/2,a=(r[2]-r[0])/2,o=(r[3]-r[1])/2,s=e.position[0]>=i?1:0,l=e.position[1]>=n?1:0;t=this._newSubRegion();t.setBBox(s*a+r[0],l*o+r[1],(s+1)*a+r[0],(l+1)*o+r[1])}t.addNode(e)},r._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var t=this.centerOfMass[0]*this.mass,r=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,r+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=r/this.mass};var o=a.prototype;o.initNodes=function(e,t,r){var n=t.length;this.nodes.length=0;for(var a="undefined"!=typeof r,o=0;o0&&(this.strongGravityMode?this.applyNodeStrongGravity(n):this.applyNodeGravity(n))}for(r=0;r0&&(d=Math.min(d/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=d;for(r=0;r0&&(f=Math.min(p*f,10)/p,e.scaleAndAdd(i.position,i.position,i.force,f))}},o.applyRegionToNodeRepulsion=function(){var t=e.create();return function(r,i){if(r.node)this.applyNodeToNodeRepulsion(r.node,i,!0);else{e.sub(t,i.position,r.centerOfMass);var n=t[0]*t[0]+t[1]*t[1];if(n>this.barnesHutTheta*r.size*r.size){var a=this.scaling*i.mass*r.mass/n;e.scaleAndAdd(i.force,i.force,t,a)}else for(var o=0;o0)o=this.scaling*r.mass*i.mass/(s*s);else{if(!(s<0))return;o=100*this.scaling*r.mass*i.mass}}else o=this.scaling*r.mass*i.mass/a;e.scaleAndAdd(r.force,r.force,t,o),e.scaleAndAdd(i.force,i.force,t,-o)}}}}(),o.applyEdgeAttraction=function(){var t=e.create();return function(r){var i=r.source,n=r.target;e.sub(t,i.position,n.position);var a,o,s=e.len(t);a=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?r.weight:Math.pow(r.weight,this.edgeWeightInfluence),this.preventOverlap&&(s=s-i.size-n.size,s<=0)||(o=this.linLogMode?-a*Math.log(s+1)/(s+1):-a,e.scaleAndAdd(i.force,i.force,t,o),e.scaleAndAdd(n.force,n.force,t,-o))}}(),o.applyNodeGravity=function(){var t=e.create();return function(r){e.sub(t,this.gravityCenter,r.position);var i=e.len(t);e.scaleAndAdd(r.force,r.force,t,this.gravity*r.mass/(i+1))}}(),o.applyNodeStrongGravity=function(){var t=e.create();return function(r){e.sub(t,this.gravityCenter,r.position),e.scaleAndAdd(r.force,r.force,t,this.gravity*r.mass)}}(),o.updateBBox=function(){for(var e=1/0,t=1/0,r=-1/0,i=-1/0,n=0;n5e4?10:a>5e3?1:.1,t.scaling=a>100?2:10,t.barnesHutOptimize=a>1e3,e)for(var r in wf)null!=e[r]&&(t[r]=e[r]);if(!t.gravityCenter){for(var o=[1/0,1/0],s=[-1/0,-1/0],l=0;le},Sf.prototype.getNodePosition=function(e,t){if(t||(t=new Float32Array(2*this._nodes.length)),this._positionArr)for(var r=0;r0?1.1:.9,a=Math.max(Math.min(this._zoom*n,this.maxZoom),this.minZoom);n=a/this._zoom;var o=this._convertPos(r,i),s=(o.x-this._dx)*(n-1),l=(o.y-this._dy)*(n-1);this._dx-=s,this._dy-=l,this._zoom=a,this._needsUpdate=!0}}},dispose:function(){var e=this.zr;e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("globalout",this._mouseUpHandler),e.animation.off("frame",this._update)}}),Cf=Af,Of="@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end",Mf=eo.vec2;Ea.Shader.import(Of);var Df=1,Lf=a["b"].extend({type:"graphGL",__ecgl__:!0,init:function(e,t){this.groupGL=new Ea.Node,this.viewGL=new dl("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new ad(!0,t),this._forceEdgesMesh=new Ea.Mesh({material:new Ea.Material({shader:Ea.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new Ea.Geometry({attributes:{node:new Ea.Geometry.Attribute("node","float",2),color:new Ea.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:Ea.Mesh.LINES}),this._edgesMesh=new Ea.Mesh({material:new Ea.Material({shader:Ea.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new mf({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new Cf({zr:t.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(e,t,r){this.groupGL.add(this._pointsBuilder.rootNode),this._model=e,this._api=r,this._initLayout(e,t,r),this._pointsBuilder.update(e,t,r),this._forceLayoutInstance instanceof yf||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(e,r),this._control.off("update"),this._control.on("update",(function(){r.dispatchAction({type:"graphGLRoam",seriesId:e.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(Pn.firstNotNull(e.get("zoom"),1)),this._control.setOffset(e.get("offset")||[0,0]);var i=this._pointsBuilder.getPointsMesh();if(i.off("mousemove",this._mousemoveHandler),i.off("mouseout",this._mouseOutHandler,this),r.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,e.get("focusNodeAdjacency")){var n=e.get("focusNodeAdjacencyOn");"click"===n?r.getZr().on("click",this._clickHandler):"mouseover"===n&&(i.on("mousemove",this._mousemoveHandler,this),i.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1)}this._lastMouseOverDataIndex=-1},_clickHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?t!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._mouseOutHandler(e),this._lastMouseOverDataIndex=t}},_mouseOutHandler:function(e){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(e,t){var r=this._forceEdgesMesh.geometry,i=t.getEdgeData(),n=0,a=this._forceLayoutInstance,o=2*i.count();r.attributes.node.init(o),r.attributes.color.init(o),i.each((function(t){var o=e[t];r.attributes.node.set(n,a.getNodeUV(o.node1)),r.attributes.node.set(n+1,a.getNodeUV(o.node2));var s=Tc(i,o.dataIndex),l=Ea.parseColor(s);l[3]*=Pn.firstNotNull(wc(i,o.dataIndex),1),r.attributes.color.set(n,l),r.attributes.color.set(n+1,l),n+=2})),r.dirty()},_updateMeshLinesGeometry:function(){var e=this._model.getEdgeData(),t=this._edgesMesh.geometry,r=(e=this._model.getEdgeData(),this._model.getData().getLayout("points"));t.resetOffset(),t.setVertexCount(e.count()*t.getLineVertexCount()),t.setTriangleCount(e.count()*t.getLineTriangleCount());var i=[],n=[],a=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*e.count()),this._edgeIndicesMap=new Float32Array(e.count()),e.each((function(o){var s=e.graph.getEdgeByIndex(o),l=2*s.node1.dataIndex,c=2*s.node2.dataIndex;i[0]=r[l],i[1]=r[l+1],n[0]=r[c],n[1]=r[c+1];var u=Tc(e,s.dataIndex),h=Ea.parseColor(u);h[3]*=Pn.firstNotNull(wc(e,s.dataIndex),1);var d=e.getItemModel(s.dataIndex),f=Pn.firstNotNull(d.get(a),1)*this._api.getDevicePixelRatio();t.addLine(i,n,h,f);for(var p=0;p<4;p++)this._originalEdgeColors[4*s.dataIndex+p]=h[p];this._edgeIndicesMap[s.dataIndex]=o}),this),t.dirty()},_updateForceNodesGeometry:function(e){for(var t=this._pointsBuilder.getPointsMesh(),r=[],i=0;i=f&&(l._syncNodePosition(e),d=0),r.getZr().refresh(),Object(Aa["a"])((function(){p(t)}))}))};Object(Aa["a"])((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(n.layer.renderer),l._forceLayoutInstanceToDispose=null),p(c)})),this._layouting=!0}}},stopLayout:function(e,t,r,i){i&&null!=i.from&&i.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(i&&i.beforeLayout||(this._syncNodePosition(e),this._updateAfterLayout(e,t,r)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(e){var t=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);e.getData().setLayout("points",t),e.setNodePosition(t)},_updateAfterLayout:function(e,t,r){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(e,t,r),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(e,t,r,i){var n=this._model.getData();this._downplayAll();var a=i.dataIndex,o=n.graph,s=[],l=o.getNodeByIndex(a);s.push(l),l.edges.forEach((function(e){e.dataIndex<0||(e.node1!==l&&s.push(e.node1),e.node2!==l&&s.push(e.node2))}),this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach((function(e){this._pointsBuilder.highlight(n,e.dataIndex)}),this),this._pointsBuilder.updateLabels(s.map((function(e){return e.dataIndex})));var c=[];l.edges.forEach((function(e){e.dataIndex>=0&&(this._highlightEdge(e.dataIndex),c.push(e))}),this),this._focusNodes=s,this._focusEdges=c},unfocusNodeAdjacency:function(e,t,r,i){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(e){var t=this._model.getEdgeData().getItemModel(e),r=Ea.parseColor(t.get("emphasis.lineStyle.color")||t.get("lineStyle.color")),i=Pn.firstNotNull(t.get("emphasis.lineStyle.opacity"),t.get("lineStyle.opacity"),1);r[3]*=i,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],r)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach((function(e){this._pointsBuilder.downplay(this._model.getData(),e.dataIndex)}),this),this._focusEdges&&this._focusEdges.forEach((function(e){this._downplayEdge(e.dataIndex)}),this)},_downplayEdge:function(e){var t=this._getColor(e,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],t)},_setEdgeFade:function(){var e=[];return function(t,r){this._getColor(t,e),e[3]*=r,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)}}(),_getColor:function(e,t){for(var r=0;r<4;r++)t[r]=this._originalEdgeColors[4*e+r];return t},_fadeOutEdgesAll:function(e){var t=this._model.getData().graph;t.eachEdge((function(t){this._setEdgeFade(t.dataIndex,e)}),this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(e,t){this.viewGL.setViewport(0,0,t.getWidth(),t.getHeight(),t.getDevicePixelRatio());for(var r=this.viewGL.camera,i=e.getData(),n=i.getLayout("points"),a=Mf.create(1/0,1/0),o=Mf.create(-1/0,-1/0),s=[],l=0;lr.left&&ur.top)){var h=Math.max(o[0]-a[0],10),d=h/t.getWidth()*t.getHeight();h*=1.4,d*=1.4,a[0]-=.2*h,r.left=a[0],r.top=c-d/2,r.bottom=c+d/2,r.right=h+a[0],r.near=0,r.far=100}},dispose:function(){var e=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(e),this.groupGL.removeAll(),this._layoutId=-1,this._pointsBuilder.dispose()},remove:function(){this.groupGL.removeAll(),this._control.dispose()}});function Nf(e){return e instanceof Array||(e=[e,e]),e}function Rf(e){function t(){}e.registerChartView(Lf),e.registerSeriesModel(hf),e.registerVisual((function(e){const t={};e.eachSeriesByType("graphGL",(function(e){var r=e.getCategoriesData(),i=e.getData(),n={};r.each((function(i){var a=r.getName(i);n["ec-"+a]=i;var o=r.getItemModel(i),s=o.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(a,t)),r.setItemVisual(i,"style",s);var l=["symbol","symbolSize","symbolKeepAspect"];for(let e=0;e65535?new Uint32Array(3*i):new Uint16Array(3*i))},addLine:function(e){var t=this._vertexOffset;this.attributes.position.set(t,[e[0],e[1],1]),this.attributes.position.set(t+1,[e[0],e[1],-1]),this.attributes.position.set(t+2,[e[0],e[1],2]),this.attributes.position.set(t+3,[e[0],e[1],-2]),this.setTriangleIndices(this._faceOffset++,[t,t+1,t+2]),this.setTriangleIndices(this._faceOffset++,[t+1,t+2,t+3]),this._vertexOffset+=4}}),Bf=If,jf="@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n";function zf(e){var t=document.createElement("canvas");t.width=t.height=e;var r=t.getContext("2d");return r.fillStyle="#fff",r.arc(e/2,e/2,e/2,0,2*Math.PI),r.fill(),t}Xe["import"](jf);var Ff=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new or({type:Qt.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()};Ff.prototype={constructor:Ff,init:function(){var e={type:Qt.FLOAT,minFilter:Qt.NEAREST,magFilter:Qt.NEAREST,useMipmap:!1};this._spawnTexture=new or(e),this._particleTexture0=new or(e),this._particleTexture1=new or(e),this._frameBuffer=new fi({depthBuffer:!1}),this._particlePass=new vn({fragment:Xe.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new vn({fragment:Xe.source("clay.compositor.downsample")});var t=new $t({renderOrder:10,material:new re({shader:new Xe(Xe.source("ecgl.vfParticle.renderPoints.vertex"),Xe.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:$t.POINTS,geometry:new yr({dynamic:!0,mainAttribute:"texcoord0"})}),r=new $t({renderOrder:10,material:new re({shader:new Xe(Xe.source("ecgl.vfParticle.renderLines.vertex"),Xe.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new Bf,culling:!1}),i=new $t({material:new re({shader:new Xe(Xe.source("ecgl.color.vertex"),Xe.source("ecgl.color.fragment"))}),geometry:new _i});i.material.enableTexture("diffuseMap"),this._particlePointsMesh=t,this._particleLinesMesh=r,this._lastFrameFullQuadMesh=i,this._camera=new hn,this._thisFrameTexture=new or,this._lastFrameTexture=new or},setParticleDensity:function(e,t){for(var r=e*t,i=new Float32Array(4*r),n=0,a=this.particleLife,o=0;o0?e[e.length-1]:this._lastFrameTexture},setRegion:function(e){this._particlePass.setUniform("region",e)},resize:function(e,t){this._lastFrameTexture.width=e*this._supersampling,this._lastFrameTexture.height=t*this._supersampling,this._thisFrameTexture.width=e*this._supersampling,this._thisFrameTexture.height=t*this._supersampling,this._width=e,this._height=t},setParticleSize:function(e){var t=this._getParticleMesh();if(e<=2)return t.material.disableTexture("spriteTexture"),void(t.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new or),this._spriteTexture.image&&this._spriteTexture.image.width===e||(this._spriteTexture.image=zf(e),this._spriteTexture.dirty()),t.material.transparent=!0,t.material.enableTexture("spriteTexture"),t.material.set("spriteTexture",this._spriteTexture),this._particleSize=e},setGradientTexture:function(e){var t=this._getParticleMesh().material;t[e?"enableTexture":"disableTexture"]("gradientTexture"),t.setUniform("gradientTexture",e)},setColorTextureImage:function(e,t){var r=this._getParticleMesh().material;r.setTextureImage("colorTexture",e,t,{flipY:!0})},setParticleType:function(e){this._particleType=e},clearFrame:function(e){var t=this._frameBuffer;t.attach(this._lastFrameTexture),t.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),t.unbind(e)},setSupersampling:function(e){this._supersampling=e,this.resize(this._width,this._height)},_updateDownsampleTextures:function(e,t){for(var r=this._downsampleTextures,i=Math.max(Math.floor(Math.log(this._supersampling/t.getDevicePixelRatio())/Math.log(2)),0),n=2,a=this._width*this._supersampling,o=this._height*this._supersampling,s=0;s=359;s&&(n[0]>0&&(n[0]=0),a[0]1?(t.material.shader!==this._meshLinesShader&&t.material.attachShader(this._meshLinesShader),t.mode=Ea.Mesh.TRIANGLES):(t.material.shader!==this._nativeLinesShader&&t.material.attachShader(this._nativeLinesShader),t.mode=Ea.Mesh.LINES),r=r||0,i=i||n.count(),s.resetOffset();var u=0,h=0,d=[],f=[],p=[],m=[],g=[],v=.3,_=.7;function y(){f[0]=d[0]*_+m[0]*v-(d[1]-m[1])*a,f[1]=d[1]*_+m[1]*v-(m[0]-d[0])*a,p[0]=d[0]*v+m[0]*_-(d[1]-m[1])*a,p[1]=d[1]*v+m[1]*_-(m[0]-d[0])*a}if(o||0!==a)for(var x=r;xt.data,e=>{Object(i["nextTick"])(()=>{r(e)})},{immediate:!0,deep:!0});const r=e=>{let t=e.map(e=>{let t={value:e.value,name:e.label};return e.color&&(t.itemStyle={color:new n["a"].LinearGradient(0,0,0,1,[{offset:0,color:e.color[0]},{offset:1,color:e.color[1]}])}),t});a(t)},a=e=>{var r=n["b"](document.getElementById(t.echartsId));const i={backgroundColor:"transparent",tooltip:{trigger:"item",formatter:"{a}
{b}: {c} ({d}%)",backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#0C2E5A",textStyle:{color:"#fff"}},legend:{top:"middle",right:"5%",orient:"vertical",itemGap:20,textStyle:{color:t.color,fontSize:14},itemWidth:15,itemHeight:15,icon:"roundRect",formatter:function(e){const t=i.series[0].data,r=t.find(t=>t.label===e);return r?`${e} ${r.value} ${(r.value/50*100).toFixed(0)}%`:e}},series:[{name:"情报反馈统计",type:"pie",radius:["40%","75%"],center:["30%","50%"],startAngle:90,zlevel:10,itemStyle:{},selectedMode:"single",selectedOffset:30,animation:!0,animationType:"scale",animationEasing:"elasticOut",label:{show:!1},labelLine:{show:!1},data:e,zlevel:10,emphasis:{scale:!0,scaleSize:10,itemStyle:{shadowBlur:30,shadowColor:"rgba(0,0,0,0.6)"}}}]};i&&r.setOption(i),window.addEventListener("resize",()=>{r.resize()})};return(t,r)=>(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{style:{height:"100%",width:"100%"},id:e.echartsId},null,8,Zf))}},Kf=(r("5cfa"),r("d959")),Qf=r.n(Kf);const Jf=Qf()(Yf,[["__scopeId","data-v-75b106ee"]]);t["a"]=Jf},e88d:function(e,t){e.exports="data:image/png;base64,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"},f5c8:function(e,t,r){"use strict";r("fc44")},fc44:function(e,t,r){}}]);