goview_vue/dist/static/js/index-96c3a075.js

3329 lines
2.1 MiB
JavaScript
Raw Normal View History

2023-06-06 13:24:29 +08:00
var VS=Object.defineProperty,WS=Object.defineProperties;var jS=Object.getOwnPropertyDescriptors;var Tu=Object.getOwnPropertySymbols;var HS=Object.prototype.hasOwnProperty,$S=Object.prototype.propertyIsEnumerable;var Eu=Math.pow,jn=(r,e,t)=>e in r?VS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,i2=(r,e)=>{for(var t in e||(e={}))HS.call(e,t)&&jn(r,t,e[t]);if(Tu)for(var t of Tu(e))$S.call(e,t)&&jn(r,t,e[t]);return r},r3=(r,e)=>WS(r,jS(e));var l1=(r,e,t)=>(jn(r,typeof e!="symbol"?e+"":e,t),t);var m3=(r,e,t)=>new Promise((n,i)=>{var o=c=>{try{s(t.next(c))}catch(f){i(f)}},a=c=>{try{s(t.throw(c))}catch(f){i(f)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,a);s((t=t.apply(r,e)).next())});import{bq as d7,j as w2,br as K2,aN as Du,$ as $1,bs as jf,ab as et,bt as Hi,J as s2,bu as Hf,d as S1,r as Y,o as G,D as z1,w as b,b as p,c as h1,F as F1,q as g2,e as X1,t as w3,a1 as I2,u,a6 as I3,aT as i5,ac as V1,l as g0,bv as N5,bw as YS,m as j5,aF as le,a2 as C5,bx as v3,by as C3,bz as JS,bA as ZS,bB as J3,bC as $f,bD as W3,bE as Z3,bF as f4,bG as Eo,ad as l6,n as Q,au as Z2,s as r5,x as o5,h as F2,bH as f7,bI as K6,bJ as H8,aZ as j0,bK as e5,bd as H9,g as Do,b3 as Io,bL as XS,bM as qS,bN as Yf,bO as Ro,bP as Hn,ae as m1,bQ as Oo,bR as Jf,bS as QS,bT as Lo,bU as KS,bV as R0,bW as Iu,bX as eM,bY as Zf,bZ as Xf,b_ as qf,b$ as Qf,c0 as tM,c1 as Kf,c2 as nM,c3 as $n,c4 as Ru,c5 as eh,c6 as je,c7 as Ou,c8 as $i,c9 as iM,ca as rM,cb as Lu,cc as oM,cd as Pu,ce as aM,b2 as zu,cf as sM,cg as th,ch as lM,ci as uM,cj as cM,ck as dM,cl as fM,cm as hM,av as h7,L as g9,cn as ue,be as O0,co as pM,Q as mM,U as gM,X as ku,a5 as nh,cp as _M,cq as vM,cr as yM,cs as bM,ct as xM,cu as Uu,cv as SM,cw as Yn,aW as MM,ak as ih,aj as rh,bk as oh,cx as Yi}from"./index-4ec2ce15.js";import{S as R}from"./SettingItem-35031211.js";import{S as r1}from"./SettingItemBox-f60eaa4e.js";import{_ as k1}from"./CollapseItem.vue_vue_type_script_setup_true_lang-77b092a0.js";import{i as ah}from"./icon-42fa39e7.js";import{d as r2,u as A2,b as q1,e as M2,F as Po}from"./chartEditStore-bfc6c223.js";import{s as a5,e as P3,m as j3,S as z3}from"./index.esm.min-2eecdcbd.js";/* empty css */import{a as wM,b as AM,l as CM,g as TM}from"./plugin-ae137233.js";import{F as Jn}from"./fileTypeEnum-21359a08.js";const EM=(r,e,t,n)=>{const i=r,o=e,a={width:1,height:1},s=parseFloat((i/o).toFixed(5)),c=()=>{const g=parseFloat((window.innerWidth/window.innerHeight).toFixed(5));t&&(g>s?(a.width=parseFloat((window.innerHeight*s/i).toFixed(5)),a.height=parseFloat((window.innerHeight/o).toFixed(5)),t.style.transform=`scale(${a.width}, ${a.height})`):(a.height=parseFloat((window.innerWidth/s/o).toFixed(5)),a.width=parseFloat((window.innerWidth/i).toFixed(5)),t.style.transform=`scale(${a.width}, ${a.height})`),n&&n(a))},f=d7(()=>{c()},200);return{calcRate:c,windowResize:()=>{window.addEventListener("resize",f)},unWindowResize:()=>{window.removeEventListener("resize",f)}}},DM=(r,e,t,n)=>{const i=r,o=e,a={width:1,height:1},s=parseFloat((i/o).toFixed(5)),c=()=>{t&&(a.height=parseFloat((window.innerWidth/s/o).toFixed(5)),a.width=parseFloat((window.innerWidth/i).toFixed(5)),t.style.transform=`scale(${a.width}, ${a.height})`,n&&n(a))},f=d7(()=>{c()},200);return{calcRate:c,windowResize:()=>{window.addEventListener("resize",f)},unWindowResize:()=>{window.removeEventListener("resize",f)}}},IM=(r,e,t,n)=>{const i=r,o=e,a={height:1,width:1},s=parseFloat((i/o).toFixed(5)),c=()=>{t&&(a.width=parseFloat((window.innerHeight*s/i).toFixed(5)),a.height=parseFloat((window.innerHeight/o).toFixed(5)),t.style.transform=`scale(${a.width}, ${a.height})`,n&&n(a))},f=d7(()=>{c()},200);return{calcRate:c,windowResize:()=>{window.addEventListener("resize",f)},unWindowResize:()=>{window.removeEventListener("resize",f)}}},RM=(r,e,t,n)=>{const i={width:1,height:1},o=()=>{t&&(i.width=parseFloat((window.innerWidth/r).toFixed(5)),i.height=parseFloat((window.innerHeight/e).toFixed(5)),t.style.transform=`scale(${i.width}, ${i.height})`,n&&n(i))},a=d7(
2023-06-06 11:55:37 +08:00
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/at.exports;(function(r,e){(function(){var t,n="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",f=500,h="__lodash_placeholder__",m=1,g=2,v=4,S=1,_=2,x=1,M=2,A=4,D=8,T=16,E=32,C=64,P=128,I=256,L=512,W=30,e1="...",a1=800,$=16,N=1,H=2,K=3,X=1/0,B=9007199254740991,j=17976931348623157e292,J=0/0,u1=4294967295,d1=u1-1,x1=u1>>>1,v1=[["ary",P],["bind",x],["bindKey",M],["curry",D],["curryRight",T],["flip",L],["partial",E],["partialRight",C],["rearg",I]],o1="[object Arguments]",n1="[object Array]",E1="[object AsyncFunction]",T1="[object Boolean]",M1="[object Date]",w1="[object DOMException]",e2="[object Error]",N1="[object Function]",U1="[object GeneratorFunction]",l2="[object Map]",f2="[object Number]",h2="[object Null]",p2="[object Object]",R2="[object Promise]",o2="[object Proxy]",v2="[object RegExp]",t2="[object Set]",F="[object String]",k="[object Symbol]",y1="[object Undefined]",P1="[object WeakMap]",B1="[object WeakSet]",W1="[object ArrayBuffer]",a2="[object DataView]",q="[object Float32Array]",p1="[object Float64Array]",Y1="[object Int8Array]",J1="[object Int16Array]",Q1="[object Int32Array]",u2="[object Uint8Array]",S2="[object Uint8ClampedArray]",G2="[object Uint16Array]",s1="[object Uint32Array]",K1=/\b__p \+= '';/g,G1=/\b(__p \+=) '' \+/g,O1=/(__e\(.*?\)|\b__t\)) \+\n'';/g,j1=/&(?:amp|lt|gt|quot|#39);/g,x2=/[&<>"']/g,n3=RegExp(j1.source),h3=RegExp(x2.source),L0=/<%-([\s\S]+?)%>/g,c3=/<%([\s\S]+?)%>/g,J4=/<%=([\s\S]+?)%>/g,x4=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rt=/^\w*$/,J5=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Z5=/[\\^$.*+?()[\]{}|]/g,Ot=RegExp(Z5.source),d6=/^\s+/,Lt=/\s/,V=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_1=/\{\n\/\* \[wrapped with (.+)\] \*/,C1=/,? & /,g1=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,D1=/[()=,{}\[\]\/\s]/,m2=/\\(\\)?/g,C2=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,O2=/\w*$/,T2=/^[-+]0x[0-9a-f]+$/i,Y2=/^0b[01]+$/i,V2=/^\[object .+?Constructor\]$/,W2=/^0o[0-7]+$/i,d3=/^(?:0|[1-9]\d*)$/,J0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,y0=/($^)/,M9=/['\n\r\u2028\u2029\\]/g,p4="\\ud800-\\udfff",$2="\\u0300-\\u036f",w9="\\ufe20-\\ufe2f",x3="\\u20d0-\\u20ff",m4=$2+w9+x3,b0="\\u2700-\\u27bf",A9="a-z\\xdf-\\xf6\\xf8-\\xff",f6="\\xac\\xb1\\xd7\\xf7",X3="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Z0="\\u2000-\\u206f",h6=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",n4="A-Z\\xc0-\\xd6\\xd8-\\xde",X5="\\ufe0e\\ufe0f",x7=f6+X3+Z0+h6,q5="[']",Vm="["+p4+"]",ls="["+x7+"]",S7="["+m4+"]",us="\\d+",Wm="["+b0+"]",cs="["+A9+"]",ds="[^"+p4+x7+us+b0+A9+n4+"]",Pt="\\ud83c[\\udffb-\\udfff]",jm="(?:"+S7+"|"+Pt+")",fs="[^"+p4+"]",zt="(?:\\ud83c[\\udde6-\\uddff]){2}",kt="[\\ud800-\\udbff][\\udc00-\\udfff]",Q5="["+n4+"]",hs="\\u200d",ps="(?:"+cs+"|"+ds+")",Hm="(?:"+Q5+"|"+ds+")",ms="(?:"+q5+"(?:d|ll|m|re|s|t|ve))?",gs="(?:"+q5+"(?:D|LL|M|RE|S|T|VE))?",_s=jm+"?",vs="["+X5+"]?",$m="(?:"+hs+"(?:"+[fs,zt,kt].join("|")+")"+vs+_s+")*",Ym="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Jm="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ys=vs+_s+$m,Zm="(?:"+[Wm,zt,kt].join("|")+")"+ys,Xm="(?:"+[fs+S7+"?",S7,zt,kt,Vm].join("|")+")",qm=RegExp(q5,"g"),Qm=RegExp(S7,"g"),Ut=RegExp(Pt+"(?="+Pt+")|"+Xm+ys,"g"),Km=RegExp([Q5+"?"+cs+"+"+ms+"(?="+[ls,Q5,"$"].join("|")+")",Hm+"+"+gs+"(?="+[ls,Q5+ps,"$"].join("|")+")",Q5+"?"+ps+"+"+ms,Q5+"+"+gs,Jm,Ym,us,Zm].join("|"),"g"),eg=RegExp("["+hs+p4+m4+X5+"]"),tg=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ng=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ig=-1,u3={
/* [wrapped with `+d+`] */
`)}function bv(l){return D2(l)||g5(l)||!!(Vs&&l&&l[Vs])}function t9(l,d){var y=typeof l;return d=d==null?B:d,!!d&&(y=="number"||y!="symbol"&&d3.test(l))&&l>-1&&l%1==0&&l<d}function _4(l,d,y){if(!p3(y))return!1;var w=typeof d;return(w=="number"?M4(y)&&t9(d,y.length):w=="string"&&d in y)?M0(y[d],l):!1}function An(l,d){if(D2(l))return!1;var y=typeof l;return y=="number"||y=="symbol"||y=="boolean"||l==null||U4(l)?!0:Rt.test(l)||!x4.test(l)||d!=null&&l in i3(d)}function xv(l){var d=typeof l;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?l!=="__proto__":l===null}function Cn(l){var d=q7(l),y=z[d];if(typeof y!="function"||!(d in N2.prototype))return!1;if(l===y)return!0;var w=Sn(y);return!!w&&l===w[0]}function Sv(l){return!!Ns&&Ns in l}var Mv=T7?n9:Wn;function C6(l){var d=l&&l.constructor,y=typeof d=="function"&&d.prototype||i8;return l===y}function Nl(l){return l===l&&!p3(l)}function Fl(l,d){return function(y){return y==null?!1:y[l]===d&&(d!==t||l in i3(y))}}function wv(l){var d=ie(l,function(w){return y.size===f&&y.clear(),w}),y=d.cache;return d}function Av(l,d){var y=l[1],w=d[1],O=y|w,U=O<(x|M|P),Z=w==P&&y==D||w==P&&y==I&&l[7].length<=d[8]||w==(P|I)&&d[7].length<=d[8]&&y==D;if(!(U||Z))return l;w&x&&(l[2]=d[2],O|=y&x?0:A);var i1=d[3];if(i1){var f1=l[3];l[3]=f1?xl(f1,i1,d[4]):i1,l[4]=f1?E9(l[3],h):d[4]}return i1=d[5],i1&&(f1=l[5],l[5]=f1?Sl(f1,i1,d[6]):i1,l[6]=f1?E9(l[5],h):d[6]),i1=d[7],i1&&(l[7]=i1),w&P&&(l[8]=l[8]==null?d[8]:i4(l[8],d[8])),l[9]==null&&(l[9]=d[9]),l[0]=d[0],l[1]=O,l}function Cv(l){var d=[];if(l!=null)for(var y in i3(l))d.push(y);return d}function Tv(l){return D7.call(l)}function Bl(l,d,y){return d=N3(d===t?l.length-1:d,0),function(){for(var w=arguments,O=-1,U=N3(w.length-d,0),Z=b1(U);++O<U;)Z[O]=w[d+O];O=-1;for(var i1=b1(d+1);++O<d;)i1[O]=w[O];return i1[d]=y(Z),P4(l,this,i1)}}function Gl(l,d){return d.length<2?l:h5(l,e0(d,0,-1))}function Ev(l,d){for(var y=l.length,w=i4(d.length,y),O=S4(l);w--;){var U=d[w];l[w]=t9(U,y)?O[U]:t}return l}function Tn(l,d){if(!(d==="constructor"&&typeof l[d]=="function")&&d!="__proto__")return l[d]}var Vl=jl(dl),T6=Wg||function(l,d){return q3.setTimeout(l,d)},En=jl(q_);function Wl(l,d,y){var w=d+"";return En(l,yv(w,Dv(gv(w),y)))}function jl(l){var d=0,y=0;return function(){var w=Yg(),O=$-(w-y);if(y=w,O>0){if(++d>=a1)return arguments[0]}else d=0;return l.apply(t,arguments)}}function K7(l,d){var y=-1,w=l.length,O=w-1;for(d=d===t?w:d;++y<d;){var U=cn(y,O),Z=l[U];l[U]=l[y],l[y]=Z}return l.length=d,l}var Hl=wv(function(l){var d=[];return l.charCodeAt(0)===46&&d.push(""),l.replace(J5,function(y,w,O,U){d.push(O?U.replace(m2,"$1"):w||y)}),d});function k0(l){if(typeof l=="string"||U4(l))return l;var d=l+"";return d=="0"&&1/l==-X?"-0":d}function m5(l){if(l!=null){try{return E7.call(l)}catch(d){}try{return l+""}catch(d){}}return""}function Dv(l,d){return X4(v1,function(y){var w="_."+y[0];d&y[1]&&!M7(l,w)&&l.push(w)}),l.sort()}function $l(l){if(l instanceof N2)return l.clone();var d=new Q4(l.__wrapped__,l.__chain__);return d.__actions__=S4(l.__actions__),d.__index__=l.__index__,d.__values__=l.__values__,d}function Iv(l,d,y){(y?_4(l,d,y):d===t)?d=1:d=N3(L2(d),0);var w=l==null?0:l.length;if(!w||d<1)return[];for(var O=0,U=0,Z=b1(z7(w/d));O<w;)Z[U++]=e0(l,O,O+=d);return Z}function Rv(l){for(var d=-1,y=l==null?0:l.length,w=0,O=[];++d<y;){var U=l[d];U&&(O[w++]=U)}return O}function Ov(){var l=arguments.length;if(!l)return[];for(var d=b1(l-1),y=arguments[0],w=l;w--;)d[w-1]=arguments[w];return T9(D2(y)?S4(y):[y],Q3(d,1))}var Lv=z2(function(l,d){return T3(l)?x6(l,Q3(d,1,T3,!0)):[]}),Pv=z2(function(l,d){var y=t0(d);return T3(y)&&(y=t),T3(l)?x6(l,Q3(d,1,T3,!0),_2(y,2)):[]}),zv=z2(function(l,d){var y=t0(d);return T3(y)&&(y=t),T3(l)?x6(l,Q3(d,1,T3,!0),t,y):[]});function kv(l,d,y){var w=l==null?0:l.length;return w?(d=y||d===t?1:L2(d),e0(l,d<0?0:d,w)):[]}function Uv(l,d,y){var w=l==null?0:l.length;return w?(d=y||d===t?1:L2(d),d=w-d,e0(l,0,d<0?0:d)):[]}function Nv(l,d){return l&&l.length?H7(l,_2(d,3),!0,!0):[]}function Fv(l,d){return l&&l.length?H7(l,_2(d,3),!0):[]}function Bv(l,d,y,w){var O=l==nul
`;l.replace(Z1,function(b2,k2,j2,N4,v4,F4){return j2||(j2=N4),L1+=l.slice(I1,F4).replace(M9,Mg),k2&&(i1=!0,L1+=`' +
__e(`+k2+`) +
'`),v4&&(f1=!0,L1+=`';
`+v4+`;
__p += '`),j2&&(L1+=`' +
((__t = (`+j2+`)) == null ? '' : __t) +
'`),I1=F4+b2.length,b2}),L1+=`';
`;var y2=Q2.call(d,"variable")&&d.variable;if(!y2)L1=`with (obj) {
`+L1+`
}
`;else if(D1.test(y2))throw new E2(s);L1=(f1?L1.replace(K1,""):L1).replace(G1,"$1").replace(O1,"$1;"),L1="function("+(y2||"obj")+`) {
`+(y2?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(i1?", __e = _.escape":"")+(f1?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+L1+`return __p
}`;var P2=wu(function(){return J2(U,d2+"return "+L1).apply(t,Z)});if(P2.source=L1,Ln(P2))throw P2;return P2}function Zx(l){return q2(l).toLowerCase()}function Xx(l){return q2(l).toUpperCase()}function qx(l,d,y){if(l=q2(l),l&&(y||d===t))return Ls(l);if(!l||!(d=k4(d)))return l;var w=x0(l),O=x0(d),U=Ps(w,O),Z=zs(w,O)+1;return L9(w,U,Z).join("")}function Qx(l,d,y){if(l=q2(l),l&&(y||d===t))return l.slice(0,Us(l)+1);if(!l||!(d=k4(d)))return l;var w=x0(l),O=zs(w,x0(d))+1;return L9(w,0,O).join("")}function Kx(l,d,y){if(l=q2(l),l&&(y||d===t))return l.replace(d6,"");if(!l||!(d=k4(d)))return l;var w=x0(l),O=Ps(w,x0(d));return L9(w,O).join("")}function eS(l,d){var y=W,w=e1;if(p3(d)){var O="separator"in d?d.separator:O;y="length"in d?L2(d.length):y,w="omission"in d?k4(d.omission):w}l=q2(l);var U=l.length;if(e8(l)){var Z=x0(l);U=Z.length}if(y>=U)return l;var i1=y-t8(w);if(i1<1)return w;var f1=Z?L9(Z,0,i1).join(""):l.slice(0,i1);if(O===t)return f1+w;if(Z&&(i1+=f1.length-i1),Pn(O)){if(l.slice(i1).search(O)){var I1,R1=f1;for(O.global||(O=Zt(O.source,q2(O2.exec(O))+"g")),O.lastIndex=0;I1=O.exec(R1);)var L1=I1.index;f1=f1.slice(0,L1===t?i1:L1)}}else if(l.indexOf(k4(O),i1)!=i1){var Z1=f1.lastIndexOf(O);Z1>-1&&(f1=f1.slice(0,Z1))}return f1+w}function tS(l){return l=q2(l),l&&n3.test(l)?l.replace(j1,Ig):l}var nS=l8(function(l,d,y){return l+(y?" ":"")+d.toUpperCase()}),Un=Al("toUpperCase");function Mu(l,d,y){return l=q2(l),d=y?t:d,d===t?Ag(l)?Lg(l):gg(l):l.match(d)||[]}var wu=z2(function(l,d){try{return P4(l,t,d)}catch(y){return Ln(y)?y:new E2(y)}}),iS=e9(function(l,d){return X4(d,function(y){y=k0(y),Q0(l,y,Rn(l[y],l))}),l});function rS(l){var d=l==null?0:l.length,y=_2();return l=d?f3(l,function(w){if(typeof w[1]!="function")throw new q4(a);return[y(w[0]),w[1]]}):[],z2(function(w){for(var O=-1;++O<d;){var U=l[O];if(P4(U[0],this,w))return P4(U[1],this,w)}})}function oS(l){return I_(K4(l,m))}function Nn(l){return function(){return l}}function aS(l,d){return l==null||l!==l?d:l}var sS=Tl(),lS=Tl(!0);function A4(l){return l}function Fn(l){return il(typeof l=="function"?l:K4(l,m))}function uS(l){return ol(K4(l,m))}function cS(l,d){return al(l,K4(d,m))}var dS=z2(function(l,d){return function(y){return S6(y,l,d)}}),fS=z2(function(l,d){return function(y){return S6(l,y,d)}});function Bn(l,d,y){var w=H3(d),O=V7(d,w);y==null&&!(p3(d)&&(O.length||!w.length))&&(y=d,d=l,l=this,O=V7(d,H3(d)));var U=!(p3(y)&&"chain"in y)||!!y.chain,Z=n9(l);return X4(O,function(i1){var f1=d[i1];l[i1]=f1,Z&&(l.prototype[i1]=function(){var I1=this.__chain__;if(U||I1){var R1=l(this.__wrapped__),L1=R1.__actions__=S4(this.__actions__);return L1.push({func:f1,args:arguments,thisArg:l}),R1.__chain__=I1,R1}return f1.apply(l,T9([this.value()],arguments))})}),l}function hS(){return q3._===this&&(q3._=Fg),this}function Gn(){}function pS(l){return l=L2(l),z2(function(d){return sl(d,l)})}var mS=vn(f3),gS=vn(Es),_S=vn(Vt);function Au(l){return An(l)?Wt(k0(l)):Y_(l)}function vS(l){return function(d){return l==null?t:h5(l,d)}}var yS=Dl(),bS=Dl(!0);function Vn(){return[]}function Wn(){return!1}function xS(){return{}}function SS(){return""}function MS(){return!0}function wS(l,d){if(l=L2(l),l<1||l>B)return[];var y=u1,w=i4(l,u1);d=_2(d),l-=u1;for(var O=$t(w,d);++y<l;)d(y);return O}function AS(l){return D2(l)?f3(l,k0):U4(l)?[l]:S4(Hl(q2(l)))}function CS(l){var d=++Ug;return q2(l)+d}var TS=J7(function(l,d){return l+d},0),ES=yn("ceil"),DS=J7(function(l,d){return l/d},1),IS=yn("floor");function RS(l){return l&&l.length?G7(l,A4,rn):t}function OS(l,d){return l&&l.length?G7(l,_2(d,2),rn):t}function LS(l){return Rs(l,A4)}function PS(l,d){return Rs(l,_2(d,2))}function zS(l){return l&&l.length?G7(l,A4,ln):t}function kS(l,d){return l&&l.length?G7(l,_2(d,2),ln):t}var US=J7(function(l,d){return l*d},1),NS=yn("round"),FS=J7(function(l,d){return l-d},0);function BS(l){return l&&l.length?Ht(l,A4):0}function GS(l,d){return l&&l.length?Ht(l,_2(d,2)):0}return z.after=ub,z.ary=nu,z.assign=Xb,z.assignIn=gu,z.assignInWith=se,z.assignWith=qb,z.at=Qb,z.before=iu,z.bind=Rn,z.bindAll=iS,z.bindKey=ru,z.castArray=xb,z.chain=
38, ${u(i)-11} 41, ${u(i)-8} 73, ${u(i)-8} 75, ${u(i)-10} 81, ${u(i)-10}
85, ${u(i)-6} ${u(n)-85}, ${u(i)-6} ${u(n)-81}, ${u(i)-10} ${u(n)-75}, ${u(i)-10}
${u(n)-73}, ${u(i)-8} ${u(n)-41}, ${u(i)-8} ${u(n)-38}, ${u(i)-11}
${u(n)-24}, ${u(i)-11} ${u(n)-13}, ${u(i)-21} ${u(n)-13}, ${u(i)-24}
${u(n)-10}, ${u(i)-27} ${u(n)-10}, 27 ${u(n)-13}, 25 ${u(n)-13}, 21
${u(n)-24}, 11 ${u(n)-38}, 11 ${u(n)-41}, 8 ${u(n)-73}, 8 ${u(n)-75}, 10
${u(n)-81}, 10 ${u(n)-85}, 6 85, 6 81, 10 75, 10 73, 8 41, 8 38, 11 24, 11 13, 21 13, 24`},null,8,tD)],8,eD)),(G(),h1(F1,null,g2(t,h=>Q("svg",{width:u(n),height:u(i),key:h,class:h7(`border-item ${h}`)},[Q("polygon",{fill:u(o)[0],points:"6,66 6,18 12,12 18,12 24,6 27,6 30,9 36,9 39,6 84,6 81,9 75,9 73.2,7 40.8,7 37.8,10.2 24,10.2 12,21 12,24 9,27 9,51 7.8,54 7.8,63"},[Q("animate",{attributeName:"fill",values:`${u(o)[0]};${u(o)[1]};${u(o)[0]}`,dur:`${u(a)}s`,begin:"0s",repeatCount:"indefinite"},null,8,rD)],8,iD),Q("polygon",{fill:u(o)[1],points:"27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8"},[Q("animate",{attributeName:"fill",values:`${u(o)[1]};${u(o)[0]};${u(o)[1]}`,dur:`${u(a)}s`,begin:"0s",repeatCount:"indefinite"},null,8,aD)],8,oD),Q("polygon",{fill:u(o)[0],points:"9,54 9,63 7.199999999999999,66 7.199999999999999,75 7.8,78 7.8,110 8.4,110 8.4,66 9.6,66 9.6,54"},[Q("animate",{attributeName:"fill",values:`${u(o)[0]};${u(o)[1]};transparent`,dur:`${u(a)+1}s`,begin:"0s",repeatCount:"indefinite"},null,8,lD)],8,sD)],10,nD)),64))]))}});const cD=F2(uD,[["__scopeId","data-v-708ac670"]]),dD=Object.freeze(Object.defineProperty({__proto__:null,default:cD},Symbol.toStringTag,{value:"Module"})),fD={class:"go-border-box"},hD=["width","height"],pD=["fill","stroke","d"],mD=["stroke"],gD=["stroke"],_D=["stroke","d"],vD=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,{w:t,h:n}=$1(e.chartConfig.attr),{colors:i,backgroundColor:o}=$1(e.chartConfig.option);return(a,s)=>(G(),h1("div",fD,[(G(),h1("svg",{width:u(t),height:u(n)},[Q("path",{fill:u(o),stroke:u(i)[0],d:`
M 5 20 L 5 10 L 12 3 L 60 3 L 68 10
L ${u(t)-20} 10 L ${u(t)-5} 25
L ${u(t)-5} ${u(n)-5} L 20 ${u(n)-5}
L 5 ${u(n)-20} L 5 20
`},null,8,pD),Q("path",{fill:"transparent","stroke-w":"3","stroke-linecap":"round","stroke-dasharray":"10, 5",stroke:u(i)[0],d:"M 16 9 L 61 9"},null,8,mD),Q("path",{fill:"transparent",stroke:u(i)[1],d:"M 5 20 L 5 10 L 12 3 L 60 3 L 68 10"},null,8,gD),Q("path",{fill:"transparent",stroke:u(i)[1],d:`M ${u(t)-5} ${u(n)-30} L ${u(t)-5} ${u(n)-5} L ${u(t)-30} ${u(n)-5}`},null,8,_D)],8,hD))]))}});const yD=F2(vD,[["__scopeId","data-v-fc7dd111"]]),bD=Object.freeze(Object.defineProperty({__proto__:null,default:yD},Symbol.toStringTag,{value:"Module"})),bt=r=>(r5("data-v-b07bae32"),r=r(),o5(),r),xD={class:"go-border-box"},SD=["width","height"],MD=bt(()=>Q("feMorphology",{operator:"dilate",radius:"1",in:"SourceAlpha",result:"thicken"},null,-1)),wD=bt(()=>Q("feGaussianBlur",{in:"thicken",stdDeviation:"2",result:"blurred"},null,-1)),AD=["flood-color"],CD=["values"],TD=bt(()=>Q("feComposite",{in:"glowColor",in2:"blurred",operator:"in",result:"softGlowColored"},null,-1)),ED=bt(()=>Q("feMerge",null,[Q("feMergeNode",{in:"softGlowColored"}),Q("feMergeNode",{in:"SourceGraphic"})],-1)),DD=["fill","stroke","d"],ID=["filter","stroke"],RD=["filter","stroke","d"],OD=["filter","stroke","d"],LD=["filter","stroke","d"],PD=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,t=`border-box-03-filterId-${g9()}`,{w:n,h:i}=$1(e.chartConfig.attr),{colors:o,backgroundColor:a}=$1(e.chartConfig.option);return(s,c)=>(G(),h1("div",xD,[(G(),h1("svg",{width:u(n),height:u(i)},[Q("defs",null,[Q("filter",{id:t,height:"150%",width:"150%",x:"-25%",y:"-25%"},[MD,wD,Q("feFlood",{"flood-color":u(ue)(u(o)[1],.7),result:"glowColor"},[Q("animate",{attributeName:"flood-color",values:`
${u(ue)(u(o)[1],.7)};
${u(ue)(u(o)[1],.3)};
${u(ue)(u(o)[1],.7)};
`,dur:"3s",begin:"0s",repeatCount:"indefinite"},null,8,CD)],8,AD),TD,ED])]),u(n)&&u(i)?(G(),h1("path",{key:0,fill:u(a),"stroke-width":"2",stroke:u(o)[0],d:`
M15 5 L ${u(n)-15} 5 Q ${u(n)-5} 5, ${u(n)-5} 15
L ${u(n)-5} ${u(i)-15} Q ${u(n)-5} ${u(i)-5}, ${u(n)-15} ${u(i)-5}
L 15, ${u(i)-5} Q 5 ${u(i)-5} 5 ${u(i)-15} L 5 15
Q 5 5 15 5
`},null,8,DD)):I3("",!0),Q("path",{"stroke-width":"2",fill:"transparent","stroke-linecap":"round",filter:`url(#${t})`,stroke:u(o)[1],d:"M 20 5 L 15 5 Q 5 5 5 15 L 5 20"},null,8,ID),Q("path",{"stroke-width":"2",fill:"transparent","stroke-linecap":"round",filter:`url(#${t})`,stroke:u(o)[1],d:`M ${u(n)-20} 5 L ${u(n)-15} 5 Q ${u(n)-5} 5 ${u(n)-5} 15 L ${u(n)-5} 20`},null,8,RD),Q("path",{"stroke-width":"2",fill:"transparent","stroke-linecap":"round",filter:`url(#${t})`,stroke:u(o)[1],d:`
M ${u(n)-20} ${u(i)-5} L ${u(n)-15} ${u(i)-5}
Q ${u(n)-5} ${u(i)-5} ${u(n)-5} ${u(i)-15}
L ${u(n)-5} ${u(i)-20}
`},null,8,OD),Q("path",{"stroke-width":"2",fill:"transparent","stroke-linecap":"round",filter:`url(#${t})`,stroke:u(o)[1],d:`
M 20 ${u(i)-5} L 15 ${u(i)-5}
Q 5 ${u(i)-5} 5 ${u(i)-15}
L 5 ${u(i)-20}
`},null,8,LD)],8,SD))]))}});const zD=F2(PD,[["__scopeId","data-v-b07bae32"]]),kD=Object.freeze(Object.defineProperty({__proto__:null,default:zD},Symbol.toStringTag,{value:"Module"})),Y0=r=>(r5("data-v-4dd6360b"),r=r(),o5(),r),UD={class:"go-border-box"},ND=["width","height"],FD=Y0(()=>Q("feMorphology",{operator:"dilate",radius:"2",in:"SourceAlpha",result:"thicken"},null,-1)),BD=Y0(()=>Q("feGaussianBlur",{in:"thicken",stdDeviation:"3",result:"blurred"},null,-1)),GD=["flood-color"],VD=Y0(()=>Q("feComposite",{in:"glowColor",in2:"blurred",operator:"in",result:"softGlowColored"},null,-1)),WD=Y0(()=>Q("feMerge",null,[Q("feMergeNode",{in:"softGlowColored"}),Q("feMergeNode",{in:"SourceGraphic"})],-1)),jD=["fill","points"],HD=["fill","stroke","filter","points"],$D=["stroke","points"],YD=["stroke","points"],JD=["stroke","fill","filter","points"],ZD=["filter","fill","points"],XD=Y0(()=>Q("animate",{attributeName:"opacity",values:"1;0.7;1",dur:"2s",begin:"0s",repeatCount:"indefinite"},null,-1)),qD=[XD],QD=["filter","fill","points"],KD=Y0(()=>Q("animate",{attributeName:"opacity",values:"0.7;0.4;0.7",dur:"2s",begin:"0s",repeatCount:"indefinite"},null,-1)),eI=[KD],tI=["filter","fill","points"],nI=Y0(()=>Q("animate",{attributeName:"opacity",values:"0.5;0.2;0.5",dur:"2s",begin:"0s",repeatCount:"indefinite"},null,-1)),iI=[nI],rI=["filter","fill","points"],oI=Y0(()=>Q("animate",{attributeName:"opacity",values:"1;0.7;1",dur:"2s",begin:"0s",repeatCount:"indefinite"},null,-1)),aI=[oI],sI=["filter","fill","points"],lI=Y0(()=>Q("animate",{attributeName:"opacity",values:"0.7;0.4;0.7",dur:"2s",begin:"0s",repeatCount:"indefinite"},null,-1)),uI=[lI],cI=["filter","fill","points"],dI=Y0(()=>Q("animate",{attributeName:"opacity",values:"0.5;0.2;0.5",dur:"2s",begin:"0s",repeatCount:"indefinite"},null,-1)),fI=[dI],hI=["x","y","fill","font-size"],pI=["fill","filter","points"],mI=["fill","filter","points"],gI=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,t=`border-box-04-filterId-${g9()}`,{w:n,h:i}=$1(e.chartConfig.attr),{colors:o,borderTitle:a,borderTitleColor:s,borderTitleSize:c,borderTitleHeight:f,borderTitleWidth:h,backgroundColor:m}=$1(e.chartConfig.option);return(g,v)=>(G(),h1("div",UD,[(G(),h1("svg",{width:u(n),height:u(i)},[Q("defs",null,[Q("filter",{id:t,height:"150%",width:"150%",x:"-25%",y:"-25%"},[FD,BD,Q("feFlood",{"flood-color":u(o)[1],result:"glowColor"},null,8,GD),VD,WD])]),Q("polygon",{fill:u(m),points:`
20, 32 ${u(n)*.5-u(h)/2}, 32 ${u(n)*.5-u(h)/2+20}, 53
${u(n)*.5+u(h)/2-20}, 53 ${u(n)*.5+u(h)/2}, 32
${u(n)-20}, 32 ${u(n)-8}, 48 ${u(n)-8}, ${u(i)-25} ${u(n)-20}, ${u(i)-8}
20, ${u(i)-8} 8, ${u(i)-25} 8, 50
`},null,8,jD),Q("polyline",{fill:u(m),stroke:u(o)[0],filter:`url(#${t})`,points:`
${(u(n)-u(h))/2}, 30
20, 30 7, 50 7, ${50+(u(i)-167)/2}
13, ${55+(u(i)-167)/2} 13, ${135+(u(i)-167)/2}
7, ${140+(u(i)-167)/2} 7, ${u(i)-27}
20, ${u(i)-7} ${u(n)-20}, ${u(i)-7} ${u(n)-7}, ${u(i)-27}
${u(n)-7}, ${140+(u(i)-167)/2} ${u(n)-13}, ${135+(u(i)-167)/2}
${u(n)-13}, ${55+(u(i)-167)/2} ${u(n)-7}, ${50+(u(i)-167)/2}
${u(n)-7}, 50 ${u(n)-20}, 30 ${(u(n)+u(h))/2}, 30
${(u(n)+u(h))/2-20}, 7 ${(u(n)-u(h))/2+20}, 7
${(u(n)-u(h))/2}, 30 ${(u(n)-u(h))/2+20}, 52
${(u(n)+u(h))/2-20}, 52 ${(u(n)+u(h))/2}, 30
`},null,8,HD),Q("polygon",{stroke:u(o)[0],fill:"transparent",points:`
${(u(n)+u(h))/2-5}, 30 ${(u(n)+u(h))/2-21}, 11
${(u(n)+u(h))/2-27}, 11 ${(u(n)+u(h))/2-8}, 34
`},null,8,$D),Q("polygon",{stroke:u(o)[0],fill:"transparent",points:`
${(u(n)-u(h))/2+5}, 30 ${(u(n)-u(h))/2+22}, 49
${(u(n)-u(h))/2+28}, 49 ${(u(n)-u(h))/2+8}, 26
`},null,8,YD),Q("polygon",{stroke:u(o)[0],fill:u(o)[1],filter:`url(#${t})`,points:`
${(u(n)+u(h))/2-11}, 37 ${(u(n)+u(h))/2-32}, 11
${(u(n)-u(h))/2+23}, 11 ${(u(n)-u(h))/2+11}, 23
${(u(n)-u(h))/2+33}, 49 ${(u(n)+u(h))/2-22}, 49
`},null,8,JD),Q("polygon",{filter:`url(#${t})`,fill:u(o)[0],opacity:"1",points:`
${(u(n)-u(h))/2-10}, 37 ${(u(n)-u(h))/2-31}, 37
${(u(n)-u(h))/2-25}, 46 ${(u(n)-u(h))/2-4}, 46
`},qD,8,ZD),Q("polygon",{filter:`url(#${t})`,fill:u(o)[0],opacity:"0.7",points:`
${(u(n)-u(h))/2-40}, 37 ${(u(n)-u(h))/2-61}, 37
${(u(n)-u(h))/2-55}, 46 ${(u(n)-u(h))/2-34}, 46
`},eI,8,QD),Q("polygon",{filter:`url(#${t})`,fill:u(o)[0],opacity:"0.5",points:`
${(u(n)-u(h))/2-70}, 37 ${(u(n)-u(h))/2-91}, 37
${(u(n)-u(h))/2-85}, 46 ${(u(n)-u(h))/2-64}, 46
`},iI,8,tI),Q("polygon",{filter:`url(#${t})`,fill:u(o)[0],opacity:"1",points:`
${(u(n)+u(h))/2+30}, 37 ${(u(n)+u(h))/2+9}, 37
${(u(n)+u(h))/2+3}, 46 ${(u(n)+u(h))/2+24}, 46
`},aI,8,rI),Q("polygon",{filter:`url(#${t})`,fill:u(o)[0],opacity:"0.7",points:`
${(u(n)+u(h))/2+60}, 37 ${(u(n)+u(h))/2+39}, 37
${(u(n)+u(h))/2+33}, 46 ${(u(n)+u(h))/2+54}, 46
`},uI,8,sI),Q("polygon",{filter:`url(#${t})`,fill:u(o)[0],opacity:"0.5",points:`
${(u(n)+u(h))/2+90}, 37 ${(u(n)+u(h))/2+69}, 37
${(u(n)+u(h))/2+63}, 46 ${(u(n)+u(h))/2+84}, 46
`},fI,8,cI),Q("text",{x:`${u(n)/2}`,y:u(f),fill:u(s),"font-size":u(c),"text-anchor":"middle","dominant-baseline":"middle"},w3(u(a)),9,hI),Q("polygon",{fill:u(o)[0],filter:`url(#${t})`,points:`
7, ${53+(u(i)-167)/2} 11, ${57+(u(i)-167)/2}
11, ${133+(u(i)-167)/2} 7, ${137+(u(i)-167)/2}
`},null,8,pI),Q("polygon",{fill:u(o)[0],filter:`url(#${t})`,points:`
${u(n)-7}, ${53+(u(i)-167)/2} ${u(n)-11}, ${57+(u(i)-167)/2}
${u(n)-11}, ${133+(u(i)-167)/2} ${u(n)-7}, ${137+(u(i)-167)/2}
`},null,8,mI)],8,ND))]))}});const _I=F2(gI,[["__scopeId","data-v-4dd6360b"]]),vI=Object.freeze(Object.defineProperty({__proto__:null,default:_I},Symbol.toStringTag,{value:"Module"})),yI=["width","height"],bI=["fill","points"],xI=["width","height"],SI=["fill"],MI=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,t=["left-top","right-top","left-bottom","right-bottom"],{w:n,h:i}=$1(e.chartConfig.attr),{colors:o,backgroundColor:a}=$1(e.chartConfig.option);return(s,c)=>(G(),h1("div",{class:"go-border-box",style:Z2(`box-shadow: inset 0 0 25px 3px ${u(o)[0]}`)},[(G(),h1("svg",{width:u(n),height:u(i)},[Q("polygon",{fill:u(a),points:`
4, 0 ${u(n)-4}, 0 ${u(n)}, 4 ${u(n)}, ${u(i)-4} ${u(n)-4}, ${u(i)}
4, ${u(i)} 0, ${u(i)-4} 0, 4
`},null,8,bI)],8,yI)),(G(),h1(F1,null,g2(t,f=>Q("svg",{width:u(n),height:u(i),key:f,class:h7(`border-item ${f}`)},[Q("polygon",{fill:u(o)[1],points:"40, 0 5, 0 0, 5 0, 16 3, 19 3, 7 7, 3 35, 3"},null,8,SI)],10,xI)),64))],4))}});const wI=F2(MI,[["__scopeId","data-v-37a601de"]]),AI=Object.freeze(Object.defineProperty({__proto__:null,default:wI},Symbol.toStringTag,{value:"Module"})),CI=["width","height"],TI=["stroke"],EI=["stroke","points"],DI=["stroke","points"],II=["stroke","points"],RI=["stroke"],OI=["stroke","points"],LI=["stroke","points"],PI=["stroke","points"],zI=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,{w:t,h:n}=$1(e.chartConfig.attr),{colors:i,backgroundColor:o}=$1(e.chartConfig.option);return(a,s)=>(G(),h1("div",{class:"go-border-box",style:Z2(`
box-shadow: inset 0 0 40px ${u(i)[0]};
border: 1px solid ${u(i)[1]};
background-color: ${u(o)};
`)},[(G(),h1("svg",{width:u(t),height:u(n)},[Q("polyline",{class:"go-border-line-w-2",stroke:u(i)[0],points:"0, 25 0, 0 25, 0"},null,8,TI),Q("polyline",{class:"go-border-line-w-2",stroke:u(i)[0],points:`${u(t)-25}, 0 ${u(t)}, 0 ${u(t)}, 25`},null,8,EI),Q("polyline",{class:"go-border-line-w-2",stroke:u(i)[0],points:`${u(t)-25}, ${u(n)} ${u(t)}, ${u(n)} ${u(t)}, ${u(n)-25}`},null,8,DI),Q("polyline",{class:"go-border-line-w-2",stroke:u(i)[0],points:`0, ${u(n)-25} 0, ${u(n)} 25, ${u(n)}`},null,8,II),Q("polyline",{class:"go-border-line-w-5",stroke:u(i)[1],points:"0, 10 0, 0 10, 0"},null,8,RI),Q("polyline",{class:"go-border-line-w-5",stroke:u(i)[1],points:`${u(t)-10}, 0 ${u(t)}, 0 ${u(t)}, 10`},null,8,OI),Q("polyline",{class:"go-border-line-w-5",stroke:u(i)[1],points:`${u(t)-10}, ${u(n)} ${u(t)}, ${u(n)} ${u(t)}, ${u(n)-10}`},null,8,LI),Q("polyline",{class:"go-border-line-w-5",stroke:u(i)[1],points:`0, ${u(n)-10} 0, ${u(n)} 10, ${u(n)}`},null,8,PI)],8,CI))],4))}});const kI=F2(zI,[["__scopeId","data-v-9d777740"]]),UI=Object.freeze(Object.defineProperty({__proto__:null,default:kI},Symbol.toStringTag,{value:"Module"})),Gh=r=>(r5("data-v-1e74db59"),r=r(),o5(),r),NI={class:"go-border-box"},FI=["width","height"],BI=Gh(()=>Q("animate",{attributeName:"x1",values:"0%;100%;0%",dur:"10s",begin:"0s",repeatCount:"indefinite"},null,-1)),GI=Gh(()=>Q("animate",{attributeName:"x2",values:"100%;0%;100%",dur:"10s",begin:"0s",repeatCount:"indefinite"},null,-1)),VI=["stop-color"],WI=["values"],jI=["stop-color"],HI=["values"],$I=["points"],YI=["points"],JI=["points"],ZI=["points"],XI=["points"],qI=["points"],QI=["points"],KI=["points"],eR=["points"],tR=["fill","points"],nR=["width","height","fill","mask"],iR=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,t=`border-box-07-filter-${g9()}`,n=`border-box-07-mask-${g9()}`,{w:i,h:o}=$1(e.chartConfig.attr),{colors:a,backgroundColor:s}=$1(e.chartConfig.option);return(c,f)=>(G(),h1("div",NI,[(G(),h1("svg",{width:u(i),height:u(o)},[Q("defs",null,[Q("linearGradient",{id:t,x1:"0%",y1:"0%",x2:"100%",y2:"100%"},[BI,GI,Q("stop",{offset:"0%","stop-color":u(a)[0]},[Q("animate",{attributeName:"stop-color",values:`${u(a)[0]};${u(a)[1]};${u(a)[0]}`,dur:"10s",begin:"0s",repeatCount:"indefinite"},null,8,WI)],8,VI),Q("stop",{offset:"100%","stop-color":u(a)[1]},[Q("animate",{attributeName:"stop-color",values:`${u(a)[1]};${u(a)[0]};${u(a)[1]}`,dur:"10s",begin:"0s",repeatCount:"indefinite"},null,8,HI)],8,jI)]),Q("mask",{id:n},[Q("polyline",{stroke:"#fff","stroke-width":"3",fill:"transparent",points:`8, ${u(o)*.4} 8, 3, ${u(i)*.4+7}, 3`},null,8,$I),Q("polyline",{fill:"#fff",points:`8, ${u(o)*.15} 8, 3, ${u(i)*.1+7}, 3
${u(i)*.1}, 8 14, 8 14, ${u(o)*.15-7}
`},null,8,YI),Q("polyline",{stroke:"#fff","stroke-width":"3",fill:"transparent",points:`${u(i)*.5}, 3 ${u(i)-3}, 3, ${u(i)-3}, ${u(o)*.25}`},null,8,JI),Q("polyline",{fill:"#fff",points:`
${u(i)*.52}, 3 ${u(i)*.58}, 3
${u(i)*.58-7}, 9 ${u(i)*.52+7}, 9
`},null,8,ZI),Q("polyline",{fill:"#fff",points:`
${u(i)*.9}, 3 ${u(i)-3}, 3 ${u(i)-3}, ${u(o)*.1}
${u(i)-9}, ${u(o)*.1-7} ${u(i)-9}, 9 ${u(i)*.9+7}, 9
`},null,8,XI),Q("polyline",{stroke:"#fff","stroke-width":"3",fill:"transparent",points:`8, ${u(o)*.5} 8, ${u(o)-3} ${u(i)*.3+7}, ${u(o)-3}`},null,8,qI),Q("polyline",{fill:"#fff",points:`
8, ${u(o)*.55} 8, ${u(o)*.7}
2, ${u(o)*.7-7} 2, ${u(o)*.55+7}
`},null,8,QI),Q("polyline",{stroke:"#fff","stroke-width":"3",fill:"transparent",points:`${u(i)*.35}, ${u(o)-3} ${u(i)-3}, ${u(o)-3} ${u(i)-3}, ${u(o)*.35}`},null,8,KI),Q("polyline",{fill:"#fff",points:`
${u(i)*.92}, ${u(o)-3} ${u(i)-3}, ${u(o)-3} ${u(i)-3}, ${u(o)*.8}
${u(i)-9}, ${u(o)*.8+7} ${u(i)-9}, ${u(o)-9} ${u(i)*.92+7}, ${u(o)-9}
`},null,8,eR)])]),Q("polygon",{fill:u(s),points:`
15, 9 ${u(i)*.1+1}, 9 ${u(i)*.1+4}, 6 ${u(i)*.52+2}, 6
${u(i)*.52+6}, 10 ${u(i)*.58-7}, 10 ${u(i)*.58-2}, 6
${u(i)*.9+2}, 6 ${u(i)*.9+6}, 10 ${u(i)-10}, 10 ${u(i)-10}, ${u(o)*.1-6}
${u(i)-6}, ${u(o)*.1-1} ${u(i)-6}, ${u(o)*.8+1} ${u(i)-10}, ${u(o)*.8+6}
${u(i)-10}, ${u(o)-10} ${u(i)*.92+7}, ${u(o)-10} ${u(i)*.92+2}, ${u(o)-6}
11, ${u(o)-6} 11, ${u(o)*.15-2} 15, ${u(o)*.15-7}
`},null,8,tR),Q("rect",{x:"0",y:"0",width:u(i),height:u(o),fill:`url(#${t})`,mask:`url(#${n})`},null,8,nR)],8,FI))]))}});const rR=F2(iR,[["__scopeId","data-v-1e74db59"]]),oR=Object.freeze(Object.defineProperty({__proto__:null,default:rR},Symbol.toStringTag,{value:"Module"})),Vh=r=>(r5("data-v-966367ac"),r=r(),o5(),r),aR={class:"go-border-box"},sR=["width","height"],lR=["d"],uR=Vh(()=>Q("stop",{offset:"0%","stop-color":"#fff","stop-opacity":"1"},null,-1)),cR=Vh(()=>Q("stop",{offset:"100%","stop-color":"#fff","stop-opacity":"0"},null,-1)),dR=[uR,cR],fR=["fill"],hR=["dur","path"],pR=["fill","points"],mR=["stroke","xlink:href"],gR=["stroke","xlink:href","mask"],_R=["from","to","dur"],vR=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,t=`border-box-08-path-${g9()}`,n=`border-box-08-gradient-${g9()}`,i=`border-box-08-mask-${g9()}`,{w:o,h:a}=$1(e.chartConfig.attr),{colors:s,dur:c,backgroundColor:f,reverse:h}=$1(e.chartConfig.option),m=I2(()=>(o.value+a.value-5)*2),g=I2(()=>h.value?`M 2.5, 2.5 L 2.5, ${a.value-2.5} L ${o.value-2.5}, ${a.value-2.5} L ${o.value-2.5}, 2.5 L 2.5, 2.5`:`M2.5, 2.5 L${o.value-2.5}, 2.5 L${o.value-2.5}, ${a.value-2.5} L2.5, ${a.value-2.5} L2.5, 2.5`);return(v,S)=>(G(),h1("div",aR,[(G(),h1("svg",{width:u(o),height:u(a)},[Q("defs",null,[Q("path",{id:t,d:g.value,fill:"transparent"},null,8,lR),Q("radialGradient",{id:n,cx:"50%",cy:"50%",r:"50%"},dR),Q("mask",{id:i},[Q("circle",{cx:"0",cy:"0",r:"150",fill:`url(#${n})`},[Q("animateMotion",{dur:`${u(c)}s`,path:g.value,rotate:"auto",repeatCount:"indefinite"},null,8,hR)],8,fR)])]),Q("polygon",{fill:u(f),points:`5, 5 ${u(o)-5}, 5 ${u(o)-5} ${u(a)-5} 5, ${u(a)-5}`},null,8,pR),Q("use",{stroke:u(s)[0],"stroke-width":"1","xlink:href":`#${t}`},null,8,mR),Q("use",{stroke:u(s)[1],"stroke-width":"3","xlink:href":`#${t}`,mask:`url(#${i})`},[Q("animate",{attributeName:"stroke-dasharray",from:`0, ${m.value}`,to:`${m.value}, 0`,dur:`${u(c)}s`,repeatCount:"indefinite"},null,8,_R)],8,gR)],8,sR))]))}});const yR=F2(vR,[["__scopeId","data-v-966367ac"]]),bR=Object.freeze(Object.defineProperty({__proto__:null,default:yR},Symbol.toStringTag,{value:"Module"})),xR={class:"go-border-box"},SR=["width","height"],MR=["fill","points"],wR=["fill"],AR=["fill","cx"],CR=["fill","cx","cy"],TR=["fill","cy"],ER=["stroke","points"],DR=["stroke","points"],IR=["stroke","points"],RR=["stroke","points"],OR=["stroke"],LR=["stroke"],PR=["stroke","points"],zR=["stroke","points"],kR=["stroke","points"],UR=["stroke","points"],NR=["stroke","points"],FR=["stroke","points"],BR=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,{w:t,h:n}=$1(e.chartConfig.attr),{colors:i,backgroundColor:o}=$1(e.chartConfig.option);return(a,s)=>(G(),h1("div",xR,[(G(),h1("svg",{width:u(t),height:u(n)},[Q("polygon",{fill:u(o),points:` 9, 7 ${u(t)-9}, 7 ${u(t)-9}, ${u(n)-7} 9, ${u(n)-7}`},null,8,MR),Q("circle",{fill:u(i)[1],cx:"5",cy:"5",r:"2"},null,8,wR),Q("circle",{fill:u(i)[1],cx:u(t)-5,cy:"5",r:"2"},null,8,AR),Q("circle",{fill:u(i)[1],cx:u(t)-5,cy:u(n)-5,r:"2"},null,8,CR),Q("circle",{fill:u(i)[1],cx:"5",cy:u(n)-5,r:"2"},null,8,TR),Q("polyline",{stroke:u(i)[0],points:`10, 4 ${u(t)-10}, 4`},null,8,ER),Q("polyline",{stroke:u(i)[0],points:`10, ${u(n)-4} ${u(t)-10}, ${u(n)-4}`},null,8,DR),Q("polyline",{stroke:u(i)[0],points:`5, 70 5, ${u(n)-70}`},null,8,IR),Q("polyline",{stroke:u(i)[0],points:`${u(t)-5}, 70 ${u(t)-5}, ${u(n)-70}`},null,8,RR),Q("polyline",{stroke:u(i)[0],points:"3, 10, 3, 50"},null,8,OR),Q("polyline",{stroke:u(i)[0],points:"7, 30 7, 80"},null,8,LR),Q("polyline",{stroke:u(i)[0],points:`${u(t)-3}, 10 ${u(t)-3}, 50`},null,8,PR),Q("polyline",{stroke:u(i)[0],points:`${u(t)-7}, 30 ${u(t)-7}, 80`},null,8,zR),Q("polyline",{stroke:u(i)[0],points:`3, ${u(n)-10} 3, ${u(n)-50}`},null,8,kR),Q("polyline",{stroke:u(i)[0],points:`7, ${u(n)-30} 7, ${u(n)-80}`},null,8,UR),Q("polyline",{stroke:u(i)[0],points:`${u(t)-3}, ${u(n)-10} ${u(t)-3}, ${u(n)-50}`},null,8,NR),Q("polyline",{stroke:u(i)[0],points:`${u(t)-7}, ${u(n)-30} ${u(t)-7}, ${u(n)-80}`},null,8,FR)],8,S
${u(t)-15}, 22 170, 22 150, 7 40, 7 28, 21 32, 24
16, 42 16, ${u(n)-32} 41, ${u(n)-7} ${u(t)-15}, ${u(n)-7}
`},null,8,HR),Q("polyline",{class:"go-border-line-1",stroke:u(i)[0],points:`145, ${u(n)-5} 40, ${u(n)-5} 10, ${u(n)-35}
10, 40 40, 5 150, 5 170, 20 ${u(t)-15}, 20`},null,8,$R),Q("polyline",{stroke:u(i)[1],class:"go-border-line-2",points:`245, ${u(n)-1} 36, ${u(n)-1} 14, ${u(n)-23}
14, ${u(n)-100}`},null,8,YR),Q("polyline",{class:"go-border-line-3",stroke:u(i)[0],points:`7, ${u(n)-40} 7, ${u(n)-75}`},null,8,JR),Q("polyline",{class:"go-border-line-4",stroke:u(i)[0],points:"28, 24 13, 41 13, 64"},null,8,ZR),Q("polyline",{class:"go-border-line-5",stroke:u(i)[0],points:"5, 45 5, 140"},null,8,XR),Q("polyline",{class:"go-border-line-6",stroke:u(i)[1],points:"14, 75 14, 180"},null,8,qR),Q("polyline",{class:"go-border-line-7",stroke:u(i)[1],points:"55, 11 147, 11 167, 26 250, 26"},null,8,QR),Q("polyline",{class:"go-border-line-8",stroke:u(i)[1],points:"158, 5 173, 16"},null,8,KR),Q("polyline",{class:"go-border-line-9",stroke:u(i)[0],points:`200, 17 ${u(t)-10}, 17`},null,8,eO),Q("polyline",{class:"go-border-line-10",stroke:u(i)[1],points:`385, 17 ${u(t)-10}, 17`},null,8,tO)],8,jR))]))}});const iO=F2(nO,[["__scopeId","data-v-03a8a229"]]),rO=Object.freeze(Object.defineProperty({__proto__:null,default:iO},Symbol.toStringTag,{value:"Module"})),oO={class:"go-border-box"},aO=["width","height"],sO=["fill","points"],lO=["stroke","points"],uO=["stroke","points"],cO=["stroke","points"],dO=["stroke","points"],fO=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,{w:t,h:n}=$1(e.chartConfig.attr),{colors:i,backgroundColor:o}=$1(e.chartConfig.option);return(a,s)=>(G(),h1("div",oO,[(G(),h1("svg",{class:"bv-border-svg-container",width:u(t),height:u(n)},[Q("polygon",{fill:u(o),points:`
23, 23 ${u(t)-24}, 23 ${u(t)-24}, ${u(n)-24} 23, ${u(n)-24}
`},null,8,sO),Q("polyline",{class:"go-border-line-1",stroke:u(i)[0],points:`4, 4 ${u(t)-22} ,4 ${u(t)-22}, ${u(n)-22} 4, ${u(n)-22} 4, 4`},null,8,lO),Q("polyline",{class:"go-border-line-3",stroke:u(i)[1],points:`10, 10 ${u(t)-16}, 10 ${u(t)-16}, ${u(n)-16} 10, ${u(n)-16} 10, 10`},null,8,uO),Q("polyline",{class:"go-border-line-3",stroke:u(i)[1],points:`16, 16 ${u(t)-10}, 16 ${u(t)-10}, ${u(n)-10} 16, ${u(n)-10} 16, 16`},null,8,cO),Q("polyline",{class:"go-border-line-3",stroke:u(i)[1],points:`22, 22 ${u(t)-4}, 22 ${u(t)-4}, ${u(n)-4} 22, ${u(n)-4} 22, 22`},null,8,dO)],8,aO))]))}});const hO=F2(fO,[["__scopeId","data-v-454ad1b3"]]),pO=Object.freeze(Object.defineProperty({__proto__:null,default:hO},Symbol.toStringTag,{value:"Module"})),mO={class:"go-border-box"},gO=["width","height"],_O=["fill","points"],vO=["stroke","points"],yO=["stroke","points"],bO=["stroke","points"],xO=["stroke","points"],SO=["stroke","points"],MO=["stroke","points"],wO=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,{w:t,h:n}=$1(e.chartConfig.attr),{colors:i,backgroundColor:o}=$1(e.chartConfig.option);return(a,s)=>(G(),h1("div",mO,[(G(),h1("svg",{width:u(t),height:u(n)},[Q("polygon",{fill:u(o),points:`
10, 22 ${u(t)-22}, 22 ${u(t)-22}, ${u(n)-86} ${u(t)-84}, ${u(n)-24} 10, ${u(n)-24}
`},null,8,_O),Q("polyline",{class:"bv-bb5-line-1",stroke:u(i)[0],points:`8, 5 ${u(t)-5}, 5 ${u(t)-5}, ${u(n)-100}
${u(t)-100}, ${u(n)-5} 8, ${u(n)-5} 8, 5`},null,8,vO),Q("polyline",{class:"bv-bb5-line-2",stroke:u(i)[1],points:`3, 5 ${u(t)-20}, 5 ${u(t)-20}, ${u(n)-60}
${u(t)-74}, ${u(n)-5} 3, ${u(n)-5} 3, 5`},null,8,yO),Q("polyline",{class:"bv-bb5-line-3",stroke:u(i)[1],points:`50, 13 ${u(t)-35}, 13`},null,8,bO),Q("polyline",{class:"bv-bb5-line-4",stroke:u(i)[1],points:`15, 20 ${u(t)-35}, 20`},null,8,xO),Q("polyline",{class:"bv-bb5-line-5",stroke:u(i)[1],points:`15, ${u(n)-20} ${u(t)-110}, ${u(n)-20}`},null,8,SO),Q("polyline",{class:"bv-bb5-line-6",stroke:u(i)[1],points:`15, ${u(n)-13} ${u(t)-110}, ${u(n)-13}`},null,8,MO)],8,gO))]))}});const AO=F2(wO,[["__scopeId","data-v-80c70916"]]),CO=Object.freeze(Object.defineProperty({__proto__:null,default:AO},Symbol.toStringTag,{value:"Module"})),TO={class:"go-border-box"},EO=["width","height"],DO=["fill","points"],IO=["stroke","points"],RO=["stroke","points"],OO=["fill"],LO=["fill","cx"],PO=["fill","cx","cy"],zO=["fill","cy"],kO=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,{w:t,h:n}=$1(e.chartConfig.attr),{colors:i,backgroundColor:o}=$1(e.chartConfig.option);return(a,s)=>(G(),h1("div",TO,[(G(),h1("svg",{width:u(t),height:u(n)},[Q("polygon",{fill:u(o),points:`
7, 7 ${u(t)-7}, 7 ${u(t)-7}, ${u(n)-7} 7, ${u(n)-7}
`},null,8,DO),Q("polyline",{stroke:u(i)[0],points:`2, 2 ${u(t)-2} ,2 ${u(t)-2}, ${u(n)-2} 2, ${u(n)-2} 2, 2`},null,8,IO),Q("polyline",{stroke:u(i)[1],points:`6, 6 ${u(t)-6}, 6 ${u(t)-6}, ${u(n)-6} 6, ${u(n)-6} 6, 6`},null,8,RO),Q("circle",{fill:u(i)[0],cx:"11",cy:"11",r:"1"},null,8,OO),Q("circle",{fill:u(i)[0],cx:u(t)-11,cy:"11",r:"1"},null,8,LO),Q("circle",{fill:u(i)[0],cx:u(t)-11,cy:u(n)-11,r:"1"},null,8,PO),Q("circle",{fill:u(i)[0],cx:"11",cy:u(n)-11,r:"1"},null,8,zO)],8,EO))]))}});const UO=F2(kO,[["__scopeId","data-v-e5e18ea8"]]),NO=Object.freeze(Object.defineProperty({__proto__:null,default:UO},Symbol.toStringTag,{value:"Module"})),FO=["width","height"],BO=["x","y","width","height","fill"],GO=["to","dur"],VO=["x","y","width","height","fill"],WO=["to","dur"],jO=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,{w:t,h:n}=$1(e.chartConfig.attr),{colors:i,dur:o,endWidth:a,lineHeight:s}=$1(e.chartConfig.option),c=I2(()=>0),f=I2(()=>n.value/2);return(h,m)=>(G(),h1("svg",{width:u(t),height:u(n)},[Q("rect",{x:c.value,y:f.value,width:u(t),height:u(s),fill:u(i)[0]},[Q("animate",{attributeName:"width",from:"0",to:u(t),dur:`${u(o)}s`,calcMode:"spline",keyTimes:"0;1",keySplines:".42,0,.58,1",repeatCount:"indefinite"},null,8,GO)],8,BO),Q("rect",{x:c.value,y:f.value,width:u(a),height:u(s),fill:u(i)[1]},[Q("animate",{attributeName:"x",from:"0",to:u(t),dur:`${u(o)}s`,calcMode:"spline",keyTimes:"0;1",keySplines:"0.42,0,0.58,1",repeatCount:"indefinite"},null,8,WO)],8,VO)],8,FO))}}),HO=Object.freeze(Object.defineProperty({__proto__:null,default:jO},Symbol.toStringTag,{value:"Module"})),$O=["width"],YO=["stroke","points"],JO=["stroke","points"],ZO=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,{w:t,h:n}=$1(e.chartConfig.attr),{colors:i,dur:o,lineHeight:a}=$1(e.chartConfig.option);return(s,c)=>(G(),h1("div",{class:"go-decorates-2",style:Z2(`width:${u(t)}px; height: ${u(a)}px animation-duration:${u(o)}s`)},[(G(),h1("svg",{width:u(t),height:3},[Q("polyline",{stroke:u(i)[0],points:`0, 2.5 ${u(t)}, 2.5`},null,8,YO),Q("polyline",{stroke:u(i)[1],"stroke-width":"3","stroke-dasharray":"20, 80","stroke-dashoffset":"-30",points:`0, 2.5 ${u(t)}, 2.5`},null,8,JO)],8,$O))],4))}});const XO=F2(ZO,[["__scopeId","data-v-bf54f1e3"]]),qO=Object.freeze(Object.defineProperty({__proto__:null,default:XO},Symbol.toStringTag,{value:"Module"})),QO={width:20,height:20},KO=["stroke"],eL=["stroke"],tL={width:20,height:20},nL=["stroke"],iL=["stroke"],rL=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,{w:t,h:n}=$1(e.chartConfig.attr),{colors:i,dataset:o,textSize:a,textColor:s}=$1(e.chartConfig.option);return(c,f)=>(G(),h1("div",{class:"go-border-03",style:Z2(`width: ${u(t)}px; height: ${u(n)}px`)},[(G(),h1("svg",QO,[Q("polyline",{"stroke-width":"4",fill:"transparent",stroke:u(i)[0],points:"10, 0 19, 10 10, 20"},null,8,KO),Q("polyline",{"stroke-width":"2",fill:"transparent",stroke:u(i)[1],points:"2, 0 11, 10 2, 20"},null,8,eL)])),Q("span",{style:Z2(`color: ${u(s)};font-size: ${u(a)}px`)},w3(u(o)),5),(G(),h1("svg",tL,[Q("polyline",{"stroke-width":"4",fill:"transparent",stroke:u(i)[0],points:"11, 0 2, 10 11, 20"},null,8,nL),Q("polyline",{"stroke-width":"2",fill:"transparent",stroke:u(i)[1],points:"19, 0 10, 10 19, 20"},null,8,iL)]))],4))}});const oL=F2(rL,[["__scopeId","data-v-a4359992"]]),aL=Object.freeze(Object.defineProperty({__proto__:null,default:oL},Symbol.toStringTag,{value:"Module"})),sL={class:"go-border-04"},lL=["width","height"],uL=["stroke","points"],cL=["stroke","points"],dL=["stroke","points"],fL=S1({__name:"index",props:{chartConfig:{type:Object,required:!0}},setup(r){const e=r,{w:t,h:n}=$1(e.chartConfig.attr),{colors:i,reverse:o}=$1(e.chartConfig.option),a=s=>o.value?t.value-s:s;return(s,c)=>(G(),h1("div",sL,[(G(),h1("svg",{width:u(t),height:u(n)},[Q("polyline",{stroke:u(i)[0],"stroke-width":"2",fill:"transparent",points:`${a(0)}, 0 ${a(30)}, ${u(n)/2}`},null,8,uL),Q("polyline",{stroke:u(i)[0],"stroke-width":"2",fill:"transparent",points:`${a(
letter-spacing:${u(g)}px;font-weight:${u(v)};
text-shadow: ${u(o)}`)},w3(u(i)),5)],4))}});const ZP=F2(JP,[["__scopeId","data-v-c7a246c7"]]),XP=Object.freeze(Object.defineProperty({__proto__:null,default:ZP},Symbol.toStringTag,{value:"Module"}));/**
* @license
* Copyright 2010-2022 Three.js Authors
* SPDX-License-Identifier: MIT
*/const Ca="145",f8={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},h8={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},qP=0,zc=1,QP=2,Wh=1,KP=2,V6=3,X8=0,h0=1,G0=2,X9=0,O5=1,kc=2,Uc=3,Nc=4,ez=5,z8=100,tz=101,nz=102,Fc=103,Bc=104,iz=200,rz=201,oz=202,az=203,jh=204,Hh=205,sz=206,lz=207,uz=208,cz=209,dz=210,fz=0,hz=1,pz=2,jr=3,mz=4,gz=5,_z=6,vz=7,$h=0,yz=1,bz=2,_9=0,xz=1,Sz=2,Mz=3,wz=4,Az=5,Yh=300,q8=301,Q8=302,Hr=303,$r=304,xt=306,Yr=1e3,D0=1001,Jr=1002,C4=1003,Gc=1004,Vc=1005,a0=1006,Cz=1007,St=1008,F5=1009,Tz=1010,Ez=1011,Jh=1012,Dz=1013,T5=1014,E5=1015,e7=1016,Iz=1017,Rz=1018,$8=1020,Oz=1021,Lz=1022,V0=1023,Pz=1024,zz=1025,L5=1026,K8=1027,kz=1028,Uz=1029,Nz=1030,Fz=1031,Bz=1033,Xn=33776,qn=33777,Qn=33778,Kn=33779,Wc=35840,jc=35841,Hc=35842,$c=35843,Gz=36196,Yc=37492,Jc=37496,Zc=37808,Xc=37809,qc=37810,Qc=37811,Kc=37812,ed=37813,td=37814,nd=37815,id=37816,rd=37817,od=37818,ad=37819,sd=37820,ld=37821,ud=36492,B5=3e3,M3=3001,Vz=3200,Wz=3201,jz=0,Hz=1,d9="srgb",D5="srgb-linear",ei=7680,$z=519,Zr=35044,cd="300 es",Xr=1035;class H5{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const o=i.indexOf(t);o!==-1&&i.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let o=0,a=i.length;o<a;o++)i[o].call(this,e);e.target=null}}}const o4=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],ti=Math.PI/180,dd=180/Math.PI;function q9(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(o4[r&255]+o4[r>>8&255]+o4[r>>16&255]+o4[r>>24&255]+"-"+o4[e&255]+o4[e>>8&255]+"-"+o4[e>>16&15|64]+o4[e>>24&255]+"-"+o4[t&63|128]+o4[t>>8&255]+"-"+o4[t>>16&255]+o4[t>>24&255]+o4[n&255]+o4[n>>8&255]+o4[n>>16&255]+o4[n>>24&255]).toLowerCase()}function s4(r,e,t){return Math.max(e,Math.min(t,r))}function Yz(r,e){return(r%e+e)%e}function ni(r,e,t){return(1-t)*r+t*e}function fd(r){return(r&r-1)===0&&r!==0}function qr(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $9(r,e){switch(e.constructor){case Float32Array:return r;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function l3(r,e){switch(e.constructor){case Float32Array:return r;case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);d
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,uk=`void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class y9 extends $5{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=lk,this.fragmentShader=uk,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=e6(e.uniforms),this.uniformsGroups=ak(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?t.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[i]={type:"m4",value:a.toArray()}:t.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class ip extends u4{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new R3,this.projectionMatrix=new R3,this.projectionMatrixInverse=new R3}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class s0 extends ip{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=dd*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ti*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return dd*2*Math.atan(Math.tan(ti*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,o,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ti*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const c=a.
varying vec3 vWorldDirection;
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}
`,fragmentShader:`
uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
}
`},i=new _7(5,5,5),o=new y9({name:"CubemapFromEquirect",uniforms:e6(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:h0,blending:X9});o.uniforms.tEquirect.value=t;const a=new e4(i,o),s=t.minFilter;return t.minFilter===St&&(t.minFilter=a0),new ck(1,10,this).update(e,a),t.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,i){const o=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(o)}}const Mi=new t1,fk=new t1,hk=new l0;class S5{constructor(e=new t1(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Mi.subVectors(n,t).cross(fk.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(Mi),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:t.copy(n).multiplyScalar(o).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||hk.getNormalMatrix(e),i=this.coplanarPoint(Mi).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const C8=new m7,Le=new t1;class op{constructor(e=new S5,t=new S5,n=new S5,i=new S5,o=new S5,a=new S5){this.planes=[e,t,n,i,o,a]}set(e,t,n,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(i),s[4].copy(o),s[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,i=n[0],o=n[1],a=n[2],s=n[3],c=n[4],f=n[5],h=n[6],m=n[7],g=n[8],v=n[9],S=n[10],_=n[11],x=n[12],M=n[13],A=n[14],D=n[15];return t[0].setComponents(s-i,m-c,_-g,D-x).normalize(),t[1].setComponents(s+i,m+c,_+g,D+x).normalize(),t[2].setComponents(s+o,m+f,_+v,D+M).normalize(),t[3].setComponents(s-o,m-f,_-v,D-M).normalize(),t[4].setComponents(s-a,m-h,_-S,D-A).normalize(),t[5].setComponents(s+a,m+h,_+S,D+A).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),C8.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(C8)}intersectsSprite(e){return C8.center.set(0,0,0),C8.radius=.7071067811865476,C8.applyMatrix4(e.matrixWorld),this.intersectsSphere(C8)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Le.x=i.normal.x>0?e.max.x:e.min.x,Le.y=i.normal.y>0?e.max.y:e.min.y,Le.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Le)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function ap(){let r=null,e=!1,t=null,n=null;function i(o,a){t(o,a),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=
diffuseColor.a *= texture2D( alphaMap, vUv ).g;
#endif`,gk=`#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`,_k=`#ifdef USE_ALPHATEST
if ( diffuseColor.a < alphaTest ) discard;
#endif`,vk=`#ifdef USE_ALPHATEST
uniform float alphaTest;
#endif`,yk=`#ifdef USE_AOMAP
float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
reflectedLight.indirectDiffuse *= ambientOcclusion;
#if defined( USE_ENVMAP ) && defined( STANDARD )
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
#endif
#endif`,bk=`#ifdef USE_AOMAP
uniform sampler2D aoMap;
uniform float aoMapIntensity;
#endif`,xk="vec3 transformed = vec3( position );",Sk=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
vec3 objectTangent = vec3( tangent.xyz );
#endif`,Mk=`vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
float x2 = x * x;
float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
}
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
float a2 = pow2( alpha );
float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
float a2 = pow2( alpha );
float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
return RECIPROCAL_PI * a2 / pow2( denom );
}
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {
float alpha = pow2( roughness );
vec3 halfDir = normalize( lightDir + viewDir );
float dotNL = saturate( dot( normal, lightDir ) );
float dotNV = saturate( dot( normal, viewDir ) );
float dotNH = saturate( dot( normal, halfDir ) );
float dotVH = saturate( dot( viewDir, halfDir ) );
vec3 F = F_Schlick( f0, f90, dotVH );
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
float D = D_GGX( alpha, dotNH );
return F * ( V * D );
}
#ifdef USE_IRIDESCENCE
vec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {
float alpha = pow2( roughness );
vec3 halfDir = normalize( lightDir + viewDir );
float dotNL = saturate( dot( normal, lightDir ) );
float dotNV = saturate( dot( normal, viewDir ) );
float dotNH = saturate( dot( normal, halfDir ) );
float dotVH = saturate( dot( viewDir, halfDir ) );
vec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
float D = D_GGX( alpha, dotNH );
return F * ( V * D );
}
#endif
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
const float LUT_SIZE = 64.0;
const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
const float LUT_BIAS = 0.5 / LUT_SIZE;
float dotNV = saturate( dot( N, V ) );
vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
uv = uv * LUT_SCALE + LUT_BIAS;
return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
float l = length( f );
return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
float x = dot( v1, v2 );
float y = abs( x );
float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
float b = 3.4175940 + ( 4.1616724 + y ) * y;
float v = a / b;
float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
vec3 lightNormal = cross( v1, v2 );
if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
vec3 T1, T2;
T1 = normalize( V - N * dot( V, N ) );
T2 = - cross( N, T1 );
mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
vec3 coords[ 4 ];
coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
coords[ 0 ] = normalize( coords[ 0 ] );
coords[ 1 ] = normalize( coords[ 1 ] );
coords[ 2 ] = normalize( coords[ 2 ] );
coords[ 3 ] = normalize( coords[ 3 ] );
vec3 vectorFormFactor = vec3( 0.0 );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
return vec3( result );
}
float G_BlinnPhong_Implicit( ) {
return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
vec3 halfDir = normalize( lightDir + viewDir );
float dotNH = saturate( dot( normal, halfDir ) );
float dotVH = saturate( dot( viewDir, halfDir ) );
vec3 F = F_Schlick( specularColor, 1.0, dotVH );
float G = G_BlinnPhong_Implicit( );
float D = D_BlinnPhong( shininess, dotNH );
return F * ( G * D );
}
#if defined( USE_SHEEN )
float D_Charlie( float roughness, float dotNH ) {
float alpha = pow2( roughness );
float invAlpha = 1.0 / alpha;
float cos2h = dotNH * dotNH;
float sin2h = max( 1.0 - cos2h, 0.0078125 );
return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
}
float V_Neubelt( float dotNV, float dotNL ) {
return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
}
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
vec3 halfDir = normalize( lightDir + viewDir );
float dotNL = saturate( dot( normal, lightDir ) );
float dotNV = saturate( dot( normal, viewDir ) );
float dotNH = saturate( dot( normal, halfDir ) );
float D = D_Charlie( sheenRoughness, dotNH );
float V = V_Neubelt( dotNV, dotNL );
return sheenColor * ( D * V );
}
#endif`,wk=`#ifdef USE_IRIDESCENCE
const mat3 XYZ_TO_REC709 = mat3(
3.2404542, -0.9692660, 0.0556434,
-1.5371385, 1.8760108, -0.2040259,
-0.4985314, 0.0415560, 1.0572252
);
vec3 Fresnel0ToIor( vec3 fresnel0 ) {
vec3 sqrtF0 = sqrt( fresnel0 );
return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
}
vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
}
float IorToFresnel0( float transmittedIor, float incidentIor ) {
return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
}
vec3 evalSensitivity( float OPD, vec3 shift ) {
float phase = 2.0 * PI * OPD * 1.0e-9;
vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
xyz /= 1.0685e-7;
vec3 rgb = XYZ_TO_REC709 * xyz;
return rgb;
}
vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
vec3 I;
float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
float cosTheta2Sq = 1.0 - sinTheta2Sq;
if ( cosTheta2Sq < 0.0 ) {
return vec3( 1.0 );
}
float cosTheta2 = sqrt( cosTheta2Sq );
float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
float R12 = F_Schlick( R0, 1.0, cosTheta1 );
float R21 = R12;
float T121 = 1.0 - R12;
float phi12 = 0.0;
if ( iridescenceIOR < outsideIOR ) phi12 = PI;
float phi21 = PI - phi12;
vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
vec3 phi23 = vec3( 0.0 );
if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
vec3 phi = vec3( phi21 ) + phi23;
vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
vec3 r123 = sqrt( R123 );
vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
vec3 C0 = R12 + Rs;
I = C0;
vec3 Cm = Rs - T121;
for ( int m = 1; m <= 2; ++ m ) {
Cm *= r123;
vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
I += Cm * Sm;
}
return max( I, vec3( 0.0 ) );
}
#endif`,Ak=`#ifdef USE_BUMPMAP
uniform sampler2D bumpMap;
uniform float bumpScale;
vec2 dHdxy_fwd() {
vec2 dSTdx = dFdx( vUv );
vec2 dSTdy = dFdy( vUv );
float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
return vec2( dBx, dBy );
}
vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
vec3 vSigmaX = dFdx( surf_pos.xyz );
vec3 vSigmaY = dFdy( surf_pos.xyz );
vec3 vN = surf_norm;
vec3 R1 = cross( vSigmaY, vN );
vec3 R2 = cross( vN, vSigmaX );
float fDet = dot( vSigmaX, R1 ) * faceDirection;
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
return normalize( abs( fDet ) * surf_norm - vGrad );
}
#endif`,Ck=`#if NUM_CLIPPING_PLANES > 0
vec4 plane;
#pragma unroll_loop_start
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
}
#pragma unroll_loop_end
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
bool clipped = true;
#pragma unroll_loop_start
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
}
#pragma unroll_loop_end
if ( clipped ) discard;
#endif
#endif`,Tk=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,Ek=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
#endif`,Dk=`#if NUM_CLIPPING_PLANES > 0
vClipPosition = - mvPosition.xyz;
#endif`,Ik=`#if defined( USE_COLOR_ALPHA )
diffuseColor *= vColor;
#elif defined( USE_COLOR )
diffuseColor.rgb *= vColor;
#endif`,Rk=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR )
varying vec3 vColor;
#endif`,Ok=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
varying vec3 vColor;
#endif`,Lk=`#if defined( USE_COLOR_ALPHA )
vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
vColor.xyz *= instanceColor.xyz;
#endif`,Pk=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
const highp float a = 12.9898, b = 78.233, c = 43758.5453;
highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
float precisionSafeLength( vec3 v ) { return length( v ); }
#else
float precisionSafeLength( vec3 v ) {
float maxComponent = max3( abs( v ) );
return length( v / maxComponent ) * maxComponent;
}
#endif
struct IncidentLight {
vec3 color;
vec3 direction;
bool visible;
};
struct ReflectedLight {
vec3 directDiffuse;
vec3 directSpecular;
vec3 indirectDiffuse;
vec3 indirectSpecular;
};
struct GeometricContext {
vec3 position;
vec3 normal;
vec3 viewDir;
#ifdef USE_CLEARCOAT
vec3 clearcoatNormal;
#endif
};
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
mat3 transposeMat3( const in mat3 m ) {
mat3 tmp;
tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
return tmp;
}
float luminance( const in vec3 rgb ) {
const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );
return dot( weights, rgb );
}
bool isPerspectiveMatrix( mat4 m ) {
return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
return vec2( u, v );
}`,zk=`#ifdef ENVMAP_TYPE_CUBE_UV
#define cubeUV_minMipLevel 4.0
#define cubeUV_minTileSize 16.0
float getFace( vec3 direction ) {
vec3 absDirection = abs( direction );
float face = - 1.0;
if ( absDirection.x > absDirection.z ) {
if ( absDirection.x > absDirection.y )
face = direction.x > 0.0 ? 0.0 : 3.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
} else {
if ( absDirection.z > absDirection.y )
face = direction.z > 0.0 ? 2.0 : 5.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
}
return face;
}
vec2 getUV( vec3 direction, float face ) {
vec2 uv;
if ( face == 0.0 ) {
uv = vec2( direction.z, direction.y ) / abs( direction.x );
} else if ( face == 1.0 ) {
uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
} else if ( face == 2.0 ) {
uv = vec2( - direction.x, direction.y ) / abs( direction.z );
} else if ( face == 3.0 ) {
uv = vec2( - direction.z, direction.y ) / abs( direction.x );
} else if ( face == 4.0 ) {
uv = vec2( - direction.x, direction.z ) / abs( direction.y );
} else {
uv = vec2( direction.x, direction.y ) / abs( direction.z );
}
return 0.5 * ( uv + 1.0 );
}
vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
float face = getFace( direction );
float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
mipInt = max( mipInt, cubeUV_minMipLevel );
float faceSize = exp2( mipInt );
vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
if ( face > 2.0 ) {
uv.y += faceSize;
face -= 3.0;
}
uv.x += face * faceSize;
uv.x += filterInt * 3.0 * cubeUV_minTileSize;
uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
uv.x *= CUBEUV_TEXEL_WIDTH;
uv.y *= CUBEUV_TEXEL_HEIGHT;
#ifdef texture2DGradEXT
return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
#else
return texture2D( envMap, uv ).rgb;
#endif
}
#define cubeUV_r0 1.0
#define cubeUV_v0 0.339
#define cubeUV_m0 - 2.0
#define cubeUV_r1 0.8
#define cubeUV_v1 0.276
#define cubeUV_m1 - 1.0
#define cubeUV_r4 0.4
#define cubeUV_v4 0.046
#define cubeUV_m4 2.0
#define cubeUV_r5 0.305
#define cubeUV_v5 0.016
#define cubeUV_m5 3.0
#define cubeUV_r6 0.21
#define cubeUV_v6 0.0038
#define cubeUV_m6 4.0
float roughnessToMip( float roughness ) {
float mip = 0.0;
if ( roughness >= cubeUV_r1 ) {
mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
} else if ( roughness >= cubeUV_r4 ) {
mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
} else if ( roughness >= cubeUV_r5 ) {
mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
} else if ( roughness >= cubeUV_r6 ) {
mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
} else {
mip = - 2.0 * log2( 1.16 * roughness ); }
return mip;
}
vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
float mipF = fract( mip );
float mipInt = floor( mip );
vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
if ( mipF == 0.0 ) {
return vec4( color0, 1.0 );
} else {
vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
return vec4( mix( color0, color1, mipF ), 1.0 );
}
}
#endif`,kk=`vec3 transformedNormal = objectNormal;
#ifdef USE_INSTANCING
mat3 m = mat3( instanceMatrix );
transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
transformedNormal = m * transformedNormal;
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
#ifdef FLIP_SIDED
transformedTangent = - transformedTangent;
#endif
#endif`,Uk=`#ifdef USE_DISPLACEMENTMAP
uniform sampler2D displacementMap;
uniform float displacementScale;
uniform float displacementBias;
#endif`,Nk=`#ifdef USE_DISPLACEMENTMAP
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
#endif`,Fk=`#ifdef USE_EMISSIVEMAP
vec4 emissiveColor = texture2D( emissiveMap, vUv );
totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,Bk=`#ifdef USE_EMISSIVEMAP
uniform sampler2D emissiveMap;
#endif`,Gk="gl_FragColor = linearToOutputTexel( gl_FragColor );",Vk=`vec4 LinearToLinear( in vec4 value ) {
return value;
}
vec4 LinearTosRGB( in vec4 value ) {
return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}`,Wk=`#ifdef USE_ENVMAP
#ifdef ENV_WORLDPOS
vec3 cameraToFrag;
if ( isOrthographic ) {
cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
} else {
cameraToFrag = normalize( vWorldPosition - cameraPosition );
}
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
#ifdef ENVMAP_MODE_REFLECTION
vec3 reflectVec = reflect( cameraToFrag, worldNormal );
#else
vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
#endif
#else
vec3 reflectVec = vReflect;
#endif
#ifdef ENVMAP_TYPE_CUBE
vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
#elif defined( ENVMAP_TYPE_CUBE_UV )
vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );
#else
vec4 envColor = vec4( 0.0 );
#endif
#ifdef ENVMAP_BLENDING_MULTIPLY
outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
#elif defined( ENVMAP_BLENDING_MIX )
outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
#elif defined( ENVMAP_BLENDING_ADD )
outgoingLight += envColor.xyz * specularStrength * reflectivity;
#endif
#endif`,jk=`#ifdef USE_ENVMAP
uniform float envMapIntensity;
uniform float flipEnvMap;
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#else
uniform sampler2D envMap;
#endif
#endif`,Hk=`#ifdef USE_ENVMAP
uniform float reflectivity;
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
#define ENV_WORLDPOS
#endif
#ifdef ENV_WORLDPOS
varying vec3 vWorldPosition;
uniform float refractionRatio;
#else
varying vec3 vReflect;
#endif
#endif`,$k=`#ifdef USE_ENVMAP
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
#define ENV_WORLDPOS
#endif
#ifdef ENV_WORLDPOS
varying vec3 vWorldPosition;
#else
varying vec3 vReflect;
uniform float refractionRatio;
#endif
#endif`,Yk=`#ifdef USE_ENVMAP
#ifdef ENV_WORLDPOS
vWorldPosition = worldPosition.xyz;
#else
vec3 cameraToVertex;
if ( isOrthographic ) {
cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
} else {
cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
}
vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
#ifdef ENVMAP_MODE_REFLECTION
vReflect = reflect( cameraToVertex, worldNormal );
#else
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
#endif
#endif
#endif`,Jk=`#ifdef USE_FOG
vFogDepth = - mvPosition.z;
#endif`,Zk=`#ifdef USE_FOG
varying float vFogDepth;
#endif`,Xk=`#ifdef USE_FOG
#ifdef FOG_EXP2
float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
#else
float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
#endif
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif`,qk=`#ifdef USE_FOG
uniform vec3 fogColor;
varying float vFogDepth;
#ifdef FOG_EXP2
uniform float fogDensity;
#else
uniform float fogNear;
uniform float fogFar;
#endif
#endif`,Qk=`#ifdef USE_GRADIENTMAP
uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
float dotNL = dot( normal, lightDirection );
vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
#ifdef USE_GRADIENTMAP
return vec3( texture2D( gradientMap, coord ).r );
#else
vec2 fw = fwidth( coord ) * 0.5;
return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
#endif
}`,Kk=`#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vUv2 );
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
reflectedLight.indirectDiffuse += lightMapIrradiance;
#endif`,eU=`#ifdef USE_LIGHTMAP
uniform sampler2D lightMap;
uniform float lightMapIntensity;
#endif`,tU=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,nU=`varying vec3 vViewPosition;
struct LambertMaterial {
vec3 diffuseColor;
float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_Lambert
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert
#define Material_LightProbeLOD( material ) (0)`,iU=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
uniform vec3 lightProbe[ 9 ];
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
float x = normal.x, y = normal.y, z = normal.z;
vec3 result = shCoefficients[ 0 ] * 0.886227;
result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
vec3 irradiance = ambientLightColor;
return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
#if defined ( PHYSICALLY_CORRECT_LIGHTS )
float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
if ( cutoffDistance > 0.0 ) {
distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
}
return distanceFalloff;
#else
if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
}
return 1.0;
#endif
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
struct DirectionalLight {
vec3 direction;
vec3 color;
};
uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {
light.color = directionalLight.color;
light.direction = directionalLight.direction;
light.visible = true;
}
#endif
#if NUM_POINT_LIGHTS > 0
struct PointLight {
vec3 position;
vec3 color;
float distance;
float decay;
};
uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {
vec3 lVector = pointLight.position - geometry.position;
light.direction = normalize( lVector );
float lightDistance = length( lVector );
light.color = pointLight.color;
light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
light.visible = ( light.color != vec3( 0.0 ) );
}
#endif
#if NUM_SPOT_LIGHTS > 0
struct SpotLight {
vec3 position;
vec3 direction;
vec3 color;
float distance;
float decay;
float coneCos;
float penumbraCos;
};
uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {
vec3 lVector = spotLight.position - geometry.position;
light.direction = normalize( lVector );
float angleCos = dot( light.direction, spotLight.direction );
float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
if ( spotAttenuation > 0.0 ) {
float lightDistance = length( lVector );
light.color = spotLight.color * spotAttenuation;
light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
light.visible = ( light.color != vec3( 0.0 ) );
} else {
light.color = vec3( 0.0 );
light.visible = false;
}
}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
struct RectAreaLight {
vec3 color;
vec3 position;
vec3 halfWidth;
vec3 halfHeight;
};
uniform sampler2D ltc_1; uniform sampler2D ltc_2;
uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
struct HemisphereLight {
vec3 direction;
vec3 skyColor;
vec3 groundColor;
};
uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
float dotNL = dot( normal, hemiLight.direction );
float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
return irradiance;
}
#endif`,rU=`#if defined( USE_ENVMAP )
vec3 getIBLIrradiance( const in vec3 normal ) {
#if defined( ENVMAP_TYPE_CUBE_UV )
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );
return PI * envMapColor.rgb * envMapIntensity;
#else
return vec3( 0.0 );
#endif
}
vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
#if defined( ENVMAP_TYPE_CUBE_UV )
vec3 reflectVec = reflect( - viewDir, normal );
reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );
return envMapColor.rgb * envMapIntensity;
#else
return vec3( 0.0 );
#endif
}
#endif`,oU=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,aU=`varying vec3 vViewPosition;
struct ToonMaterial {
vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_Toon
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon
#define Material_LightProbeLOD( material ) (0)`,sU=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,lU=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
vec3 diffuseColor;
vec3 specularColor;
float specularShininess;
float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_BlinnPhong
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong
#define Material_LightProbeLOD( material ) (0)`,uU=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
material.ior = ior;
#ifdef SPECULAR
float specularIntensityFactor = specularIntensity;
vec3 specularColorFactor = specularColor;
#ifdef USE_SPECULARINTENSITYMAP
specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;
#endif
#ifdef USE_SPECULARCOLORMAP
specularColorFactor *= texture2D( specularColorMap, vUv ).rgb;
#endif
material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
#else
float specularIntensityFactor = 1.0;
vec3 specularColorFactor = vec3( 1.0 );
material.specularF90 = 1.0;
#endif
material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
material.specularF90 = 1.0;
#endif
#ifdef USE_CLEARCOAT
material.clearcoat = clearcoat;
material.clearcoatRoughness = clearcoatRoughness;
material.clearcoatF0 = vec3( 0.04 );
material.clearcoatF90 = 1.0;
#ifdef USE_CLEARCOATMAP
material.clearcoat *= texture2D( clearcoatMap, vUv ).x;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;
#endif
material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
material.clearcoatRoughness += geometryRoughness;
material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_IRIDESCENCE
material.iridescence = iridescence;
material.iridescenceIOR = iridescenceIOR;
#ifdef USE_IRIDESCENCEMAP
material.iridescence *= texture2D( iridescenceMap, vUv ).r;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;
#else
material.iridescenceThickness = iridescenceThicknessMaximum;
#endif
#endif
#ifdef USE_SHEEN
material.sheenColor = sheenColor;
#ifdef USE_SHEENCOLORMAP
material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;
#endif
material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
#ifdef USE_SHEENROUGHNESSMAP
material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;
#endif
#endif`,cU=`struct PhysicalMaterial {
vec3 diffuseColor;
float roughness;
vec3 specularColor;
float specularF90;
#ifdef USE_CLEARCOAT
float clearcoat;
float clearcoatRoughness;
vec3 clearcoatF0;
float clearcoatF90;
#endif
#ifdef USE_IRIDESCENCE
float iridescence;
float iridescenceIOR;
float iridescenceThickness;
vec3 iridescenceFresnel;
vec3 iridescenceF0;
#endif
#ifdef USE_SHEEN
vec3 sheenColor;
float sheenRoughness;
#endif
#ifdef IOR
float ior;
#endif
#ifdef USE_TRANSMISSION
float transmission;
float transmissionAlpha;
float thickness;
float attenuationDistance;
vec3 attenuationColor;
#endif
};
vec3 clearcoatSpecular = vec3( 0.0 );
vec3 sheenSpecular = vec3( 0.0 );
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
float dotNV = saturate( dot( normal, viewDir ) );
float r2 = roughness * roughness;
float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
return saturate( DG * RECIPROCAL_PI );
}
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
float dotNV = saturate( dot( normal, viewDir ) );
const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
vec4 r = roughness * c0 + c1;
float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
vec2 fab = DFGApprox( normal, viewDir, roughness );
return specularColor * fab.x + specularF90 * fab.y;
}
#ifdef USE_IRIDESCENCE
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#else
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#endif
vec2 fab = DFGApprox( normal, viewDir, roughness );
#ifdef USE_IRIDESCENCE
vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
#else
vec3 Fr = specularColor;
#endif
vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
float Ess = fab.x + fab.y;
float Ems = 1.0 - Ess;
vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
singleScatter += FssEss;
multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
vec3 normal = geometry.normal;
vec3 viewDir = geometry.viewDir;
vec3 position = geometry.position;
vec3 lightPos = rectAreaLight.position;
vec3 halfWidth = rectAreaLight.halfWidth;
vec3 halfHeight = rectAreaLight.halfHeight;
vec3 lightColor = rectAreaLight.color;
float roughness = material.roughness;
vec3 rectCoords[ 4 ];
rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
vec2 uv = LTC_Uv( normal, viewDir, roughness );
vec4 t1 = texture2D( ltc_1, uv );
vec4 t2 = texture2D( ltc_2, uv );
mat3 mInv = mat3(
vec3( t1.x, 0, t1.y ),
vec3( 0, 1, 0 ),
vec3( t1.z, 0, t1.w )
);
vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
#ifdef USE_CLEARCOAT
float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );
vec3 ccIrradiance = dotNLcc * directLight.color;
clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
#endif
#ifdef USE_SHEEN
sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );
#endif
#ifdef USE_IRIDESCENCE
reflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );
#else
reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );
#endif
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
#ifdef USE_CLEARCOAT
clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
#endif
#ifdef USE_SHEEN
sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );
#endif
vec3 singleScattering = vec3( 0.0 );
vec3 multiScattering = vec3( 0.0 );
vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
#ifdef USE_IRIDESCENCE
computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
#else
computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
#endif
vec3 totalScattering = singleScattering + multiScattering;
vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
reflectedLight.indirectSpecular += radiance * singleScattering;
reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct RE_Direct_Physical
#define RE_Direct_RectArea RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,dU=`
GeometricContext geometry;
geometry.position = - vViewPosition;
geometry.normal = normal;
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
#ifdef USE_CLEARCOAT
geometry.clearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
float dotNVi = saturate( dot( normal, geometry.viewDir ) );
if ( material.iridescenceThickness == 0.0 ) {
material.iridescence = 0.0;
} else {
material.iridescence = saturate( material.iridescence );
}
if ( material.iridescence > 0.0 ) {
material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
PointLight pointLight;
#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
PointLightShadow pointLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
pointLight = pointLights[ i ];
getPointLightInfo( pointLight, geometry, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
pointLightShadow = pointLightShadows[ i ];
directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
#endif
RE_Direct( directLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
SpotLight spotLight;
vec4 spotColor;
vec3 spotLightCoord;
bool inSpotLightMap;
#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
SpotLightShadow spotLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
spotLight = spotLights[ i ];
getSpotLightInfo( spotLight, geometry, directLight );
#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
#else
#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
#endif
#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
#endif
#undef SPOT_LIGHT_MAP_INDEX
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
spotLightShadow = spotLightShadows[ i ];
directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
#endif
RE_Direct( directLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
DirectionalLight directionalLight;
#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
DirectionalLightShadow directionalLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
directionalLight = directionalLights[ i ];
getDirectionalLightInfo( directionalLight, geometry, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
directionalLightShadow = directionalLightShadows[ i ];
directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
#endif
RE_Direct( directLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
RectAreaLight rectAreaLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
rectAreaLight = rectAreaLights[ i ];
RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
vec3 iblIrradiance = vec3( 0.0 );
vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );
#if ( NUM_HEMI_LIGHTS > 0 )
#pragma unroll_loop_start
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );
}
#pragma unroll_loop_end
#endif
#endif
#if defined( RE_IndirectSpecular )
vec3 radiance = vec3( 0.0 );
vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,fU=`#if defined( RE_IndirectDiffuse )
#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vUv2 );
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
irradiance += lightMapIrradiance;
#endif
#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
iblIrradiance += getIBLIrradiance( geometry.normal );
#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );
#ifdef USE_CLEARCOAT
clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );
#endif
#endif`,hU=`#if defined( RE_IndirectDiffuse )
RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
#endif`,pU=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,mU=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
uniform float logDepthBufFC;
varying float vFragDepth;
varying float vIsPerspective;
#endif`,gU=`#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
varying float vFragDepth;
varying float vIsPerspective;
#else
uniform float logDepthBufFC;
#endif
#endif`,_U=`#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
vFragDepth = 1.0 + gl_Position.w;
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#else
if ( isPerspectiveMatrix( projectionMatrix ) ) {
gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
gl_Position.z *= gl_Position.w;
}
#endif
#endif`,vU=`#ifdef USE_MAP
vec4 sampledDiffuseColor = texture2D( map, vUv );
#ifdef DECODE_VIDEO_TEXTURE
sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
#endif
diffuseColor *= sampledDiffuseColor;
#endif`,yU=`#ifdef USE_MAP
uniform sampler2D map;
#endif`,bU=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
#endif
#ifdef USE_MAP
diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,xU=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
uniform mat3 uvTransform;
#endif
#ifdef USE_MAP
uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`,SU=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
vec4 texelMetalness = texture2D( metalnessMap, vUv );
metalnessFactor *= texelMetalness.b;
#endif`,MU=`#ifdef USE_METALNESSMAP
uniform sampler2D metalnessMap;
#endif`,wU=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
vColor *= morphTargetBaseInfluence;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
#if defined( USE_COLOR_ALPHA )
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
#elif defined( USE_COLOR )
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
#endif
}
#endif`,AU=`#ifdef USE_MORPHNORMALS
objectNormal *= morphTargetBaseInfluence;
#ifdef MORPHTARGETS_TEXTURE
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
}
#else
objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
#endif
#endif`,CU=`#ifdef USE_MORPHTARGETS
uniform float morphTargetBaseInfluence;
#ifdef MORPHTARGETS_TEXTURE
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
uniform sampler2DArray morphTargetsTexture;
uniform ivec2 morphTargetsTextureSize;
vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
int y = texelIndex / morphTargetsTextureSize.x;
int x = texelIndex - y * morphTargetsTextureSize.x;
ivec3 morphUV = ivec3( x, y, morphTargetIndex );
return texelFetch( morphTargetsTexture, morphUV, 0 );
}
#else
#ifndef USE_MORPHNORMALS
uniform float morphTargetInfluences[ 8 ];
#else
uniform float morphTargetInfluences[ 4 ];
#endif
#endif
#endif`,TU=`#ifdef USE_MORPHTARGETS
transformed *= morphTargetBaseInfluence;
#ifdef MORPHTARGETS_TEXTURE
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
}
#else
transformed += morphTarget0 * morphTargetInfluences[ 0 ];
transformed += morphTarget1 * morphTargetInfluences[ 1 ];
transformed += morphTarget2 * morphTargetInfluences[ 2 ];
transformed += morphTarget3 * morphTargetInfluences[ 3 ];
#ifndef USE_MORPHNORMALS
transformed += morphTarget4 * morphTargetInfluences[ 4 ];
transformed += morphTarget5 * morphTargetInfluences[ 5 ];
transformed += morphTarget6 * morphTargetInfluences[ 6 ];
transformed += morphTarget7 * morphTargetInfluences[ 7 ];
#endif
#endif
#endif`,EU=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
vec3 fdx = dFdx( vViewPosition );
vec3 fdy = dFdy( vViewPosition );
vec3 normal = normalize( cross( fdx, fdy ) );
#else
vec3 normal = normalize( vNormal );
#ifdef DOUBLE_SIDED
normal = normal * faceDirection;
#endif
#ifdef USE_TANGENT
vec3 tangent = normalize( vTangent );
vec3 bitangent = normalize( vBitangent );
#ifdef DOUBLE_SIDED
tangent = tangent * faceDirection;
bitangent = bitangent * faceDirection;
#endif
#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )
mat3 vTBN = mat3( tangent, bitangent, normal );
#endif
#endif
#endif
vec3 geometryNormal = normal;`,DU=`#ifdef OBJECTSPACE_NORMALMAP
normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
#ifdef FLIP_SIDED
normal = - normal;
#endif
#ifdef DOUBLE_SIDED
normal = normal * faceDirection;
#endif
normal = normalize( normalMatrix * normal );
#elif defined( TANGENTSPACE_NORMALMAP )
vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
mapN.xy *= normalScale;
#ifdef USE_TANGENT
normal = normalize( vTBN * mapN );
#else
normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );
#endif
#elif defined( USE_BUMPMAP )
normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,IU=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,RU=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,OU=`#ifndef FLAT_SHADED
vNormal = normalize( transformedNormal );
#ifdef USE_TANGENT
vTangent = normalize( transformedTangent );
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
#endif
#endif`,LU=`#ifdef USE_NORMALMAP
uniform sampler2D normalMap;
uniform vec2 normalScale;
#endif
#ifdef OBJECTSPACE_NORMALMAP
uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )
vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {
vec3 q0 = dFdx( eye_pos.xyz );
vec3 q1 = dFdy( eye_pos.xyz );
vec2 st0 = dFdx( vUv.st );
vec2 st1 = dFdy( vUv.st );
vec3 N = surf_norm;
vec3 q1perp = cross( q1, N );
vec3 q0perp = cross( N, q0 );
vec3 T = q1perp * st0.x + q0perp * st1.x;
vec3 B = q1perp * st0.y + q0perp * st1.y;
float det = max( dot( T, T ), dot( B, B ) );
float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );
return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );
}
#endif`,PU=`#ifdef USE_CLEARCOAT
vec3 clearcoatNormal = geometryNormal;
#endif`,zU=`#ifdef USE_CLEARCOAT_NORMALMAP
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;
clearcoatMapN.xy *= clearcoatNormalScale;
#ifdef USE_TANGENT
clearcoatNormal = normalize( vTBN * clearcoatMapN );
#else
clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );
#endif
#endif`,kU=`#ifdef USE_CLEARCOATMAP
uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
uniform sampler2D clearcoatRoughnessMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
uniform sampler2D clearcoatNormalMap;
uniform vec2 clearcoatNormalScale;
#endif`,UU=`#ifdef USE_IRIDESCENCEMAP
uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
uniform sampler2D iridescenceThicknessMap;
#endif`,NU=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha + 0.1;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,FU=`vec3 packNormalToRGB( const in vec3 normal ) {
return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
const float ShiftRight8 = 1. / 256.;
vec4 packDepthToRGBA( const in float v ) {
vec4 r = vec4( fract( v * PackFactors ), v );
r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;
}
float unpackRGBAToDepth( const in vec4 v ) {
return dot( v, UnpackFactors );
}
vec4 pack2HalfToRGBA( vec2 v ) {
vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( vec4 v ) {
return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {
return linearClipZ * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
return ( near * far ) / ( ( far - near ) * invClipZ - far );
}`,BU=`#ifdef PREMULTIPLIED_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif`,GU=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,VU=`#ifdef DITHERING
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,WU=`#ifdef DITHERING
vec3 dithering( vec3 color ) {
float grid_position = rand( gl_FragCoord.xy );
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
return color + dither_shift_RGB;
}
#endif`,jU=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
vec4 texelRoughness = texture2D( roughnessMap, vUv );
roughnessFactor *= texelRoughness.g;
#endif`,HU=`#ifdef USE_ROUGHNESSMAP
uniform sampler2D roughnessMap;
#endif`,$U=`#if NUM_SPOT_LIGHT_COORDS > 0
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
struct DirectionalLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
struct SpotLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
struct PointLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
}
vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
return unpackRGBATo2Half( texture2D( shadow, uv ) );
}
float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
float occlusion = 1.0;
vec2 distribution = texture2DDistribution( shadow, uv );
float hard_shadow = step( compare , distribution.x );
if (hard_shadow != 1.0 ) {
float distance = compare - distribution.x ;
float variance = max( 0.00000, distribution.y * distribution.y );
float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
}
return occlusion;
}
float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
float shadow = 1.0;
shadowCoord.xyz /= shadowCoord.w;
shadowCoord.z += shadowBias;
bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
bool inFrustum = all( inFrustumVec );
bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
bool frustumTest = all( frustumTestVec );
if ( frustumTest ) {
#if defined( SHADOWMAP_TYPE_PCF )
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
float dx0 = - texelSize.x * shadowRadius;
float dy0 = - texelSize.y * shadowRadius;
float dx1 = + texelSize.x * shadowRadius;
float dy1 = + texelSize.y * shadowRadius;
float dx2 = dx0 / 2.0;
float dy2 = dy0 / 2.0;
float dx3 = dx1 / 2.0;
float dy3 = dy1 / 2.0;
shadow = (
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
) * ( 1.0 / 17.0 );
#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
float dx = texelSize.x;
float dy = texelSize.y;
vec2 uv = shadowCoord.xy;
vec2 f = fract( uv * shadowMapSize + 0.5 );
uv -= f * texelSize;
shadow = (
texture2DCompare( shadowMap, uv, shadowCoord.z ) +
texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
f.x ) +
mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
f.x ) +
mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
f.y ) +
mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
f.y ) +
mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
f.x ),
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
f.x ),
f.y )
) * ( 1.0 / 9.0 );
#elif defined( SHADOWMAP_TYPE_VSM )
shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
#else
shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
#endif
}
return shadow;
}
vec2 cubeToUV( vec3 v, float texelSizeY ) {
vec3 absV = abs( v );
float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
absV *= scaleToCube;
v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
vec2 planar = v.xy;
float almostATexel = 1.5 * texelSizeY;
float almostOne = 1.0 - almostATexel;
if ( absV.z >= almostOne ) {
if ( v.z > 0.0 )
planar.x = 4.0 - v.x;
} else if ( absV.x >= almostOne ) {
float signX = sign( v.x );
planar.x = v.z * signX + 2.0 * signX;
} else if ( absV.y >= almostOne ) {
float signY = sign( v.y );
planar.x = v.x + 2.0 * signY + 2.0;
planar.y = v.z * signY - 2.0;
}
return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
}
float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
vec3 lightToPosition = shadowCoord.xyz;
float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;
vec3 bd3D = normalize( lightToPosition );
#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
return (
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
) * ( 1.0 / 9.0 );
#else
return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
#endif
}
#endif`,YU=`#if NUM_SPOT_LIGHT_COORDS > 0
uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
struct DirectionalLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
struct SpotLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
struct PointLightShadow {
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
#endif`,JU=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0
vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
vec4 shadowWorldPosition;
#endif
#if NUM_DIR_LIGHT_SHADOWS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#if NUM_SPOT_LIGHT_COORDS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
shadowWorldPosition = worldPosition;
#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
#endif
vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#endif`,ZU=`float getShadowMask() {
float shadow = 1.0;
#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
DirectionalLightShadow directionalLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
directionalLight = directionalLightShadows[ i ];
shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
}
#pragma unroll_loop_end
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
SpotLightShadow spotLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
spotLight = spotLightShadows[ i ];
shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
}
#pragma unroll_loop_end
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
PointLightShadow pointLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
pointLight = pointLightShadows[ i ];
shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
}
#pragma unroll_loop_end
#endif
#endif
return shadow;
}`,XU=`#ifdef USE_SKINNING
mat4 boneMatX = getBoneMatrix( skinIndex.x );
mat4 boneMatY = getBoneMatrix( skinIndex.y );
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,qU=`#ifdef USE_SKINNING
uniform mat4 bindMatrix;
uniform mat4 bindMatrixInverse;
uniform highp sampler2D boneTexture;
uniform int boneTextureSize;
mat4 getBoneMatrix( const in float i ) {
float j = i * 4.0;
float x = mod( j, float( boneTextureSize ) );
float y = floor( j / float( boneTextureSize ) );
float dx = 1.0 / float( boneTextureSize );
float dy = 1.0 / float( boneTextureSize );
y = dy * ( y + 0.5 );
vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );
mat4 bone = mat4( v1, v2, v3, v4 );
return bone;
}
#endif`,QU=`#ifdef USE_SKINNING
vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
vec4 skinned = vec4( 0.0 );
skinned += boneMatX * skinVertex * skinWeight.x;
skinned += boneMatY * skinVertex * skinWeight.y;
skinned += boneMatZ * skinVertex * skinWeight.z;
skinned += boneMatW * skinVertex * skinWeight.w;
transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`,KU=`#ifdef USE_SKINNING
mat4 skinMatrix = mat4( 0.0 );
skinMatrix += skinWeight.x * boneMatX;
skinMatrix += skinWeight.y * boneMatY;
skinMatrix += skinWeight.z * boneMatZ;
skinMatrix += skinWeight.w * boneMatW;
skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
#ifdef USE_TANGENT
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
#endif
#endif`,eN=`float specularStrength;
#ifdef USE_SPECULARMAP
vec4 texelSpecular = texture2D( specularMap, vUv );
specularStrength = texelSpecular.r;
#else
specularStrength = 1.0;
#endif`,tN=`#ifdef USE_SPECULARMAP
uniform sampler2D specularMap;
#endif`,nN=`#if defined( TONE_MAPPING )
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,iN=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
return toneMappingExposure * color;
}
vec3 ReinhardToneMapping( vec3 color ) {
color *= toneMappingExposure;
return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 OptimizedCineonToneMapping( vec3 color ) {
color *= toneMappingExposure;
color = max( vec3( 0.0 ), color - 0.004 );
return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
const mat3 ACESInputMat = mat3(
vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),
vec3( 0.04823, 0.01566, 0.83777 )
);
const mat3 ACESOutputMat = mat3(
vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),
vec3( -0.07367, -0.00605, 1.07602 )
);
color *= toneMappingExposure / 0.6;
color = ACESInputMat * color;
color = RRTAndODTFit( color );
color = ACESOutputMat * color;
return saturate( color );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,rN=`#ifdef USE_TRANSMISSION
material.transmission = transmission;
material.transmissionAlpha = 1.0;
material.thickness = thickness;
material.attenuationDistance = attenuationDistance;
material.attenuationColor = attenuationColor;
#ifdef USE_TRANSMISSIONMAP
material.transmission *= texture2D( transmissionMap, vUv ).r;
#endif
#ifdef USE_THICKNESSMAP
material.thickness *= texture2D( thicknessMap, vUv ).g;
#endif
vec3 pos = vWorldPosition;
vec3 v = normalize( cameraPosition - pos );
vec3 n = inverseTransformDirection( normal, viewMatrix );
vec4 transmission = getIBLVolumeRefraction(
n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,
material.attenuationColor, material.attenuationDistance );
material.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );
totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );
#endif`,oN=`#ifdef USE_TRANSMISSION
uniform float transmission;
uniform float thickness;
uniform float attenuationDistance;
uniform vec3 attenuationColor;
#ifdef USE_TRANSMISSIONMAP
uniform sampler2D transmissionMap;
#endif
#ifdef USE_THICKNESSMAP
uniform sampler2D thicknessMap;
#endif
uniform vec2 transmissionSamplerSize;
uniform sampler2D transmissionSamplerMap;
uniform mat4 modelMatrix;
uniform mat4 projectionMatrix;
varying vec3 vWorldPosition;
vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
vec3 modelScale;
modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
return normalize( refractionVector ) * thickness * modelScale;
}
float applyIorToRoughness( const in float roughness, const in float ior ) {
return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
}
vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
#ifdef texture2DLodEXT
return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );
#else
return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );
#endif
}
vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
if ( isinf( attenuationDistance ) ) {
return radiance;
} else {
vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance;
}
}
vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,
const in vec3 attenuationColor, const in float attenuationDistance ) {
vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
vec3 refractedRayExit = position + transmissionRay;
vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
vec2 refractionCoords = ndcPos.xy / ndcPos.w;
refractionCoords += 1.0;
refractionCoords /= 2.0;
vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );
vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );
}
#endif`,aN=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
varying vec2 vUv;
#endif`,sN=`#ifdef USE_UV
#ifdef UVS_VERTEX_ONLY
vec2 vUv;
#else
varying vec2 vUv;
#endif
uniform mat3 uvTransform;
#endif`,lN=`#ifdef USE_UV
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
#endif`,uN=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
varying vec2 vUv2;
#endif`,cN=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
attribute vec2 uv2;
varying vec2 vUv2;
uniform mat3 uv2Transform;
#endif`,dN=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
#endif`,fN=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
vec4 worldPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
worldPosition = instanceMatrix * worldPosition;
#endif
worldPosition = modelMatrix * worldPosition;
#endif`;const hN=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,pN=`uniform sampler2D t2D;
varying vec2 vUv;
void main() {
gl_FragColor = texture2D( t2D, vUv );
#ifdef DECODE_VIDEO_TEXTURE
gl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );
#endif
#include <tonemapping_fragment>
#include <encodings_fragment>
}`,mN=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
gl_Position.z = gl_Position.w;
}`,gN=`#include <envmap_common_pars_fragment>
uniform float opacity;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
vec3 vReflect = vWorldDirection;
#include <envmap_fragment>
gl_FragColor = envColor;
gl_FragColor.a *= opacity;
#include <tonemapping_fragment>
#include <encodings_fragment>
}`,_N=`#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
#include <uv_vertex>
#include <skinbase_vertex>
#ifdef USE_DISPLACEMENTMAP
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vHighPrecisionZW = gl_Position.zw;
}`,vN=`#if DEPTH_PACKING == 3200
uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( 1.0 );
#if DEPTH_PACKING == 3200
diffuseColor.a = opacity;
#endif
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <logdepthbuf_fragment>
float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
#if DEPTH_PACKING == 3200
gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
#elif DEPTH_PACKING == 3201
gl_FragColor = packDepthToRGBA( fragCoordZ );
#endif
}`,yN=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <skinbase_vertex>
#ifdef USE_DISPLACEMENTMAP
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <worldpos_vertex>
#include <clipping_planes_vertex>
vWorldPosition = worldPosition.xyz;
}`,bN=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( 1.0 );
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
float dist = length( vWorldPosition - referencePosition );
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
dist = saturate( dist );
gl_FragColor = packDepthToRGBA( dist );
}`,xN=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}`,SN=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
#include <tonemapping_fragment>
#include <encodings_fragment>
}`,MN=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
vLineDistance = scale * lineDistance;
#include <color_vertex>
#include <morphcolor_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}`,wN=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
if ( mod( vLineDistance, totalSize ) > dashSize ) {
discard;
}
vec3 outgoingLight = vec3( 0.0 );
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <color_fragment>
outgoingLight = diffuseColor.rgb;
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}`,AN=`#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <uv2_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <worldpos_vertex>
#include <envmap_vertex>
#include <fog_vertex>
}`,CN=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <specularmap_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vUv2 );
reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
#else
reflectedLight.indirectDiffuse += vec3( 1.0 );
#endif
#include <aomap_fragment>
reflectedLight.indirectDiffuse *= diffuseColor.rgb;
vec3 outgoingLight = reflectedLight.indirectDiffuse;
#include <envmap_fragment>
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,TN=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <uv2_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <envmap_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,EN=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <specularmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_lambert_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
#include <envmap_fragment>
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,DN=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
vViewPosition = - mvPosition.xyz;
}`,IN=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
vec3 viewDir = normalize( vViewPosition );
vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
vec3 y = cross( viewDir, x );
vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
#ifdef USE_MATCAP
vec4 matcapColor = texture2D( matcap, uv );
#else
vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
#endif
vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,RN=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
varying vec3 vViewPosition;
#endif
#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
vViewPosition = - mvPosition.xyz;
#endif
}`,ON=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
#ifdef OPAQUE
gl_FragColor.a = 1.0;
#endif
}`,LN=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <uv2_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <envmap_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,PN=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <specularmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_phong_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
#include <envmap_fragment>
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,zN=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
varying vec3 vWorldPosition;
#endif
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <uv2_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
#ifdef USE_TRANSMISSION
vWorldPosition = worldPosition.xyz;
#endif
}`,kN=`#define STANDARD
#ifdef PHYSICAL
#define IOR
#define SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
uniform float ior;
#endif
#ifdef SPECULAR
uniform float specularIntensity;
uniform vec3 specularColor;
#ifdef USE_SPECULARINTENSITYMAP
uniform sampler2D specularIntensityMap;
#endif
#ifdef USE_SPECULARCOLORMAP
uniform sampler2D specularColorMap;
#endif
#endif
#ifdef USE_CLEARCOAT
uniform float clearcoat;
uniform float clearcoatRoughness;
#endif
#ifdef USE_IRIDESCENCE
uniform float iridescence;
uniform float iridescenceIOR;
uniform float iridescenceThicknessMinimum;
uniform float iridescenceThicknessMaximum;
#endif
#ifdef USE_SHEEN
uniform vec3 sheenColor;
uniform float sheenRoughness;
#ifdef USE_SHEENCOLORMAP
uniform sampler2D sheenColorMap;
#endif
#ifdef USE_SHEENROUGHNESSMAP
uniform sampler2D sheenRoughnessMap;
#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <bsdfs>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <roughnessmap_fragment>
#include <metalnessmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <clearcoat_normal_fragment_begin>
#include <clearcoat_normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_physical_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
#include <transmission_fragment>
vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
#ifdef USE_SHEEN
float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;
#endif
#ifdef USE_CLEARCOAT
float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );
vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;
#endif
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,UN=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <uv2_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,NN=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_toon_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,FN=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <color_vertex>
#include <morphcolor_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
gl_PointSize = size;
#ifdef USE_SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
#endif
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <worldpos_vertex>
#include <fog_vertex>
}`,BN=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <map_particle_fragment>
#include <color_fragment>
#include <alphatest_fragment>
outgoingLight = diffuseColor.rgb;
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}`,GN=`#include <common>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <project_vertex>
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,VN=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
}`,WN=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
vec2 scale;
scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
#ifndef USE_SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
if ( isPerspective ) scale *= - mvPosition.z;
#endif
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
vec2 rotatedPosition;
rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
mvPosition.xy += rotatedPosition;
gl_Position = projectionMatrix * mvPosition;
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}`,jN=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
vec4 diffuseColor = vec4( diffuse, opacity );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
outgoingLight = diffuseColor.rgb;
#include <output_fragment>
#include <tonemapping_fragment>
#include <encodings_fragment>
#include <fog_fragment>
}`,U2={alphamap_fragment:mk,alphamap_pars_fragment:gk,alphatest_fragment:_k,alphatest_pars_fragment:vk,aomap_fragment:yk,aomap_pars_fragment:bk,begin_vertex:xk,beginnormal_vertex:Sk,bsdfs:Mk,iridescence_fragment:wk,bumpmap_pars_fragment:Ak,clipping_planes_fragment:Ck,clipping_planes_pars_fragment:Tk,clipping_planes_pars_vertex:Ek,clipping_planes_vertex:Dk,color_fragment:Ik,color_pars_fragment:Rk,color_pars_vertex:Ok,color_vertex:Lk,common:Pk,cube_uv_reflection_fragment:zk,defaultnormal_vertex:kk,displacementmap_pars_vertex:Uk,displacementmap_vertex:Nk,emissivemap_fragment:Fk,emissivemap_pars_fragment:Bk,encodings_fragment:Gk,encodings_pars_fragment:Vk,envmap_fragment:Wk,envmap_common_pars_fragment:jk,envmap_pars_fragment:Hk,envmap_pars_vertex:$k,envmap_physical_pars_fragment:rU,envmap_vertex:Yk,fog_vertex:Jk,fog_pars_vertex:Zk,fog_fragment:Xk,fog_pars_fragment:qk,gradientmap_pars_fragment:Qk,lightmap_fragment:Kk,lightmap_pars_fragment:eU,lights_lambert_fragment:tU,lights_lambert_pars_fragment:nU,lights_pars_begin:iU,lights_toon_fragment:oU,lights_toon_pars_fragment:aU,lights_phong_fragment:sU,lights_phong_pars_fragment:lU,lights_physical_fragment:uU,lights_physical_pars_fragment:cU,lights_fragment_begin:dU,lights_fragment_maps:fU,lights_fragment_end:hU,logdepthbuf_fragment:pU,logdepthbuf_pars_fragment:mU,logdepthbuf_pars_vertex:gU,logdepthbuf_vertex:_U,map_fragment:vU,map_pars_fragment:yU,map_particle_fragment:bU,map_particle_pars_fragment:xU,metalnessmap_fragment:SU,metalnessmap_pars_fragment:MU,morphcolor_vertex:wU,morphnormal_vertex:AU,morphtarget_pars_vertex:CU,morphtarget_vertex:TU,normal_fragment_begin:EU,normal_fragment_maps:DU,normal_pars_fragment:IU,normal_pars_vertex:RU,normal_vertex:OU,normalmap_pars_fragment:LU,clearcoat_normal_fragment_begin:PU,clearcoat_normal_fragment_maps:zU,clearcoat_pars_fragment:kU,iridescence_pars_fragment:UU,output_fragment:NU,packing:FU,premultiplied_alpha_fragment:BU,project_vertex:GU,dithering_fragment:VU,dithering_pars_fragment:WU,roughnessmap_fragment:jU,roughnessmap_pars_fragment:HU,shadowmap_pars_fragment:$U,shadowmap_pars_vertex:YU,shadowmap_vertex:JU,shadowmask_pars_fragment:ZU,skinbase_vertex:XU,skinning_pars_vertex:qU,skinning_vertex:QU,skinnormal_vertex:KU,specularmap_fragment:eN,specularmap_pars_fragment:tN,tonemapping_fragment:nN,tonemapping_pars_fragment:iN,transmission_fragment:rN,transmission_pars_fragment:oN,uv_pars_fragment:aN,uv_pars_vertex:sN,uv_vertex:lN,uv2_pars_fragment:uN,uv2_pars_vertex:cN,uv2_vertex:dN,worldpos_vertex:fN,background_vert:hN,background_frag:pN,cube_vert:mN,cube_frag:gN,depth_vert:_N,depth_frag:vN,distanceRGBA_vert:yN,distanceRGBA_frag:bN,equirect_vert:xN,equirect_frag:SN,linedashed_vert:MN,linedashed_frag:wN,meshbasic_vert:AN,meshbasic_frag:CN,meshlambert_vert:TN,meshlambert_frag:EN,meshmatcap_vert:DN,meshmatcap_frag:IN,meshnormal_vert:RN,meshnormal_frag:ON,meshphong_vert:LN,meshphong_frag:PN,meshphysical_vert:zN,meshphysical_frag:kN,meshtoon_vert:UN,meshtoon_frag:NN,points_vert:FN,points_frag:BN,shadow_vert:GN,shadow_frag:VN,sprite_vert:WN,sprite_frag:jN},H1={common:{diffuse:{value:new X2(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new l0},uv2Transform:{value:new l0},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new c2(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new X2(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLigh
precision mediump float;
precision mediump int;
varying vec3 vOutputDirection;
uniform sampler2D envMap;
uniform int samples;
uniform float weights[ n ];
uniform bool latitudinal;
uniform float dTheta;
uniform float mipInt;
uniform vec3 poleAxis;
#define ENVMAP_TYPE_CUBE_UV
#include <cube_uv_reflection_fragment>
vec3 getSample( float theta, vec3 axis ) {
float cosTheta = cos( theta );
// Rodrigues' axis-angle rotation
vec3 sampleDirection = vOutputDirection * cosTheta
+ cross( axis, vOutputDirection ) * sin( theta )
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
return bilinearCubeUV( envMap, sampleDirection, mipInt );
}
void main() {
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
}
axis = normalize( axis );
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
for ( int i = 1; i < n; i++ ) {
if ( i >= samples ) {
break;
}
float theta = dTheta * float( i );
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
}
}
`,blending:X9,depthTest:!1,depthWrite:!1})}function Dd(){return new y9({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ea(),fragmentShader:`
precision mediump float;
precision mediump int;
varying vec3 vOutputDirection;
uniform sampler2D envMap;
#include <common>
void main() {
vec3 outputDirection = normalize( vOutputDirection );
vec2 uv = equirectUv( outputDirection );
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
}
`,blending:X9,depthTest:!1,depthWrite:!1})}function Id(){return new y9({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ea(),fragmentShader:`
precision mediump float;
precision mediump int;
uniform float flipEnvMap;
varying vec3 vOutputDirection;
uniform samplerCube envMap;
void main() {
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
}
`,blending:X9,depthTest:!1,depthWrite:!1})}function Ea(){return`
precision mediump float;
precision mediump int;
attribute float faceIndex;
varying vec3 vOutputDirection;
// RH coordinate system; PMREM face-indexing convention
vec3 getDirection( vec2 uv, float face ) {
uv = 2.0 * uv - 1.0;
vec3 direction = vec3( uv, 1.0 );
if ( face == 0.0 ) {
direction = direction.zyx; // ( 1, v, u ) pos x
} else if ( face == 1.0 ) {
direction = direction.xzy;
direction.xz *= -1.0; // ( -u, 1, -v ) pos y
} else if ( face == 2.0 ) {
direction.x *= -1.0; // ( -u, v, 1 ) pos z
} else if ( face == 3.0 ) {
direction = direction.zyx;
direction.xz *= -1.0; // ( -1, v, -u ) neg x
} else if ( face == 4.0 ) {
direction = direction.xzy;
direction.xy *= -1.0; // ( -u, -1, v ) neg y
} else if ( face == 5.0 ) {
direction.z *= -1.0; // ( u, v, -1 ) neg z
}
return direction;
}
void main() {
vOutputDirection = getDirection( uv, faceIndex );
gl_Position = vec4( position, 1.0 );
}
`}function eF(r){let e=new WeakMap,t=null;function n(s){if(s&&s.isTexture){const c=s.mapping,f=c===Hr||c===$r,h=c===q8||c===Q8;if(f||h)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let m=e.get(s);return t===null&&(t=new Td(r)),m=f?t.fromEquirectangular(s,m):t.fromCubemap(s,m),e.set(s,m),m.texture}else{if(e.has(s))return e.get(s).texture;{const m=s.image;if(f&&m&&m.height>0||h&&m&&i(m)){t===null&&(t=new Td(r));const g=f?t.fromEquirectangular(s):t.fromCubemap(s);return e.set(s,g),s.addEventListener("dispose",o),g.texture}else return null}}}return s}function i(s){let c=0;const f=6;for(let h=0;h<f;h++)s[h]!==void 0&&c++;return c===f}function o(s){const c=s.target;c.removeEventListener("dispose",o);const f=e.get(c);f!==void 0&&(e.delete(c),f.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:a}}function tF(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(n){n.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(n){const i=t(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function nF(r,e,t,n){const i={},o=new WeakMap;function a(m){const g=m.target;g.index!==null&&e.remove(g.index);for(const S in g.attributes)e.remove(g.attributes[S]);g.removeEventListener("dispose",a),delete i[g.id];const v=o.get(g);v&&(e.remove(v),o.delete(g)),n.releaseStatesOfGeometry(g),g.isInstancedBufferGeometry===!0&&delete g._maxInstanceCount,t.memory.geometries--}function s(m,g){return i[g.id]===!0||(g.addEventListener("dispose",a),i[g.id]=!0,t.memory.geometries++),g}function c(m){const g=m.attributes;for(const S in g)e.update(g[S],34962);const v=m.morphAttributes;for(const S in v){const _=v[S];for(let x=0,M=_.length;x<M;x++)e.update(_[x],34962)}}function f(m){const g=[],v=m.index,S=m.attributes.position;let _=0;if(v!==null){const A=v.array;_=v.version;for(let D=0,T=A.length;D<T;D+=3){const E=A[D+0],C=A[D+1],P=A[D+2];g.push(E,C,C,P,P,E)}}else{const A=S.array;_=S.version;for(let D=0,T=A.length/3-1;D<T;D+=3){const E=D+0,C=D+1,P=D+2;g.push(E,C,C,P,P,E)}}const x=new(Zh(g)?np:tp)(g,1);x.version=_;const M=o.get(m);M&&e.remove(M),o.set(m,x)}function h(m){const g=o.get(m);if(g){const v=m.index;v!==null&&g.version<v.version&&f(m)}else f(m);return o.get(m)}return{get:s,update:c,getWireframeAttribute:h}}function iF(r,e,t,n){const i=n.isWebGL2;let o;function a(g){o=g}let s,c;function f(g){s=g.type,c=g.bytesPerElement}function h(g,v){r.drawElements(o,v,s,g*c),t.update(v,o,1)}function m(g,v,S){if(S===0)return;let _,x;if(i)_=r,x="drawElementsInstanced";else if(_=e.get("ANGLE_instanced_arrays"),x="drawElementsInstancedANGLE",_===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}_[x](o,v,s,g*c,S),t.update(v,o,S)}this.setMode=a,this.setIndex=f,this.render=h,this.renderInstances=m}function rF(r){
`),n=[],i=Math.max(e-6,0),o=Math.min(e+6,t.length);for(let a=i;a<o;a++){const s=a+1;n.push(`${s===e?">":" "} ${s}: ${t[a]}`)}return n.join(`
`)}function tB(r){switch(r){case B5:return["Linear","( value )"];case M3:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",r),["Linear","( value )"]}}function Nd(r,e,t){const n=r.getShaderParameter(e,35713),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const a=parseInt(o[1]);return t.toUpperCase()+`
`+i+`
`+eB(r.getShaderSource(e),a)}else return i}function nB(r,e){const t=tB(e);return"vec4 "+r+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function iB(r,e){let t;switch(e){case xz:t="Linear";break;case Sz:t="Reinhard";break;case Mz:t="OptimizedCineon";break;case wz:t="ACESFilmic";break;case Az:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function rB(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.tangentSpaceNormalMap||r.clearcoatNormalMap||r.flatShading||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(W6).join(`
`)}function oB(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
`)}function aB(r,e){const t={},n=r.getProgramParameter(e,35721);for(let i=0;i<n;i++){const o=r.getActiveAttrib(e,i),a=o.name;let s=1;o.type===35674&&(s=2),o.type===35675&&(s=3),o.type===35676&&(s=4),t[a]={type:o.type,location:r.getAttribLocation(e,a),locationSize:s}}return t}function W6(r){return r!==""}function Fd(r,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Bd(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const sB=/^[ \t]*#include +<([\w\d./]+)>/gm;function Qr(r){return r.replace(sB,lB)}function lB(r,e){const t=U2[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return Qr(t)}const uB=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Gd(r){return r.replace(uB,cB)}function cB(r,e,t,n){let i="";for(let o=parseInt(e);o<parseInt(t);o++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return i}function Vd(r){let e="precision "+r.precision+` float;
precision `+r.precision+" int;";return r.precision==="highp"?e+=`
#define HIGH_PRECISION`:r.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function dB(r){let e="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===Wh?e="SHADOWMAP_TYPE_PCF":r.shadowMapType===KP?e="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===V6&&(e="SHADOWMAP_TYPE_VSM"),e}function fB(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case q8:case Q8:e="ENVMAP_TYPE_CUBE";break;case xt:e="ENVMAP_TYPE_CUBE_UV";break}return e}function hB(r){let e="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case Q8:e="ENVMAP_MODE_REFRACTION";break}return e}function pB(r){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case $h:e="ENVMAP_BLENDING_MULTIPLY";break;case yz:e="ENVMAP_BLENDING_MIX";break;case bz:e="ENVMAP_BLENDING_ADD";break}return e}function mB(r){const e=r.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:n,maxMip:t}}function gB(r,e,t,n){const i=r.getContext(),o=t.defines;let a=t.vertexShader,s=t.fragmentShader;const c=dB(t),f=fB(t),h=hB(t),m=pB(t),g=mB(t),v=t.isWebGL2?"":rB(t),S=oB(o),_=i.createProgram();let x,M,A=t.glslVersion?"#version "+t.glslVersion+`
`:"";t.isRawShaderMaterial?(x=[S].filter(W6).join(`
`),x.length>0&&(x+=`
`),M=[v,S].filter(W6).join(`
`),M.length>0&&(M+=`
`)):(x=[Vd(t),"#define SHADER_NAME "+t.shaderName,S,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
`].filter(W6).join(`
`),M=[v,Vd(t),"#define SHADER_NAME "+t.shaderName,S,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.envMap?"#define "+h:"",t.envMap?"#define "+m:"",g?"#define CUBEUV_TEXEL_WIDTH "+g.texelWidth:"",g?"#define CUBEUV_TEXEL_HEIGHT "+g.texelHeight:"",g?"#define CUBEUV_MAX_MIP "+g.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==_9?"#define TONE_MAPPING":"",t.toneMapping!==_9?U2.tonemapping_pars_fragment:"",t.toneMapping!==_9?iB("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",U2.encodings_pars_fragment,nB("linearToOutputTexel",t.outputEncoding),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
`].filter(W6).join(`
`)),a=Qr(a),a=Fd(a,t),a=Bd(a,t),s=Qr(s),s=Fd(s,t),s=Bd(s,t),a=Gd(a),s=Gd(s),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(A=`#version 300 es
`,x=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+x,M=["#define varying in",t.glslVersion===cd?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===cd?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
`)+`
`+M);const D=A+x+a,T=A+M+s,E=Ud(i,35633,D),C=Ud(i,35632,T);if(i.attachShader(_,E),i.attachShader(_,C),t.index0AttributeName!==void 0?i.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_),r.debug.checkShaderErrors){const L=i.getProgramInfoLog(_).trim(),W=i.getShaderInfoLog(E).trim(),e1=i.getShaderInfoLog(C).trim();let a1=!0,$=!0;if(i.getProgramParameter(_,35714)===!1){a1=!1;const N=Nd(i,E,"vertex"),H=Nd(i,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,35715)+`
Program Info Log: `+L+`
`+N+`
`+H)}else L!==""?console.warn("THREE.WebGLProgram: Program Info Log:",L):(W===""||e1==="")&&($=!1);$&&(this.diagnostics={runnable:a1,programLog:L,vertexShader:{log:W,prefix:x},fragmentShader:{log:e1,prefix:M}})}i.deleteShader(E),i.deleteShader(C);let P;this.getUniforms=function(){return P===void 0&&(P=new Ye(i,_)),P};let I;return this.getAttributes=function(){return I===void 0&&(I=aB(i,_)),I},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.name=t.shaderName,this.id=KF++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=C,this}let _B=0;class vB{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),o=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.add(o),o.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new yB(e),t.set(e,n)),n}}class yB{constructor(e){this.id=_B++,this.code=e,this.usedTimes=0}}function bB(r,e,t,n,i,o,a){const s=new ep,c=new vB,f=[],h=i.isWebGL2,m=i.logarithmicDepthBuffer,g=i.vertexTextures;let v=i.precision;const S={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(I,L,W,e1,a1){const $=e1.fog,N=a1.geometry,H=I.isMeshStandardMaterial?e1.environment:null,K=(I.isMeshStandardMaterial?t:e).get(I.envMap||H),X=K&&K.mapping===xt?K.image.height:null,B=S[I.type];I.precision!==null&&(v=i.getMaxPrecision(I.precision),v!==I.precision&&console.warn("THREE.WebGLProgram.getParameters:",I.precision,"not supported, using",v,"instead."));const j=N.morphAttributes.position||N.morphAttributes.normal||N.morphAttributes.color,J=j!==void 0?j.length:0;let u1=0;N.morphAttributes.position!==void 0&&(u1=1),N.morphAttributes.normal!==void 0&&(u1=2),N.morphAttributes.color!==void 0&&(u1=3);let d1,x1,v1,o1;if(B){const e2=N0[B];d1=e2.vertexShader,x1=e2.fragmentShader}else d1=I.vertexShader,x1=I.fragmentShader,c.update(I),v1=c.getVertexShaderID(I),o1=c.getFragmentShaderID(I);const n1=r.getRenderTarget(),E1=I.alphaTest>0,T1=I.clearcoat>0,M1=I.iridescence>0;return{isWebGL2:h,shaderID:B,shaderName:I.type,vertexShader:d1,fragmentShader:x1,defines:I.defines,customVertexShaderID:v1,customFragmentShaderID:o1,isRawShaderMaterial:I.isRawShaderMaterial===!0,glslVersion:I.glslVersion,precision:v,instancing:a1.isInstancedMesh===!0,instancingColor:a1.isInstancedMesh===!0&&a1.instanceColor!==null,supportsVertexTextures:g,outputEncoding:n1===null?r.outputEncoding:n1.isXRRenderTarget===!0?n1.texture.encoding:B5,map:!!I.map,matcap:!!I.matcap,envMap:!!K,envMapMode:K&&K.mapping,envMapCubeUVHeight:X,lightMap:!!I.lightMap,aoMap:!!I.aoMap,emissiveMap:!!I.emissiveMap,bumpMap:!!I.bumpMap,normalMap:!!I.normalMap,objectSpaceNormalMap:I.normalMapType===Hz,tangentSpaceNormalMap:I.normalMapType===jz,decodeVideoTexture:!!I.map&&I.map.isVideoTexture===!0&&I.map.encoding===M3,clearcoat:T1,clearcoatMap:T1&&!!I.clearcoatMap,clearcoatRoughnessMap:T1&&!!I.clearcoatRoughnessMap,clearcoatNormalMap:T1&&!!I.clearcoatNormalMap,iridescence:M1,iridescenceMap:M1&&!!I.iridescenceMap,iridescenceThicknessMap:M1&&!!I.iridescenceThicknessMa
gl_Position = vec4( position, 1.0 );
}`,LB=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
void main() {
const float samples = float( VSM_SAMPLES );
float mean = 0.0;
float squared_mean = 0.0;
float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
for ( float i = 0.0; i < samples; i ++ ) {
float uvOffset = uvStart + i * uvStride;
#ifdef HORIZONTAL_PASS
vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
mean += distribution.x;
squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
#else
float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
mean += depth;
squared_mean += depth * depth;
#endif
}
mean = mean / samples;
squared_mean = squared_mean / samples;
float std_dev = sqrt( squared_mean - mean * mean );
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;function PB(r,e,t){let n=new op;const i=new c2,o=new c2,a=new t4,s=new IB({depthPacking:Wz}),c=new RB,f={},h=t.maxTextureSize,m={0:h0,1:X8,2:G0},g=new y9({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new c2},radius:{value:4}},vertexShader:OB,fragmentShader:LB}),v=g.clone();v.defines.HORIZONTAL_PASS=1;const S=new L4;S.setAttribute("position",new H4(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new e4(S,g),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Wh,this.render=function(T,E,C){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||T.length===0)return;const P=r.getRenderTarget(),I=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),W=r.state;W.setBlending(X9),W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);for(let e1=0,a1=T.length;e1<a1;e1++){const $=T[e1],N=$.shadow;if(N===void 0){console.warn("THREE.WebGLShadowMap:",$,"has no shadow.");continue}if(N.autoUpdate===!1&&N.needsUpdate===!1)continue;i.copy(N.mapSize);const H=N.getFrameExtents();if(i.multiply(H),o.copy(N.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(o.x=Math.floor(h/H.x),i.x=o.x*H.x,N.mapSize.x=o.x),i.y>h&&(o.y=Math.floor(h/H.y),i.y=o.y*H.y,N.mapSize.y=o.y)),N.map===null){const X=this.type!==V6?{minFilter:C4,magFilter:C4}:{};N.map=new G5(i.x,i.y,X),N.map.texture.name=$.name+".shadowMap",N.camera.updateProjectionMatrix()}r.setRenderTarget(N.map),r.clear();const K=N.getViewportCount();for(let X=0;X<K;X++){const B=N.getViewport(X);a.set(o.x*B.x,o.y*B.y,o.x*B.z,o.y*B.w),W.viewport(a),N.updateMatrices($,X),n=N.getFrustum(),D(E,C,N.camera,$,this.type)}N.isPointLightShadow!==!0&&this.type===V6&&M(N,C),N.needsUpdate=!1}x.needsUpdate=!1,r.setRenderTarget(P,I,L)};function M(T,E){const C=e.update(_);g.defines.VSM_SAMPLES!==T.blurSamples&&(g.defines.VSM_SAMPLES=T.blurSamples,v.defines.VSM_SAMPLES=T.blurSamples,g.needsUpdate=!0,v.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new G5(i.x,i.y)),g.uniforms.shadow_pass.value=T.map.texture,g.uniforms.resolution.value=T.mapSize,g.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(E,null,C,g,_,null),v.uniforms.shadow_pass.value=T.mapPass.texture,v.uniforms.resolution.value=T.mapSize,v.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(E,null,C,v,_,null)}function A(T,E,C,P,I,L){let W=null;const e1=C.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(e1!==void 0?W=e1:W=C.isPointLight===!0?c:s,r.localClippingEnabled&&E.clipShadows===!0&&Array.isArray(E.clippingPlanes)&&E.clippingPlanes.length!==0||E.displacementMap&&E.displacementScale!==0||E.alphaMap&&E.alphaTest>0){const a1=W.uuid,$=E.uuid;let N=f[a1];N===void 0&&(N={},f[a1]=N);let H=N[$];H===void 0&&(H=W.clone(),N[$]=H),W=H}return W.visible=E.visible,W.wireframe=E.wireframe,L===V6?W.side=E.shadowSide!==null?E.shadowSide:E.side:W.side=E.shadowSide!==null?E.shadowSide:m[E.side],W.alphaMap=E.alphaMap,W.alphaTest=E.alphaTest,W.clipShadows=E.clipShadows,W.clippingPlanes=E.clippingPlanes,W.clipIntersection=E.clipIntersection,W.displacementMap=E.displacementMap,W.displacementScale=E.displacementScale,W.displacementBias=E.displacementBias,W.wireframeLinewidth=E.wireframeLinewidth,W.linewidth=E.linewidth,C.isPointLight===!0&&W.isMeshDistanceMaterial===!0&&(W.referencePosition.setFromMatrixPosition(C.matrixWorld),W.nearDistance=P,W.farDistance=I),W}function D(T,E,C,P,I){if(T.visible===!1)return;if(T.layers.test(E.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&I===V6)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,T.matrixWorld);const e1=e.update(T),a1=T.material;if(Array.isArray(a1)){const $=e1.groups;for(let N=0,H=$.length;N<H;N++){const K=$[N],X=a1[K.materialIndex];if(X&&X.visible){const B=A(T,X,P,C.near,C.far,I);r.renderBufferDirect(C,null,e1,B,T,K)}}}else if(a1.visible){const $=A(T,a1,P,C.near,C.far,I);r.renderBufferDirect(C,null,e1,$,T,null)}}const W=T.children;for(let e1=0,a1=W.length;e1<a1;e1++)D(W[e1],E,C,P,I)}}func
* GSAP 3.11.5
* https://greensock.com
*
* @license Copyright 2008-2023, GreenSock. All rights reserved.
* Subject to the terms at https://greensock.com/standard-license or for
* Club GreenSock members, the agreement issued with that membership.
* @author: Jack Doyle, jack@greensock.com
*/var $4={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},t6={duration:.5,overwrite:!1,delay:0},La,c4,L3,u0=1e8,a3=1/u0,eo=Math.PI*2,UG=eo/4,NG=0,Mp=Math.sqrt,FG=Math.cos,BG=Math.sin,Y3=function(e){return typeof e=="string"},A3=function(e){return typeof e=="function"},b9=function(e){return typeof e=="number"},Pa=function(e){return typeof e=="undefined"},$0=function(e){return typeof e=="object"},D4=function(e){return e!==!1},za=function(){return typeof window!="undefined"},Ve=function(e){return A3(e)||Y3(e)},wp=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},d4=Array.isArray,to=/(?:-?\.?\d|\.)+/gi,Ap=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,W8=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Pi=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Cp=/[+-]=-?[.\d]+/,Tp=/[^,'"\[\]\s]+/gi,GG=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,g3,o0,no,ka,Y4={},lt={},Ep,Dp=function(e){return(lt=V5(e,Y4))&&O4},Ua=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},ut=function(e,t){return!t&&console.warn(e)},Ip=function(e,t){return e&&(Y4[e]=t)&&lt&&(lt[e]=t)||Y4},i7=function(){return 0},VG={suppressEvents:!0,isStart:!0,kill:!1},Je={suppressEvents:!0,kill:!1},WG={suppressEvents:!0},Na={},Q9=[],io={},Rp,W4={},zi={},uf=30,Ze=[],Fa="",Ba=function(e){var t=e[0],n,i;if($0(t)||A3(t)||(e=[e]),!(n=(t._gsap||{}).harness)){for(i=Ze.length;i--&&!Ze[i].targetTest(t););n=Ze[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new tm(e[i],n)))||e.splice(i,1);return e},z5=function(e){return e._gsap||Ba(c0(e))[0]._gsap},Op=function(e,t,n){return(n=e[t])&&A3(n)?e[t]():Pa(n)&&e.getAttribute&&e.getAttribute(t)||n},I4=function(e,t){return(e=e.split(",")).forEach(t)||e},D3=function(e){return Math.round(e*1e5)/1e5||0},K3=function(e){return Math.round(e*1e7)/1e7||0},Y8=function(e,t){var n=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),n==="+"?e+i:n==="-"?e-i:n==="*"?e*i:e/i},jG=function(e,t){for(var n=t.length,i=0;e.indexOf(t[i])<0&&++i<n;);return i<n},ct=function(){var e=Q9.length,t=Q9.slice(0),n,i;for(io={},Q9.length=0,n=0;n<e;n++)i=t[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},Lp=function(e,t,n,i){Q9.length&&!c4&&ct(),e.render(t,n,i||c4&&t<0&&(e._initted||e._startAt)),Q9.length&&!c4&&ct()},Pp=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(Tp).length<2?t:Y3(e)?e.trim():e},zp=function(e){return e},m0=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},HG=function(e){return function(t,n){for(var i in n)i in t||i==="duration"&&e||i==="ease"||(t[i]=n[i])}},V5=function(e,t){for(var n in t)e[n]=t[n];return e},cf=function r(e,t){for(var n in t)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(e[n]=$0(t[n])?r(e[n]||(e[n]={}),t[n]):t[n]);return e},dt=function(e,t){var n={},i;for(i in e)i in t||(n[i]=e[i]);return n},Z6=function(e){var t=e.parent||g3,n=e.keyframes?HG(d4(e.keyframes)):m0;if(D4(e.inherit))for(;t;)n(e,t.vars.defaults),t=t.parent||t._dp;return e},$G=function(e,t){for(var n=e.length,i=n===t.length;i&&n--&&e[n]===t[n];);return n<0},kp=function(e,t,n,i,o){n===void 0&&(n="_first"),i===void 0&&(i="_last");var a=e[i],s;if(o)for(s=t[o];a&&a[o]>s;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[i]=t,t._prev=a,t.parent=t._dp=e,t},wt=function(e,t,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var o=t._prev,a=t._next;o?o._next=a:e[n]===t&&(e[n]=a),a?a._prev=o:e[i]===t&&(e[i]=o),t._next=t._prev=t.parent=null},t5=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove(e),e._act=0},k5=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},YG=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},ro=function(e,t,n,i){return e._startAt&&(c4?e._startAt.revert(Je):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},JG=function r(e){return!e||e._ts&&r(e.parent)},df=function(e){return e._repeat?n6(e._tTime,e=e.duration()+e._rDelay)*e:0},n6=function(e,t){var n=Math.floor(e/=t);return e&&n===e?n-1:
* CSSPlugin 3.11.5
* https://greensock.com
*
* Copyright 2008-2023, GreenSock. All rights reserved.
* Subject to the terms at https://greensock.com/standard-license or for
* Club GreenSock members, the agreement issued with that membership.
* @author: Jack Doyle, jack@greensock.com
*/var gf,J9,J8,$a,I5,_f,Ya,EV=function(){return typeof window!="undefined"},x9={},w5=180/Math.PI,Z8=Math.PI/180,O8=Math.atan2,vf=1e8,Ja=/([A-Z])/g,DV=/(left|right|width|margin|padding|x)/i,IV=/[\s,\(]\S/,W0={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},fo=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},RV=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},OV=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},LV=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},cm=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},dm=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},PV=function(e,t,n){return e.style[t]=n},zV=function(e,t,n){return e.style.setProperty(t,n)},kV=function(e,t,n){return e._gsap[t]=n},UV=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},NV=function(e,t,n,i,o){var a=e._gsap;a.scaleX=a.scaleY=n,a.renderTransform(o,a)},FV=function(e,t,n,i,o){var a=e._gsap;a[t]=n,a.renderTransform(o,a)},_3="transform",I0=_3+"Origin",BV=function r(e,t){var n=this,i=this.target,o=i.style;if(e in x9){if(this.tfm=this.tfm||{},e!=="transform")e=W0[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return n.tfm[a]=h9(i,a)}):this.tfm[e]=i._gsap.x?i._gsap[e]:h9(i,e);else return W0.transform.split(",").forEach(function(a){return r.call(n,a,t)});if(this.props.indexOf(_3)>=0)return;i._gsap.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(I0,t,"")),e=_3}(o||t)&&this.props.push(e,t,o[e])},fm=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},GV=function(){var e=this.props,t=this.target,n=t.style,i=t._gsap,o,a;for(o=0;o<e.length;o+=3)e[o+1]?t[e[o]]=e[o+2]:e[o+2]?n[e[o]]=e[o+2]:n.removeProperty(e[o].substr(0,2)==="--"?e[o]:e[o].replace(Ja,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)i[a]=this.tfm[a];i.svg&&(i.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),o=Ya(),(!o||!o.isStart)&&!n[_3]&&(fm(n),i.uncache=1)}},hm=function(e,t){var n={target:e,props:[],revert:GV,save:BV};return e._gsap||O4.core.getCache(e),t&&t.split(",").forEach(function(i){return n.save(i)}),n},pm,ho=function(e,t){var n=J9.createElementNS?J9.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):J9.createElement(e);return n.style?n:J9.createElement(e)},H0=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(Ja,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,s6(t)||t,1)||""},yf="O,Moz,ms,Ms,Webkit".split(","),s6=function(e,t,n){var i=t||I5,o=i.style,a=5;if(e in o&&!n)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(yf[a]+e in o););return a<0?null:(a===3?"ms":a>=0?yf[a]:"")+e},po=function(){EV()&&window.document&&(gf=window,J9=gf.document,J8=J9.documentElement,I5=ho("div")||{style:{}},ho("div"),_3=s6(_3),I0=_3+"Origin",I5.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",pm=!!s6("perspective"),Ya=O4.core.reverting,$a=1)},Gi=function r(e){var t=ho("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,o=this.style.cssText,a;if(J8.appendChild(t),t.appendChild(this),this.style.display="block",e)try{a=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch(s){}else this._gsapBBox&&(a=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),J8.removeChild(t),this.style.cssText=o,a},bf=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},mm=function(e){var t;try{t=e.getBBox()}catch(n){t=Gi.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===Gi||(t=Gi.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+bf(e,["x","cx","x1"])||0,y:+bf(e,["y","cy","y1"])||0,width:0,height:0}:t},gm=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&mm(e))},a7=function(e,t){if(t){var n=e.style;t in x9&&t!==I0&&(t=_3),n.removeProperty?((t.substr(0,2)==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),n.removeProperty(t.r
`)),v.vertexShader=v.vertexShader.replace("gl_PointSize = size;",["gl_PointSize = percent * size;"].join(`
`))};const g=new mp(i,m);return m.color=new X2(n),g.name="飞行线",g}function qV(r,e,t,n,i,o){const a=n7(r,e,t),s=new t1(a.x,a.y,a.z),c=n7(r,n,i),f=new t1(c.x,c.y,c.z),h=QV(s,f),m=KV(r,h.startPoint,h.endPoint,o);return m.quaternion.multiply(h.quaternion),m}function QV(r,e){const t=new t1(0,0,0),n=r.clone().sub(t),i=e.clone().sub(t),o=n.clone().cross(i).normalize(),a=new t1(0,0,1),s=new v9().setFromUnitVectors(o,a),c=r.clone().applyQuaternion(s),f=e.clone().applyQuaternion(s),m=c.clone().add(f).multiplyScalar(.5).clone().sub(t).normalize(),g=new t1(0,1,0),v=new v9().setFromUnitVectors(m,g),S=c.clone().applyQuaternion(v),_=f.clone().applyQuaternion(v);return{quaternion:s.clone().invert().multiply(v.clone().invert()),startPoint:S,endPoint:_}}function KV(r,e,t,n){const o=new t1().addVectors(e,t).multiplyScalar(.5).clone().normalize(),a=Af(e,t,new t1(0,0,0)),s=o.multiplyScalar(r+a*r*.2),c=tW(e,t,s),f=Math.abs(c.y-s.y),h=Af(e,new t1(0,-1,0),c),m=-Math.PI/2+h,g=Math.PI-m,v=eW(c.x,c.y,f,m,g,n.color);v.center=c,v.topCoord=s;const S=(g-m)/7,_=XV(f,m,m+S,n.flyLineColor);return _.position.y=c.y,v.add(_),_.flyEndAngle=g-m-S,_.startAngle=m,_.AngleZ=v.flyEndAngle*Math.random(),v.userData.flyLine=_,v}function Af(r,e,t){const n=r.clone().sub(t).normalize(),i=e.clone().sub(t).normalize(),o=n.clone().dot(i);return Math.acos(o)}function eW(r,e,t,n,i,o){const a=new L4,c=new Ia(r,e,t,n,i,!1).getSpacedPoints(80);a.setFromPoints(c);const f=new pp({color:o||13731143});return new ZB(a,f)}function tW(r,e,t){const n=r.lengthSq(),i=e.lengthSq(),o=t.lengthSq(),a=r.x,s=r.y,c=e.x,f=e.y,h=t.x,m=t.y,g=a*f+c*m+h*s-a*m-c*s-h*f,v=(i*m+n*f+o*s-i*s-o*f-n*m)/g/2,S=(o*c+i*a+n*h-n*c-i*h-o*a)/g/2;return new t1(v,S,0)}const nW=`
varying vec2 vUv;
varying vec3 vNormal;
varying vec3 vp;
varying vec3 vPositionNormal;
void main(void){
vUv = uv;
vNormal = normalize( normalMatrix * normal ); // 转换到视图空间
vp = position;
vPositionNormal = normalize(( modelViewMatrix * vec4(position, 1.0) ).xyz);
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,iW=`uniform vec3 glowColor;
uniform float bias;
uniform float power;
uniform float time;
varying vec3 vp;
varying vec3 vNormal;
varying vec3 vPositionNormal;
uniform float scale;
// 获取纹理
uniform sampler2D map;
// 纹理坐标
varying vec2 vUv;
void main(void){
float a = pow( bias + scale * abs(dot(vNormal, vPositionNormal)), power );
if(vp.y > time && vp.y < time + 20.0) {
float t = smoothstep(0.0, 0.8, (1.0 - abs(0.5 - (vp.y - time) / 20.0)) / 3.0 );
gl_FragColor = mix(gl_FragColor, vec4(glowColor, 1.0), t * t );
}
gl_FragColor = mix(gl_FragColor, vec4( glowColor, 1.0 ), a);
float b = 0.8;
gl_FragColor = gl_FragColor + texture2D( map, vUv );
}`;class rW{constructor(e){l1(this,"group");l1(this,"earthGroup");l1(this,"around");l1(this,"aroundPoints");l1(this,"options");l1(this,"uniforms");l1(this,"timeValue");l1(this,"earth");l1(this,"punctuationMaterial");l1(this,"markupPoint");l1(this,"waveMeshArr");l1(this,"circleLineList");l1(this,"circleList");l1(this,"x");l1(this,"n");l1(this,"isRotation");l1(this,"flyLineArcGroup");this.options=e,this.group=new m9,this.group.name="group",this.group.scale.set(0,0,0),this.earthGroup=new m9,this.group.add(this.earthGroup),this.earthGroup.name="EarthGroup",this.markupPoint=new m9,this.markupPoint.name="markupPoint",this.waveMeshArr=[],this.circleLineList=[],this.circleList=[],this.x=0,this.n=0,this.isRotation=this.options.earth.isRotation,this.timeValue=200,this.uniforms={glowColor:{value:new X2(840171)},scale:{type:"f",value:-1},bias:{type:"f",value:1},power:{type:"f",value:3.3},time:{type:"f",value:this.timeValue},isHover:{value:!1},map:{value:void 0}}}init(){return m3(this,null,function*(){return new Promise(e=>{(()=>m3(this,null,function*(){this.createEarth(),this.createEarthGlow(),this.createEarthAperture(),yield this.createMarkupPoint(),this.createAnimateCircle(),this.createFlyLine(),this.show(),e()}))()})})}createEarth(){const e=new j9(this.options.earth.radius,50,50),t=new j9(this.options.earth.radius+10,60,60),n=new Da({color:8519679,transparent:!0,sizeAttenuation:!0,opacity:.1,vertexColors:!1,size:.2}),i=new mp(t,n);this.earthGroup.add(i),this.uniforms.map.value=this.options.textures.earth;const o=new y9({uniforms:this.uniforms,vertexShader:nW,fragmentShader:iW});o.needsUpdate=!0,this.earth=new e4(e,o),this.earth.name="earth",this.earthGroup.add(this.earth)}createEarthGlow(){const e=this.options.earth.radius,t=this.options.textures.glow,n=new fp({map:t,color:4427985,transparent:!0,opacity:.7,depthWrite:!1}),i=new JB(n);i.scale.set(e*3,e*3,1),this.earthGroup.add(i)}createEarthAperture(){const e=["varying vec3 vVertexWorldPosition;","varying vec3 vVertexNormal;","varying vec4 vFragColor;","void main(){"," vVertexNormal = normalize(normalMatrix * normal);"," vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;"," // set gl_Position"," gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join(`
`),t={uniforms:{coeficient:{type:"f",value:1},power:{type:"f",value:3},glowColor:{type:"c",value:new X2(4427985)}},vertexShader:e,fragmentShader:["uniform vec3 glowColor;","uniform float coeficient;","uniform float power;","varying vec3 vVertexNormal;","varying vec3 vVertexWorldPosition;","varying vec4 vFragColor;","void main(){"," vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;"," vec3 viewCameraToVertex = (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;"," viewCameraToVertex= normalize(viewCameraToVertex);"," float intensity = pow(coeficient + dot(vVertexNormal, viewCameraToVertex), power);"," gl_FragColor = vec4(glowColor, intensity);","}"].join(`
`)},n=new y9({uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,blending:O5,transparent:!0,depthWrite:!1}),i=new j9(this.options.earth.radius+0,50,50),o=new e4(i,n);this.earthGroup.add(o)}createMarkupPoint(){return m3(this,null,function*(){yield Promise.all(this.options.data.map(e=>m3(this,null,function*(){const t=this.options.earth.radius,n=e.startArray.E,i=e.startArray.N;this.punctuationMaterial=new p9({color:this.options.punctuation.circleColor,map:this.options.textures.label,transparent:!0,depthWrite:!1});const o=lf({radius:t,lon:n,lat:i,material:this.punctuationMaterial});this.markupPoint.add(o);const a=sf({radius:this.options.earth.radius,lon:n,lat:i,index:0,textures:this.options.textures,punctuation:this.options.punctuation});this.markupPoint.add(a);const s=af({radius:t,lon:n,lat:i,textures:this.options.textures});this.markupPoint.add(s),this.waveMeshArr.push(s),yield Promise.all(e.endArray.map(c=>{const f=c.E,h=c.N,m=lf({radius:t,lon:f,lat:h,material:this.punctuationMaterial});this.markupPoint.add(m);const g=sf({radius:this.options.earth.radius,lon:f,lat:h,index:1,textures:this.options.textures,punctuation:this.options.punctuation});this.markupPoint.add(g);const v=af({radius:t,lon:f,lat:h,textures:this.options.textures});this.markupPoint.add(v),this.waveMeshArr.push(v)})),this.earthGroup.add(this.markupPoint)})))})}createAnimateCircle(){const e=zG({radius:this.options.earth.radius+15,number:150,closed:!0}),t=new p9({color:"#0c3172",transparent:!0,opacity:.4,side:G0}),n=kG({pointList:e,material:t,number:100,radius:.1});this.earthGroup.add(n);const i=n.clone();i.scale.set(1.2,1.2,1.2),i.rotateZ(Math.PI/6),this.earthGroup.add(i);const o=n.clone();o.scale.set(.8,.8,.8),o.rotateZ(-Math.PI/6),this.earthGroup.add(o);const a=new e4(new j9(this.options.satellite.size,32,32),new p9({color:"#e0b187"})),s=new e4(new j9(this.options.satellite.size,32,32),new p9({color:"#628fbb"})),c=new e4(new j9(this.options.satellite.size,32,32),new p9({color:"#806bdf"}));this.circleLineList.push(n,i,o),a.name=s.name=c.name="卫星";for(let f=0;f<this.options.satellite.number;f++){const h=a.clone(),m=Math.floor(e.length/this.options.satellite.number);h.position.set(e[m*(f+1)][0]*1,e[m*(f+1)][1]*1,e[m*(f+1)][2]*1),n.add(h);const g=s.clone(),v=Math.floor(e.length/this.options.satellite.number);g.position.set(e[v*(f+1)][0]*1,e[v*(f+1)][1]*1,e[v*(f+1)][2]*1),i.add(g);const S=s.clone(),_=Math.floor(e.length/this.options.satellite.number);S.position.set(e[_*(f+1)][0]*1,e[_*(f+1)][1]*1,e[_*(f+1)][2]*1),o.add(S)}}createFlyLine(){this.flyLineArcGroup=new m9,this.flyLineArcGroup.userData.flyLineArray=[],this.earthGroup.add(this.flyLineArcGroup),this.options.data.forEach(e=>{e.endArray.forEach(t=>{const n=qV(this.options.earth.radius,e.startArray.E,e.startArray.N,t.E,t.N,this.options.flyLine);this.flyLineArcGroup.add(n),this.flyLineArcGroup.userData.flyLineArray.push(n.userData.flyLine)})})}show(){xm.to(this.group.scale,{x:1,y:1,z:1,duration:2,ease:"Quadratic"})}render(){var e,t;(t=(e=this.flyLineArcGroup)==null?void 0:e.userData.flyLineArray)==null||t.forEach(n=>{n.rotation.z+=this.options.flyLine.speed,n.rotation.z>=n.flyEndAngle&&(n.rotation.z=0)}),this.isRotation&&(this.earthGroup.rotation.y+=this.options.earth.rotateSpeed),this.circleLineList.forEach(n=>{n.rotateY(this.options.satellite.rotateSpeed)}),this.uniforms.time.value=this.uniforms.time.value<-this.timeValue?this.timeValue:this.uniforms.time.value-1,this.waveMeshArr.length&&this.waveMeshArr.forEach(n=>{n.userData.scale+=.007,n.scale.set(n.userData.size*n.userData.scale,n.userData.size*n.userData.scale,n.userData.size*n.userData.scale),n.userData.scale<=1.5?n.material.opacity=(n.userData.scale-1)*2:n.userData.scale>1.5&&n.userData.scale<=2?n.material.opacity=1-(n.userData.scale-1.5)*2:n.userData.scale=1})}}class oW{constructor(e){l1(this,"basic");l1(this,"scene");l1(this,"camera");l1(this,"renderer");l1(this,"controls");l1(this,"material");l1(this,"resources");l1(this,"option");l1(this,"earth");this.option=e,this.basic=new pG(e.dom),this.scene=this.basic.scen
* wordcloud2.js
* http://timdream.org/wordcloud2.js/
*
* Copyright 2011 - 2019 Tim Guan-tin Chien and contributors.
* Released under the MIT license
*/window.setImmediate||(window.setImmediate=function(){return window.msSetImmediate||window.webkitSetImmediate||window.mozSetImmediate||window.oSetImmediate||function(){if(!window.postMessage||!window.addEventListener)return null;var t=[void 0],n="zero-timeout-message",i=function(a){var s=t.length;return t.push(a),window.postMessage(n+s.toString(36),"*"),s};return window.addEventListener("message",function(a){if(!(typeof a.data!="string"||a.data.substr(0,n.length)!==n)){a.stopImmediatePropagation();var s=parseInt(a.data.substr(n.length),36);t[s]&&(t[s](),t[s]=void 0)}},!0),window.clearImmediate=function(a){t[a]&&(t[a]=void 0)},i}()||function(t){window.setTimeout(t,0)}}());window.clearImmediate||(window.clearImmediate=function(){return window.msClearImmediate||window.webkitClearImmediate||window.mozClearImmediate||window.oClearImmediate||function(t){window.clearTimeout(t)}}());var rs=function(){var e=document.createElement("canvas");if(!e||!e.getContext)return!1;var t=e.getContext("2d");return!(!t||!t.getImageData||!t.fillText||!Array.prototype.some||!Array.prototype.push)}(),Ao=function(){if(rs){for(var e=document.createElement("canvas").getContext("2d"),t=20,n,i;t;){if(e.font=t.toString(10)+"px sans-serif",e.measureText("").width===n&&e.measureText("m").width===i)return t+1;n=e.measureText("").width,i=e.measureText("m").width,t--}return 0}}(),Uj=function(r){if(Array.isArray(r)){var e=r.slice();return e.splice(0,2),e}else return[]},Nj=function(e){for(var t,n,i=e.length;i;)t=Math.floor(Math.random()*i),n=e[--i],e[i]=e[t],e[t]=n;return e},L8={},It=function(e,t){if(!rs)return;var n=Math.floor(Math.random()*Date.now());Array.isArray(e)||(e=[e]),e.forEach(function(v1,o1){if(typeof v1=="string"){if(e[o1]=document.getElementById(v1),!e[o1])throw new Error("The element id specified is not found.")}else if(!v1.tagName&&!v1.appendChild)throw new Error("You must pass valid HTML elements, or ID of the element.")});var i={list:[],fontFamily:'"Trebuchet MS", "Heiti TC", "", "Arial Unicode MS", "Droid Fallback Sans", sans-serif',fontWeight:"normal",color:"random-dark",minSize:0,weightFactor:1,clearCanvas:!0,backgroundColor:"#fff",gridSize:8,drawOutOfBound:!1,shrinkToFit:!1,origin:null,drawMask:!1,maskColor:"rgba(255,0,0,0.3)",maskGapWidth:.3,layoutAnimation:!0,wait:0,abortThreshold:0,abort:function(){},minRotation:-Math.PI/2,maxRotation:Math.PI/2,rotationStep:.1,shuffle:!0,rotateRatio:.1,shape:"circle",ellipticity:.65,classes:null,hover:null,click:null};if(t)for(var o in t)o in i&&(i[o]=t[o]);if(typeof i.weightFactor!="function"){var a=i.weightFactor;i.weightFactor=function(o1){return o1*a}}if(typeof i.shape!="function")switch(i.shape){case"circle":default:i.shape="circle";break;case"cardioid":i.shape=function(o1){return 1-Math.sin(o1)};break;case"diamond":i.shape=function(o1){var n1=o1%(2*Math.PI/4);return 1/(Math.cos(n1)+Math.sin(n1))};break;case"square":i.shape=function(o1){return Math.min(1/Math.abs(Math.cos(o1)),1/Math.abs(Math.sin(o1)))};break;case"triangle-forward":i.shape=function(o1){var n1=o1%(2*Math.PI/3);return 1/(Math.cos(n1)+Math.sqrt(3)*Math.sin(n1))};break;case"triangle":case"triangle-upright":i.shape=function(o1){var n1=(o1+Math.PI*3/2)%(2*Math.PI/3);return 1/(Math.cos(n1)+Math.sqrt(3)*Math.sin(n1))};break;case"pentagon":i.shape=function(o1){var n1=(o1+.955)%(2*Math.PI/5);return 1/(Math.cos(n1)+.726543*Math.sin(n1))};break;case"star":i.shape=function(o1){var n1=(o1+.955)%(2*Math.PI/10);return(o1+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-n1)+3.07768*Math.sin(2*Math.PI/10-n1)):1/(Math.cos(n1)+3.07768*Math.sin(n1))};break}i.gridSize=Math.max(Math.floor(i.gridSize),4);var s=i.gridSize,c=s-i.maskGapWidth,f=Math.abs(i.maxRotation-i.minRotation),h=Math.min(i.maxRotation,i.minRotation),m=i.rotationStep,g,v,S,_,x,M,A;function D(v1,o1){return"hsl("+(Math.random()*360).toFixed()+","+(Math.random()*30+70).toFixed()+"%,"+(Math.random()*(o1-v1)+v1).toFixed()+"%)"}switch(i.color){case"random-dark":A=function(){return D(10,50)};break;case"random-light":A=function(){return D(50,90)};break;defau
height: ${i.mergedConfig.headerHeight}px;
line-height: ${i.mergedConfig.headerHeight}px;
width: ${i.widths[A]}px;
`),align:i.aligns[A],innerHTML:M},null,12,pH))),128))],4)):I3("",!0),i.mergedConfig?(G(),h1("div",{key:1,class:"rows",style:Z2(`height: ${u(n)-(i.header.length?i.mergedConfig.headerHeight:0)}px;`)},[(G(!0),h1(F1,null,g2(i.rows,(M,A)=>(G(),h1("div",{class:"row-item",key:`${M.toString()}${M.scroll}`,style:Z2(`
height: ${i.heights[A]}px;
line-height: ${i.heights[A]}px;
background-color: ${i.mergedConfig[M.rowIndex%2===0?"evenRowBGC":"oddRowBGC"]};
2023-06-06 13:24:29 +08:00
`)},[(G(!0),h1(F1,null,g2(M.ceils,(D,T)=>(G(),h1("div",{class:"ceil",key:`${D}${A}${T}`,style:Z2(`width: ${i.widths[T]}px;`),align:i.aligns[T],innerHTML:D},null,12,mH))),128))],4))),128))],4)):I3("",!0)]))}});const _H=F2(gH,[["__scopeId","data-v-a6b4b361"]]),vH=Object.freeze(Object.defineProperty({__proto__:null,default:_H},Symbol.toStringTag,{value:"Module"})),yH=""+new URL("../png/bar_x.png",import.meta.url).href,bH=Object.freeze(Object.defineProperty({__proto__:null,default:yH},Symbol.toStringTag,{value:"Module"})),xH=""+new URL("../png/bar_y.png",import.meta.url).href,SH=Object.freeze(Object.defineProperty({__proto__:null,default:xH},Symbol.toStringTag,{value:"Module"})),MH=""+new URL("../png/capsule.png",import.meta.url).href,wH=Object.freeze(Object.defineProperty({__proto__:null,default:MH},Symbol.toStringTag,{value:"Module"})),AH=""+new URL("../png/dial.png",import.meta.url).href,CH=Object.freeze(Object.defineProperty({__proto__:null,default:AH},Symbol.toStringTag,{value:"Module"})),TH=""+new URL("../png/funnel.png",import.meta.url).href,EH=Object.freeze(Object.defineProperty({__proto__:null,default:TH},Symbol.toStringTag,{value:"Module"})),DH=""+new URL("../png/graph.png",import.meta.url).href,IH=Object.freeze(Object.defineProperty({__proto__:null,default:DH},Symbol.toStringTag,{value:"Module"})),RH=""+new URL("../png/heatmap.png",import.meta.url).href,OH=Object.freeze(Object.defineProperty({__proto__:null,default:RH},Symbol.toStringTag,{value:"Module"})),LH=""+new URL("../png/line.png",import.meta.url).href,PH=Object.freeze(Object.defineProperty({__proto__:null,default:LH},Symbol.toStringTag,{value:"Module"})),zH=""+new URL("../png/line_gradient.png",import.meta.url).href,kH=Object.freeze(Object.defineProperty({__proto__:null,default:zH},Symbol.toStringTag,{value:"Module"})),UH=""+new URL("../png/line_gradient_single.png",import.meta.url).href,NH=Object.freeze(Object.defineProperty({__proto__:null,default:UH},Symbol.toStringTag,{value:"Module"})),FH=""+new URL("../png/line_linear_single.png",import.meta.url).href,BH=Object.freeze(Object.defineProperty({__proto__:null,default:FH},Symbol.toStringTag,{value:"Module"})),GH=""+new URL("../png/map.png",import.meta.url).href,VH=Object.freeze(Object.defineProperty({__proto__:null,default:GH},Symbol.toStringTag,{value:"Module"})),WH=""+new URL("../png/map_amap.png",import.meta.url).href,jH=Object.freeze(Object.defineProperty({__proto__:null,default:WH},Symbol.toStringTag,{value:"Module"})),HH=""+new URL("../png/pie-circle.png",import.meta.url).href,$H=Object.freeze(Object.defineProperty({__proto__:null,default:HH},Symbol.toStringTag,{value:"Module"})),YH=""+new URL("../png/pie.png",import.meta.url).href,JH=Object.freeze(Object.defineProperty({__proto__:null,default:YH},Symbol.toStringTag,{value:"Module"})),ZH=""+new URL("../png/process.png",import.meta.url).href,XH=Object.freeze(Object.defineProperty({__proto__:null,default:ZH},Symbol.toStringTag,{value:"Module"})),qH=""+new URL("../png/radar.png",import.meta.url).href,QH=Object.freeze(Object.defineProperty({__proto__:null,default:qH},Symbol.toStringTag,{value:"Module"})),KH=""+new URL("../png/sankey.png",import.meta.url).href,e$=Object.freeze(Object.defineProperty({__proto__:null,default:KH},Symbol.toStringTag,{value:"Module"})),t$=""+new URL("../png/scatter-logarithmic-regression.png",import.meta.url).href,n$=Object.freeze(Object.defineProperty({__proto__:null,default:t$},Symbol.toStringTag,{value:"Module"})),i$=""+new URL("../png/scatter-multi.png",import.meta.url).href,r$=Object.freeze(Object.defineProperty({__proto__:null,default:i$},Symbol.toStringTag,{value:"Module"})),o$=""+new URL("../png/scatter.png",import.meta.url).href,a$=Object.freeze(Object.defineProperty({__proto__:null,default:o$},Symbol.toStringTag,{value:"Module"})),s$=""+new URL("../png/tree_map.png",import.meta.url).href,l$=Object.freeze(Object.defineProperty({__proto__:null,default:s$},Symbol.toStringTag,{value:"Module"})),u$=""+new URL("../png/water_WaterPolo.png",import.meta.url).href,c$=Object.freeze(Object.defineProperty({__proto__:null,d